/* Apple macOS style design */
:root {
    /* Light mode colors (default) */
    --background-primary: #ffffff;
    --background-secondary: #f8f9fa;
    --background-tertiary: #f2f2f7;
    --text-primary: #1d1d1f;
    --text-secondary: #515151;
    --text-tertiary: #86868b;
    --accent-blue: #007aff;
    --accent-blue-hover: #0051d2;
    --border-color: #d2d2d7;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --warning-bg: #fff3cd;
    --warning-border: #ffc107;
    --success-bg: #d1edff;
    --success-border: #007aff;
    --code-bg: #f6f8fa;
    --code-border: #e1e4e8;
}

/* Explicit light mode */
@media (prefers-color-scheme: light) {
    :root {
        --background-primary: #ffffff;
        --background-secondary: #f8f9fa;
        --background-tertiary: #f2f2f7;
        --text-primary: #1d1d1f;
        --text-secondary: #515151;
        --text-tertiary: #86868b;
        --accent-blue: #007aff;
        --accent-blue-hover: #0051d2;
        --border-color: #d2d2d7;
        --shadow-light: rgba(0, 0, 0, 0.05);
        --shadow-medium: rgba(0, 0, 0, 0.1);
        --warning-bg: #fff3cd;
        --warning-border: #ffc107;
        --success-bg: #d1edff;
        --success-border: #007aff;
        --code-bg: #f6f8fa;
        --code-border: #e1e4e8;
    }
}

/* Manual dark mode toggle */
body.dark-mode {
    --background-primary: #1c1c1e;
    --background-secondary: #2c2c2e;
    --background-tertiary: #3a3a3c;
    --text-primary: #ffffff;
    --text-secondary: #d1d1d6;
    --text-tertiary: #a1a1a6;
    --accent-blue: #0a84ff;
    --accent-blue-hover: #409cff;
    --border-color: #48484a;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --warning-bg: #453c25;
    --warning-border: #ffc107;
    --success-bg: #1c3a52;
    --success-border: #0a84ff;
    --code-bg: #2d2d30;
    --code-border: #48484a;
}

/* macOS Tahoe Theme - inspired by Lake Tahoe blue tones */
body.tahoe-theme {
    --background-primary: #f0f8ff;
    --background-secondary: #e6f3ff;
    --background-tertiary: #d9edff;
    --text-primary: #1a365d;
    --text-secondary: #2c5282;
    --text-tertiary: #4299e1;
    --accent-blue: #3182ce;
    --accent-blue-hover: #2c5282;
    --border-color: #bee3f8;
    --shadow-light: rgba(49, 130, 206, 0.1);
    --shadow-medium: rgba(49, 130, 206, 0.2);
    --warning-bg: #fef5e7;
    --warning-border: #ed8936;
    --success-bg: #c6f6d5;
    --success-border: #38a169;
    --code-bg: #ebf8ff;
    --code-border: #90cdf4;
}

/* Tahoe Dark Theme - inspired by Lake Tahoe at twilight */
body.tahoe-theme.dark-mode {
    --background-primary: #1a202c;
    --background-secondary: #2d3748;
    --background-tertiary: #4a5568;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --accent-blue: #63b3ed;
    --accent-blue-hover: #4299e1;
    --border-color: #4a5568;
    --shadow-light: rgba(99, 179, 237, 0.15);
    --shadow-medium: rgba(99, 179, 237, 0.25);
    --warning-bg: #744210;
    --warning-border: #ed8936;
    --success-bg: #22543d;
    --success-border: #48bb78;
    --code-bg: #2d3748;
    --code-border: #4a5568;
}

/* Tahoe theme specific styling */
body.tahoe-theme .header {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

body.tahoe-theme .warning-section {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.header-content {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Table of Contents */
.table-of-contents {
    background: var(--background-primary);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--shadow-light);
    border: 1px solid var(--border-color);
}

.table-of-contents h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.table-of-contents ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.table-of-contents li {
    transition: all 0.2s ease;
}

.table-of-contents a {
    display: block;
    padding: 12px 16px;
    background: var(--background-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.table-of-contents a:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Cards */
.card {
    background: var(--background-primary);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px var(--shadow-medium);
    transform: translateY(-2px);
}

.card h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
    color: var(--text-primary);
}

.card h4 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 20px 0 10px 0;
    color: var(--text-secondary);
}

.card h5 {
    font-size: 1rem;
    font-weight: 500;
    margin: 15px 0 10px 0;
    color: var(--text-secondary);
}

.card p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.card ul, .card ol {
    margin: 15px 0 15px 20px;
    color: var(--text-secondary);
}

.card li {
    margin-bottom: 8px;
    line-height: 1.6;
}

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

/* Code sections */
.code-section {
    margin: 20px 0;
}

.code-section h3,
.code-section h4,
.code-section h5 {
    margin-bottom: 10px;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0;
}

code {
    background: var(--code-bg);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 0.9em;
    border: 1px solid var(--code-border);
}

pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 14px;
}

/* Special sections */
.important-note {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.important-note h4 {
    color: var(--accent-blue);
    margin-top: 0;
    margin-bottom: 10px;
}

.warning-note {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.warning-note p {
    color: #856404;
    margin: 0;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .warning-note p {
        color: #ffb347;
    }
}

/* Lists */
.requirements-list {
    background: var(--background-tertiary);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.requirements-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.requirements-list li:last-child {
    border-bottom: none;
}

.install-order {
    counter-reset: step-counter;
}

.install-order li {
    counter-increment: step-counter;
    background: var(--background-tertiary);
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 8px;
    position: relative;
    padding-left: 60px;
}

.install-order li::before {
    content: counter(step-counter);
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.test-results li {
    padding: 8px 0;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 14px;
}

/* Links */
a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}

/* Warning section */
.warning-section {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
}

.warning-section h2 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.warning-section ul li {
    color: white;
}

.warning-section strong {
    color: white;
}

.success-rate {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.success-rate p {
    color: white;
    font-weight: 600;
    margin: 0;
}

/* Footer */
.footer {
    background: var(--background-primary);
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow-light);
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 40px 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .card {
        padding: 25px;
    }
    
    .card h2 {
        font-size: 1.5rem;
    }
    
    .table-of-contents {
        padding: 20px;
    }
    
    .table-of-contents ul {
        grid-template-columns: 1fr;
    }
    
    pre {
        padding: 15px;
        font-size: 13px;
    }
    
    .install-order li {
        padding-left: 50px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: var(--accent-blue);
    color: white;
}

/* Loading animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .header {
        background: none;
        color: black;
        box-shadow: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    pre {
        background: #f5f5f5;
    }
}