/* CSS Variables for theming */
:root {
    /* Light theme colors */
    --color-background: #FFFFFF;
    --color-surface: #F2F2F7;
    --color-surface-secondary: #E5E5EA;
    --color-text-primary: #000000;
    --color-text-secondary: #3C3C43;
    --color-text-tertiary: #48484A;
    --color-border: #C7C7CC;
    --color-accent: #5E5CE6;
    --color-accent-hover: #4A48D0;
    --color-gradient-start: #5E5CE6;
    --color-gradient-end: #BF5AF2;
    --color-success: #34C759;
    --color-warning: #FF9500;
    --color-error: #FF3B30;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.16);
    --color-card-background: #FFFFFF;
    --color-hover: rgba(94, 92, 230, 0.08);
}

/* Dark theme colors */
[data-theme="dark"] {
    --color-background: #000000;
    --color-surface: #1C1C1E;
    --color-surface-secondary: #2C2C2E;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #C7C7CC;
    --color-text-tertiary: #8E8E93;
    --color-border: #3A3A3C;
    --color-accent: #5E5CE6;
    --color-accent-hover: #7B79FF;
    --color-gradient-start: #5E5CE6;
    --color-gradient-end: #BF5AF2;
    --color-success: #30D158;
    --color-warning: #FF9F0A;
    --color-error: #FF453A;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
    --color-card-background: #1C1C1E;
    --color-hover: rgba(94, 92, 230, 0.15);
}

/* Auto theme (follows system preference) */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --color-background: #000000;
        --color-surface: #1C1C1E;
        --color-surface-secondary: #2C2C2E;
        --color-text-primary: #FFFFFF;
        --color-text-secondary: #C7C7CC;
        --color-text-tertiary: #8E8E93;
        --color-border: #3A3A3C;
        --color-accent: #5E5CE6;
        --color-accent-hover: #7B79FF;
        --color-gradient-start: #5E5CE6;
        --color-gradient-end: #BF5AF2;
        --color-success: #30D158;
        --color-warning: #FF9F0A;
        --color-error: #FF453A;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
        --color-card-background: #1C1C1E;
        --color-hover: rgba(94, 92, 230, 0.15);
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--color-surface);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container.narrow {
    max-width:1200px;
}

.container.full-width {
    max-width: 100%;
    padding: 0;
}

/* Navigation */
.nav-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s ease;
    width: 100%;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 18px;
    transition: opacity 0.2s ease;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* Logo theme switching */
.logo-light-theme {
    display: block;
}

.logo-dark-theme {
    display: none;
}

[data-theme="dark"] .logo-light-theme {
    display: none;
}

[data-theme="dark"] .logo-dark-theme {
    display: block;
}

/* Auto theme (follows system preference) */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .logo-light-theme {
        display: none;
    }
    
    [data-theme="auto"] .logo-dark-theme {
        display: block;
    }
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--color-accent);
}

.nav-link.active {
    color: var(--color-accent);
}

/* Theme toggle */
.theme-toggle {
    position: relative;
    width: 72px;
    height: 32px;
    background: var(--color-surface-secondary);
    border: 2px solid var(--color-border);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Theme toggle icons container */
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
}

.theme-toggle .sun-icon {
    left: 7px;
    color: var(--color-warning);
}

.theme-toggle .moon-icon {
    right: 7px;
    color: var(--color-text-primary);
}

/* Toggle indicator */
.theme-toggle::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Light theme state */
body[data-theme="light"] .theme-toggle::before {
    left: 3px;
    transform: translateY(-50%);
}

body[data-theme="light"] .theme-toggle {
    background: #FFE4B5;
    border-color: var(--color-warning);
}

/* Dark theme state */
body[data-theme="dark"] .theme-toggle::before {
    left: calc(100% - 29px);
    transform: translateY(-50%);
}

body[data-theme="dark"] .theme-toggle {
    background: #2C2C3E;
    border-color: #4A4A5C;
}

/* Auto theme state */
body[data-theme="auto"] .theme-toggle::before {
    left: 50%;
    transform: translate(-50%, -50%);
}

body[data-theme="auto"] .theme-toggle {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

/* Show/hide icons based on theme */
body[data-theme="light"] .theme-toggle .sun-icon {
    opacity: 1;
    color: #FF8C00;
}

body[data-theme="light"] .theme-toggle .moon-icon {
    opacity: 0.2;
}

body[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0.2;
}

body[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    color: #FFD700;
}

body[data-theme="auto"] .theme-toggle .sun-icon,
body[data-theme="auto"] .theme-toggle .moon-icon {
    opacity: 0.7;
    color: var(--color-text-primary);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .theme-toggle {
        background: var(--color-surface-secondary);
        border-color: var(--color-border);
    }
}

/* Language selector */
.language-selector {
    position: relative;
}

.language-toggle {
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: var(--color-text-primary);
}

.language-toggle:hover {
    background: var(--color-border);
    transform: translateY(-1px);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.language-selector.active .dropdown-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-selector.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.language-option:hover {
    background: var(--color-hover);
}

.language-option.active {
    background: var(--color-accent);
    color: white;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

/* Unified Page Headers */
.page-header,
.hero-section,
.blog-header,
.article-header {
    text-align: center;
    padding: 60px 20px 40px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    margin-top: -40px;
    margin-bottom: 40px;
}


/* Specific adjustments for hero section */
.hero-section {
    padding: 60px 20px 40px;
}

/* Page header content wrapper */
.page-header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page header specific styles */
.page-header h1,
.hero-section h1,
.blog-header h1,
.article-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
    color: var(--color-text-primary);
}

.page-header p,
.hero-section p,
.blog-header p {
    font-size: 18px;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive styles for unified headers */
@media (max-width: 768px) {
    .page-header h1,
    .hero-section h1,
    .blog-header h1,
    .article-header h1 {
        font-size: 32px;
    }
    
    .page-header p,
    .hero-section p,
    .blog-header p {
        font-size: 16px;
    }
}

h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    color: var(--color-text-primary);
}

h2 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--color-text-primary);
}

h3 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--color-text-primary);
}

p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

/* Buttons - See buttons.css for button styles */

/* Cards */
.card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 32px;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-section-title {
    color: var(--color-accent);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-text-primary);
}

.card ul {
    margin-left: 20px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.card ul li {
    margin-bottom: 8px;
}

.card ul li strong {
    color: var(--color-text-primary);
}

.card p {
    margin-bottom: 16px;
}

.card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 20px;
    color: var(--color-text-primary);
}

.card a {
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.card a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.card.centered {
    text-align: center;
}

.card.highlight {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-secondary) 100%);
    border: 2px solid var(--color-accent);
    margin-top: 30px;
}

/* Footer */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 60px 40px 40px;
    text-align: center;
    width: 100%;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    background: var(--color-surface-secondary);
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* Footer logo theme switching */
.footer-logo .logo-light-theme {
    display: block;
}

.footer-logo .logo-dark-theme {
    display: none;
}

[data-theme="dark"] .footer-logo .logo-light-theme {
    display: none;
}

[data-theme="dark"] .footer-logo .logo-dark-theme {
    display: block;
}

/* Auto theme (follows system preference) */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .footer-logo .logo-light-theme {
        display: none;
    }
    
    [data-theme="auto"] .footer-logo .logo-dark-theme {
        display: block;
    }
}

.footer-text {
    color: var(--color-text-tertiary);
    font-size: 13px;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-accent-hover);
}

.footer-app-button {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.footer-app-button .app-store-button {
    margin: 0;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface-secondary);
    color: var(--color-accent);
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--color-accent);
    color: white;
    transform: scale(1.1);
}

.footer-social img {
    width: 20px;
    height: 20px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 16px 20px;
    }
    
    .footer {
        padding: 60px 20px 40px;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-header .theme-toggle {
        display: none;
    }
    
    .nav-links .theme-toggle {
        display: flex;
        width: 72px;
        margin: 0 auto;
    }
    
    .language-selector {
        width: 100%;
    }
    
    .language-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .language-dropdown {
        position: relative;
        top: 8px;
        right: auto;
        width: 100%;
    }
    
    h1 {
        font-size: 28px;
    }
    
    p {
        font-size: 16px;
    }
    
    .button {
        padding: 14px 32px;
        font-size: 16px;
    }
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table td {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
}

table tr:last-child td {
    border-bottom: none;
}


/* Breadcrumb Navigation */
.breadcrumb {
    padding: 16px 0;
    margin-bottom: 24px;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.breadcrumb-item a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--color-accent);
}

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--color-text-tertiary);
}

.breadcrumb-current {
    color: var(--color-text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumb {
        padding: 12px 0;
        margin-bottom: 16px;
    }
    
    .breadcrumb-item {
        font-size: 12px;
    }
    
    .breadcrumb-separator {
        margin: 0 6px;
    }
}
