/* AI Finance Lab - Main Stylesheet */

/* Custom Properties for Theming */
:root {
    --primary: #1e3a8a;
    --secondary: #3730a3;
    --accent: #10b981;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #f9fafb;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 0.375rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease;
}

[data-theme="midnight"] {
    --primary: #3b82f6;
    --secondary: #6366f1;
    --accent: #34d399;
    --danger: #f87171;
    --success: #4ade80;
    --warning: #fbbf24;
    --bg: #0f172a;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

[data-theme="high-contrast"] {
    --primary: #000000;
    --secondary: #000000;
    --accent: #0066cc;
    --danger: #cc0000;
    --success: #008800;
    --warning: #cc6600;
    --bg: #ffffff;
    --text: #000000;
    --text-muted: #000000;
    --card-bg: #f0f0f0;
    --border: #000000;
    --shadow: 0 0 0 2px #000000;
    --shadow-lg: 0 0 0 3px #000000;
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
    margin: 0 0 1rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Navigation */
.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    color: var(--text);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--card-bg);
    text-decoration: none;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Quiz Specific Styles */
.quiz-container {
    max-width: 800px;
    margin: 2rem auto;
}

.quiz-header {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.question-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.answer-option {
    display: block;
    width: 100%;
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.answer-option:hover {
    border-color: var(--primary);
    background: var(--card-bg);
}

.answer-option.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.answer-option.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.answer-option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Puzzle Specific Styles */
.puzzle-board {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.drag-item {
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: move;
    transition: var(--transition);
}

.drag-item:hover {
    border-color: var(--primary);
}

.drag-item.dragging {
    opacity: 0.5;
}

.drop-zone {
    min-height: 80px;
    padding: 1rem;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}

/* Ethics Maze Styles */
.decision-node {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    text-align: center;
}

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

.outcome-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    margin-top: 1rem;
}

.outcome-good {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.outcome-bad {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.outcome-neutral {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .choice-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .quiz-header {
        padding: 1rem;
    }
    
    .question-card {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .theme-switcher, .btn, button {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}