/* Глобальные стили и переменные */
:root {
    --bg-light: #ffffff;
    --text-light: #1f2937;
    --text-light-secondary: #4b5563;
    --bg-dark: #0f1419;
    --text-dark: #f3f4f6;
    --text-dark-secondary: #9ca3af;
    --brand-dark-blue: #474972;
    --brand-gold: #c5b48a;
    --gold-hover: #b3a278;
    --bg-gray-light: #f9fafb;
    --bg-gray-dark: #1f2937;
    --border-light: #d1d5db;
    --border-dark: #374151;
}

[data-theme="dark"] {
    --bg-main: var(--bg-dark);
    --text-main: var(--text-dark);
    --text-secondary: var(--text-dark-secondary);
    --bg-alt: var(--bg-gray-dark);
    --border-main: var(--border-dark);
}

[data-theme="light"] {
    --bg-main: var(--bg-light);
    --text-main: var(--text-light);
    --text-secondary: var(--text-light-secondary);
    --bg-alt: var(--bg-gray-light);
    --border-main: var(--border-light);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Семантические классы для темизации */
.surface-main {
    background-color: var(--bg-main);
}
.surface-alt {
    background-color: var(--bg-alt);
}
.text-primary {
    color: var(--text-main);
}
.text-secondary {
    color: var(--text-secondary);
}


/* Основной шрифт для заголовков */
h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Georgia', serif;
}

/* Цветовая палитра */
.bg-brand-dark-blue {
    background-color: var(--brand-dark-blue);
}

.text-brand-dark-blue {
    color: var(--brand-dark-blue);
}

.bg-brand-gold {
    background-color: var(--brand-gold);
}

.text-brand-gold {
    color: var(--brand-gold);
}

.border-brand-gold {
    border-color: var(--brand-gold);
}

/* Apple-style buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    letter-spacing: -0.025em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--gold-hover) 100%);
    color: var(--brand-dark-blue);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-hover) 0%, #a29066 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 2px solid var(--brand-gold);
}

.btn-secondary:hover {
    background-color: var(--brand-gold);
    color: var(--brand-dark-blue);
    border-color: var(--brand-gold);
}

[data-theme="dark"] .btn-secondary {
    border-color: var(--brand-gold);
}

[data-theme="light"] .btn-secondary {
    border-color: var(--brand-gold);
}

/* Dark mode toggle */
.theme-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: #e0e6ed;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

[data-theme="dark"] .theme-toggle {
    background: #1f2937;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(24px);
    background: #fbbf24;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle::after {
    content: '☀️';
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .theme-toggle::after {
    content: '🌙';
    left: 28px;
}
