/**
 * MCDM Online - 主题样式
 * 支持亮色和暗色主题切换
 */

/* ========== 暗色主题（默认继承原有样式） ========== */
[data-theme="dark"] {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: rgba(17, 24, 39, 0.9);
    --sidebar-bg: #0d1320;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-tertiary: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(99, 102, 241, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.02);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.1);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --input-bg: rgba(17, 24, 39, 0.6);
    --table-header-bg: rgba(99, 102, 241, 0.1);
    --table-row-hover: rgba(99, 102, 241, 0.05);
    --navbar-bg: rgba(10, 14, 23, 0.7);
    --navbar-bg-scrolled: rgba(10, 14, 23, 0.95);
    --topbar-bg: rgba(10, 14, 23, 0.8);
    --result-bg: rgba(16, 185, 129, 0.1);
    --result-border: rgba(16, 185, 129, 0.3);
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.3);
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: rgba(239, 68, 68, 0.3);
}

/* ========== 亮色主题 ========== */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.95);
    --sidebar-bg: #ffffff;
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --accent-tertiary: #8b5cf6;
    --accent-cyan: #0891b2;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;
    --accent-purple: #7c3aed;
    --accent-blue: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(99, 102, 241, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow-glow: 0 4px 20px rgba(99, 102, 241, 0.08);
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    --input-bg: rgba(241, 245, 249, 0.8);
    --table-header-bg: rgba(99, 102, 241, 0.08);
    --table-row-hover: rgba(99, 102, 241, 0.04);
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --navbar-bg-scrolled: rgba(255, 255, 255, 0.98);
    --topbar-bg: rgba(255, 255, 255, 0.9);
    --result-bg: rgba(16, 185, 129, 0.08);
    --result-border: rgba(16, 185, 129, 0.25);
    --warning-bg: rgba(245, 158, 11, 0.08);
    --warning-border: rgba(245, 158, 11, 0.25);
    --error-bg: rgba(239, 68, 68, 0.08);
    --error-border: rgba(239, 68, 68, 0.25);
}

/* ========== 亮色主题特定样式覆盖 ========== */

/* 背景渐变调整 */
[data-theme="light"] .bg-gradient {
    background: 
        radial-gradient(ellipse 100% 80% at 10% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 90% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 50% 90%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
}

[data-theme="light"] .bg-grid {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
}

[data-theme="light"] .shape-1 {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="light"] .shape-2 {
    background: rgba(139, 92, 246, 0.05);
}

[data-theme="light"] .shape-3 {
    background: rgba(6, 182, 212, 0.05);
}

/* 导航栏 */
[data-theme="light"] .navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .navbar.scrolled {
    background: var(--navbar-bg-scrolled);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .logo-text {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 侧边栏 */
[data-theme="light"] .sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="light"] .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
}

/* 顶部栏 */
[data-theme="light"] .topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* 主内容区背景 */
[data-theme="light"] .main-content {
    background: 
        radial-gradient(ellipse 80% 50% at 70% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 30% 80%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
        var(--bg-primary);
}

/* 卡片 */
[data-theme="light"] .method-card,
[data-theme="light"] .card,
[data-theme="light"] .input-section,
[data-theme="light"] .result-section,
[data-theme="light"] .highlight-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .method-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* 输入框 */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: var(--input-bg);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 表格 */
[data-theme="light"] table {
    background: var(--bg-secondary);
}

[data-theme="light"] th {
    background: var(--table-header-bg);
}

[data-theme="light"] tr:hover {
    background: var(--table-row-hover);
}

[data-theme="light"] td,
[data-theme="light"] th {
    border-color: rgba(0, 0, 0, 0.06);
}

/* 按钮 */
[data-theme="light"] .btn-secondary,
[data-theme="light"] .action-btn {
    background: var(--bg-tertiary);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .action-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
}

/* 结果区域 */
[data-theme="light"] .result-item.success {
    background: var(--result-bg);
    border-color: var(--result-border);
}

[data-theme="light"] .result-item.warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

[data-theme="light"] .result-item.error {
    background: var(--error-bg);
    border-color: var(--error-border);
}

/* Hero区域 */
[data-theme="light"] .hero-badge {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

/* 统计区域 */
[data-theme="light"] .stats-section {
    background: var(--bg-secondary);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .stat-item {
    background: var(--bg-tertiary);
}

/* 页脚 */
[data-theme="light"] footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .footer-link {
    color: var(--text-secondary);
}

[data-theme="light"] .footer-link:hover {
    color: var(--accent-primary);
}

/* ========== 主题切换按钮样式 ========== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.theme-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.theme-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(15deg);
}

/* 简洁版主题切换按钮（用于侧边栏） */
.theme-toggle-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.theme-toggle-simple:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05);
}

/* 主题切换动画 */
[data-theme] {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme] * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
