/* FSD Learning Simulator - Mobile-First Styles */

:root {
    --primary: #E81937;
    --primary-dark: #B8142B;
    --secondary: #171A20;
    --accent: #3D6CB9;
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --text: #171A20;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.header-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.lang-toggle {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transition: all 0.2s;
}

/* Navigation */
.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: none;
}

.nav.active {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
}

.nav-item {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-item.active {
    background: var(--secondary);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 1rem;
}

.hero h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.hero p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Feature Cards */
.feature-cards {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    min-height: 48px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
}

/* CEO Banner */
.ceo-banner {
    background: linear-gradient(135deg, var(--secondary) 0%, #2C3E50 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.ceo-signature {
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.8;
}

/* Tutorial Overlay */
.tutorial-overlay {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

.tutorial-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
}

.tutorial-overlay h3 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

.tutorial-overlay ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.tutorial-overlay li {
    margin-bottom: 0.5rem;
}

/* Canvas Container */
.canvas-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.canvas-ui {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.score-display {
    font-weight: 600;
    color: var(--secondary);
}

.object-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.object-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
}

.object-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #E8E8E8;
}

/* Path Planning */
.path-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.path-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: var(--secondary);
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg);
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.path-tooltip {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Quiz */
.quiz-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.quiz-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.quiz-header h2 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

.quiz-progress,
.quiz-score {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.quiz-topic-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.topic-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
}

.topic-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quiz-question {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quiz-option {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    min-height: 48px;
}

.quiz-option:hover:not(.disabled) {
    border-color: var(--accent);
    background: var(--surface);
}

.quiz-option.correct {
    border-color: var(--success);
    background: #D1FAE5;
}

.quiz-option.incorrect {
    border-color: var(--error);
    background: #FEE2E2;
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-feedback {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: #D1FAE5;
    color: #065F46;
}

.quiz-feedback.incorrect {
    background: #FEE2E2;
    color: #991B1B;
}

/* Quiz Results */
.quiz-results {
    text-align: center;
}

.final-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.achievement-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    margin: 1.5rem auto;
    max-width: fit-content;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.badge-icon {
    font-size: 2rem;
}

.badge-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-height: 48px;
}

.share-btn span {
    font-size: 1.25rem;
}

.share-btn.twitter {
    background: #1DA1F2;
    color: white;
}

.share-btn.linkedin {
    background: #0077B5;
    color: white;
}

.share-btn.facebook {
    background: #4267B2;
    color: white;
}

.share-btn.copy {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Feedback */
.feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.feedback.show {
    display: block;
}

.feedback.correct {
    background: #D1FAE5;
    color: #065F46;
}

.feedback.incorrect {
    background: #FEE2E2;
    color: #991B1B;
}

/* DMS Simulator */
.dms-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.dms-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dms-state-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.dms-state-btn {
    padding: 0.75rem;
    border: 2px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 48px;
}

.dms-state-btn:hover {
    border-color: var(--accent);
}

.dms-state-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.dms-sensitivity-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dms-sensitivity-control label {
    font-weight: 500;
    color: var(--secondary);
}

.dms-sensitivity-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg);
    outline: none;
}

.dms-sensitivity-control input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.dms-output {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dms-classification {
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.pull-over-warning {
    background: #FEE2E2;
    color: #991B1B;
    font-weight: 700;
    padding: 1rem;
    border-radius: 8px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.dms-alert-indicator {
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    background: var(--bg);
}

.dms-alert-indicator.level-0 {
    background: #D1FAE5;
    color: #065F46;
}

.dms-alert-indicator.level-1 {
    background: #FEF3C7;
    color: #92400E;
    border: 2px solid #F59E0B;
}

.dms-alert-indicator.level-2 {
    background: #FED7AA;
    color: #9A3412;
    border: 2px solid #EA580C;
}

.dms-alert-indicator.level-3 {
    background: #FEE2E2;
    color: #991B1B;
    border: 2px solid #EF4444;
    animation: pulse 0.5s infinite;
}

/* Sensor Fusion */
.sensorfusion-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.sensorfusion-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.camera-toggles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.camera-toggle {
    padding: 0.75rem;
    border: 2px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 48px;
}

.camera-toggle:hover {
    border-color: var(--accent);
}

.camera-toggle.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.camera-toggle.inactive {
    background: var(--border);
    color: var(--text-secondary);
    opacity: 0.6;
}

.sensorfusion-output {
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.sensorfusion-output h4 {
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.sensorfusion-objects {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sensorfusion-object {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 6px;
    border-left: 4px solid var(--success);
}

.sensorfusion-object.danger {
    border-left-color: var(--error);
}

.sensorfusion-object.warning {
    border-left-color: var(--warning);
}

.object-confidence {
    font-weight: 600;
    color: var(--secondary);
}

.object-confidence.low {
    color: var(--error);
}

.object-confidence.medium {
    color: var(--warning);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 2rem;
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: linear-gradient(135deg, var(--border) 0%, #E5E7EB 100%);
    border: 2px dashed var(--text-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0 auto;
    cursor: pointer;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .nav {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .canvas-ui {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .path-controls {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-stats {
        gap: 4rem;
    }
}
