/* ===================================
   Discord 訊息監控系統 - 基礎設置
   ================================ */

/* ===== CSS 重置與基礎設置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 滾動條美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6b46a3);
}

/* Firefox 滾動條 */
* {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

/* 文字選擇樣式 */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #1f2937;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.2);
    color: #1f2937;
}

/* ===== CSS 變數 ===== */
:root {
    /* 主色調 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #4c51bf;
    
    /* 狀態顏色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* 中性顏色 */
    --text-primary: #374151;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    /* 背景顏色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f3f4f6;
    
    /* 邊框和陰影 */
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* 間距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ===== 基礎元素樣式 ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== 動畫定義 ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes btnSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes successPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    80% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== 輔助功能 ===== */
.will-change {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 搜尋高亮 */
.highlight {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    color: #92400e;
}

/* 顯示/隱藏控制 */
.message-only {
    display: block;
}

.forum-only {
    display: none;
}

body.forum-mode .forum-only {
    display: inline-block !important;
}

body.forum-mode .message-only {
    display: none !important;
}