/* CSS Variables for theming */
:root {
    --primary-color: #4F46E5; /* Vibrant Indigo */
    --primary-hover: #4338CA;
    --secondary-color: #10B981; /* Safe Emerald */
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --card-bg: rgba(255, 255, 255, 0.85); /* Glassmorphism base */
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(255, 255, 255, 0.4);
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    
    --font-size-base: 16px;
    --font-family: 'Outfit', sans-serif;
}

/* High Contrast Theme Variables */
[data-theme="high-contrast"] {
    --primary-color: #ffff00;
    --primary-hover: #cccc00;
    --secondary-color: #00ff00;
    --bg-gradient: none;
    --bg-color: #000000;
    --card-bg: #111111;
    --text-color: #ffffff;
    --text-muted: #cccccc;
    --border-color: #ffffff;
}

/* Large Text Mode */
[data-text="large"] {
    --font-size-base: 20px;
}

/* Global Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background: var(--bg-gradient);
    background-color: var(--bg-color, #f3f4f6);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s, font-size 0.3s;
    min-height: 100vh;
}

/* Accessibility Bar */
.a11y-bar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
[data-theme="high-contrast"] .a11y-bar {
    background-color: #222;
}

.a11y-bar button, .a11y-bar select {
    background: none;
    border: 1px solid #ccc;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
    color: inherit;
    transition: all 0.2s;
}
.a11y-bar button:hover {
    background-color: #e5e7eb;
}
[data-theme="high-contrast"] .a11y-bar button:hover {
    background-color: #444;
}

/* Navigation */
.navbar {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(45deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="high-contrast"] .logo {
    background: none;
    -webkit-text-fill-color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}
[data-theme="high-contrast"] .nav-btn:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--primary-color);
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section {
    display: none;
}
.section.active {
    display: block;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography & Utilities */
h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
}

.card {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: #fff;
    border: none;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
[data-theme="high-contrast"] .primary-btn {
    background: var(--primary-color);
    color: #000;
}
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}
.hero h1 {
    font-size: 3rem;
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Persona Grid */
.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.persona-btn {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(79, 70, 229, 0.1);
    padding: 1.5rem 1rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    font-family: var(--font-family);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.persona-btn:hover {
    border-color: var(--primary-color);
    background-color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

/* Roadmap Timeline */
.roadmap-timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid rgba(79, 70, 229, 0.2);
    margin-top: 2.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transition: all 0.3s;
}

.timeline-item.completed .timeline-marker {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.timeline-content {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}
.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
}

/* Scenarios Lab */
.scenario-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.chip {
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    background-color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: var(--font-family);
}
.chip:hover {
    background-color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.1);
}
.chip.active {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
[data-theme="high-contrast"] .chip.active {
    color: #000;
    background: var(--primary-color);
}

/* Myth vs Fact */
.myth-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.myth-box, .fact-box {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.myth-box {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
    border-left: 5px solid var(--danger-color);
}
.fact-box {
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
    border-left: 5px solid var(--secondary-color);
}
[data-theme="high-contrast"] .myth-box, [data-theme="high-contrast"] .fact-box {
    background: var(--card-bg);
}

/* AI Chat Panel */
.chat-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: #fff;
    padding: 1rem 1.8rem;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
    cursor: pointer;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chat-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}
[data-theme="high-contrast"] .chat-toggle { color: #000; background: var(--primary-color); }

.chat-panel {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    width: 360px;
    height: 550px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

.chat-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: #fff;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
[data-theme="high-contrast"] .chat-header { color: #000; background: var(--primary-color); }

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-header button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.chat-header button:hover {
    background: rgba(255,255,255,0.3);
}

.chat-body {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
}

.chat-msg {
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.bot-msg {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
[data-theme="high-contrast"] .bot-msg {
    background-color: #333;
}

.user-msg {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
[data-theme="high-contrast"] .user-msg {
    color: #000;
    background: var(--primary-color);
}

.chat-input-area {
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.8rem;
}

.chat-input-area input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    outline: none;
    background-color: #f8fafc;
    color: var(--text-color);
    font-family: var(--font-family);
    transition: all 0.2s;
}
.chat-input-area input:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-input-area button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.chat-input-area button:hover {
    background: var(--primary-hover);
}
[data-theme="high-contrast"] .chat-input-area button {
    color: #000;
}

/* Responsive */
@media (max-width: 600px) {
    .navbar { padding: 1rem; flex-direction: column; gap: 1rem; }
    .hero h1 { font-size: 2.2rem; }
    .chat-panel {
        width: 90%;
        right: 5%;
        bottom: 5rem;
        height: 500px;
    }
}
