/*
Theme Name: Aladdin MBTI Creative
Theme URI: https://aladdin.my.id/themes/aladdin-mbti
Author: Dr. Aladdin Ali
Author URI: https://aladdin.my.id
Description: A professional, creative WordPress theme designed for the Aladdin MBTI Plugin. Features full RTL support, multi-language (EN/AR/TR/ID), integrated TTS system, auto-SEO with smart tagging, and WCAG 2.1 AA accessibility compliance.
Version: 1.0.0
Tested up to: 6.8.3
Requires at least: 6.4
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aladdin-theme
Domain Path: /languages
Tags: blog, portfolio, education, rtl-language-support, translation-ready, custom-colors, custom-logo, custom-menu, featured-images, full-site-editing, block-patterns, wide-blocks

© 2025 Dr. Aladdin Ali
Founder of Aladdin Pertanian Internasional
Email: dr.alaa@aladdin.my.id
All rights reserved.
*/

/* ==========================================================================
   Typography - Google Fonts
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@200;400;700;900&family=Noto+Sans+Arabic:wght@400;700&display=swap');

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Brand Colors */
    --brand-gold: #C0972C;
    --brand-gold-light: #D4B151; */
}

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Brand Colors */
    --brand-gold: #C0972C;
    --brand-gold-light: #D4B151;
    --brand-gold-dark: #9A7823;
    --brand-silver: #BFC7CB;
    --brand-silver-light: #D8DDE0;
    --brand-silver-dark: #99A3A8;
    --brand-green: #2E7D32;
    --brand-green-light: #4CAF50;
    --brand-green-dark: #1B5E20;
    
    /* Semantic Colors */
    --color-primary: var(--brand-gold);
    --color-secondary: var(--brand-silver);
    --color-accent: var(--brand-green);
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;
    
    /* Background & Surface */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    --bg-elevated: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-inverse: #FFFFFF;
    --text-link: var(--brand-gold);
    --text-link-hover: var(--brand-gold-dark);
    
    /* Border Colors */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    --border-dark: #9CA3AF;
    --border-focus: var(--brand-gold);
    
    /* Typography */
    --font-display: 'Playfair Display', 'Amiri', Georgia, serif;
    --font-body: 'Source Sans 3', 'Noto Sans Arabic', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Font Sizes (Fluid Typography) */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(2rem, 1.6rem + 2vw, 3rem);
    --text-4xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);
    --text-5xl: clamp(3rem, 2.4rem + 3vw, 5rem);
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-gold: 0 4px 14px 0 rgba(192, 151, 44, 0.3);
    --shadow-green: 0 4px 14px 0 rgba(46, 125, 50, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-slower: 500ms ease;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* Container */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0F172A;
        --bg-secondary: #1E293B;
        --bg-tertiary: #334155;
        --bg-elevated: #1E293B;
        
        --text-primary: #F8FAFC;
        --text-secondary: #CBD5E1;
        --text-muted: #64748B;
        
        --border-light: #334155;
        --border-medium: #475569;
        --border-dark: #64748B;
        
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    }
}

[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-elevated: #1E293B;
    
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748B;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* RTL Support */
html[dir="rtl"] body,
body.rtl {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] {
    --font-body: 'Noto Sans Arabic', 'Source Sans 3', 'Segoe UI', sans-serif;
    --font-display: 'Amiri', 'Playfair Display', Georgia, serif;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: var(--z-tooltip);
    padding: var(--space-3) var(--space-4);
    background: var(--brand-gold);
    color: var(--text-inverse);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: 600; }

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

strong, b {
    font-weight: 700;
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--text-sm);
}

blockquote {
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    border-left: 4px solid var(--brand-gold);
    background: var(--bg-secondary);
    font-style: italic;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

html[dir="rtl"] blockquote {
    border-left: none;
    border-right: 4px solid var(--brand-gold);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

code, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

code {
    padding: var(--space-1) var(--space-2);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

pre {
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: transparent;
}

/* ==========================================================================
   Layout & Containers
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-2xl { max-width: var(--container-2xl); }

.section {
    padding-block: var(--space-16);
}

.section-sm { padding-block: var(--space-8); }
.section-lg { padding-block: var(--space-24); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-dark) 100%);
    color: var(--text-inverse);
    border-color: var(--brand-gold);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-gold-light) 0%, var(--brand-gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 151, 44, 0.4);
}

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

.btn-secondary:hover {
    background: var(--brand-gold);
    color: var(--text-inverse);
}

.btn-accent {
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
    color: var(--text-inverse);
    border-color: var(--brand-green);
    box-shadow: var(--shadow-green);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-green) 100%);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-icon {
    padding: var(--space-3);
    border-radius: var(--radius-full);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-gold {
    border-color: var(--brand-gold);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(192, 151, 44, 0.05) 100%);
}

.card-header {
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: 0;
}

.card-body {
    flex: 1;
}

.card-footer {
    padding-top: var(--space-4);
    margin-top: var(--space-4);
    border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(192, 151, 44, 0.2);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-checkbox input,
.form-radio input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--brand-gold);
}

.form-error {
    color: var(--color-error);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

.form-help {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

/* ==========================================================================
   MBTI Components
   ========================================================================== */

/* MBTI Type Badge */
.mbti-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: var(--tracking-wider);
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-dark) 100%);
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-gold);
}

.mbti-badge-large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-3xl);
    border-radius: var(--radius-xl);
}

/* MBTI Dimension Bar */
.mbti-dimension {
    margin-bottom: var(--space-6);
}

.mbti-dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.mbti-dimension-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.mbti-dimension-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--brand-gold);
}

.mbti-dimension-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.mbti-dimension-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-gold) 0%, var(--brand-green) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* MBTI Profile Card */
.mbti-profile-card {
    position: relative;
    overflow: hidden;
}

.mbti-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-gold), var(--brand-green), var(--brand-silver));
}

.mbti-profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.mbti-profile-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-dark) 100%);
    border-radius: var(--radius-xl);
    color: var(--text-inverse);
    font-size: var(--text-2xl);
}

.mbti-profile-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-1);
}

.mbti-profile-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* MBTI Question */
.mbti-question {
    padding: var(--space-8);
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-6);
}

.mbti-question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--brand-gold);
    color: var(--text-inverse);
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.mbti-question-text {
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.mbti-answers {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.mbti-answer {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mbti-answer:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand-gold);
}

.mbti-answer.selected {
    background: rgba(192, 151, 44, 0.1);
    border-color: var(--brand-gold);
}

.mbti-answer input {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-gold);
}

/* Progress Bar */
.mbti-progress {
    margin-bottom: var(--space-8);
}

.mbti-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.mbti-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-gold) 0%, var(--brand-green) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.mbti-progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ==========================================================================
   TTS Player
   ========================================================================== */

.tts-player {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-fixed);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    box-shadow: var(--shadow-2xl);
    min-width: 320px;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

html[dir="rtl"] .tts-player {
    right: auto;
    left: var(--space-6);
}

.tts-player.minimized {
    min-width: auto;
    padding: var(--space-2);
}

.tts-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.tts-player-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.tts-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.tts-btn:hover {
    background: var(--brand-gold);
    color: var(--text-inverse);
}

.tts-btn.playing {
    background: var(--brand-gold);
    color: var(--text-inverse);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tts-btn-play {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-dark) 100%);
    color: var(--text-inverse);
    box-shadow: var(--shadow-gold);
}

.tts-btn-play:hover {
    transform: scale(1.05);
}

.tts-settings {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-light);
}

.tts-setting {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.tts-setting-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 60px;
}

.tts-slider {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    appearance: none;
    cursor: pointer;
}

.tts-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--brand-gold);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.tts-voice-select {
    flex: 1;
    padding: var(--space-2);
    font-size: var(--text-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.95);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding-inline: var(--space-6);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.site-logo-image {
    height: 48px;
    width: auto;
}

.site-logo-text {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

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

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-2) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-gold);
    transition: width var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-gold);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.lang-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--brand-gold);
    color: var(--text-inverse);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    padding: var(--space-2);
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background var(--transition-fast);
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

.menu-toggle-icon::before { top: -8px; }
.menu-toggle-icon::after { bottom: -8px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding-block: var(--space-12);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
}

.footer-brand {
    max-width: 320px;
}

.footer-brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-brand-text {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.footer-nav-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.footer-nav-list {
    list-style: none;
}

.footer-nav-list li {
    margin-bottom: var(--space-2);
}

.footer-nav-link {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.footer-nav-link:hover {
    color: var(--brand-gold);
}

.footer-bottom {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.footer-copyright strong {
    color: var(--brand-gold);
}

.footer-copyright a {
    color: var(--brand-gold);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .nav-menu {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .site-nav.open .nav-menu {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border-light);
        padding: var(--space-4);
        box-shadow: var(--shadow-lg);
    }
    
    .site-nav.open .nav-link {
        padding: var(--space-3) var(--space-4);
    }
}

@media (max-width: 768px) {
    .site-header-inner {
        height: 64px;
        padding-inline: var(--space-4);
    }
    
    .section {
        padding-block: var(--space-10);
    }
    
    .tts-player {
        bottom: var(--space-4);
        right: var(--space-4);
        left: var(--space-4);
        min-width: auto;
    }
    
    html[dir="rtl"] .tts-player {
        right: var(--space-4);
        left: var(--space-4);
    }
}

@media (max-width: 480px) {
    :root {
        --space-4: 0.875rem;
        --space-6: 1.25rem;
        --space-8: 1.5rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .mbti-question {
        padding: var(--space-4);
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn var(--transition-base) ease-out; }
.animate-slide-up { animation: slideUp var(--transition-base) ease-out; }
.animate-slide-down { animation: slideDown var(--transition-base) ease-out; }
.animate-scale-in { animation: scaleIn var(--transition-base) ease-out; }

/* Staggered animations */
.stagger > * {
    opacity: 0;
    animation: slideUp var(--transition-base) ease-out forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .tts-player,
    .btn,
    .skip-link {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .mbti-badge {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
