/* ============================================
   Work Simulation - Main Stylesheet
   Clean, professional light theme
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-secondary);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

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

/* Layout */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.content-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.content-card.wide {
    max-width: 900px;
}

/* Timer Bar */
.timer-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

.timer-bar .logo {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary-light);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
}

.timer-display .timer-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.timer-display .time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}

.timer-display.warning {
    background: #fef3c7;
}

.timer-display.warning .time {
    color: var(--warning-color);
}

.timer-display.danger {
    background: #fee2e2;
    animation: pulse 1s infinite;
}

.timer-display.danger .time {
    color: var(--danger-color);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-large {
    padding: 1.25rem 4rem;
    font-size: 1.25rem;
    border-radius: var(--radius-lg);
}

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

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

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

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

.btn-finish {
    background: var(--success-color);
    color: white;
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
}

.btn-finish:hover {
    background: #059669;
}

/* Welcome Page Specific */
.welcome-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 500;
}

.welcome-title {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Introduction Page */
.intro-content {
    text-align: left;
}

.intro-content h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.intro-content p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.intro-content .highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.task-list {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.task-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.task-item:last-child {
    border-bottom: none;
}

.task-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.task-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.intro-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.intro-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Quiz Styles - Optimized for no scrolling */
.quiz-container {
    padding-top: 70px;
    height: 100vh;
    background: var(--background);
    display: flex;
    flex-direction: column;
}

.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

/* Text Question Layout - Centered, Compact */
.question-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.question-card.text-only {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
}

.question-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.progress-text {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    flex: 1;
    max-width: 150px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-left: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
    flex-shrink: 0;
}

.text-only .question-text {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Image Question Layout - Split Screen */
.question-card.with-image {
    flex-direction: row;
    gap: 1.5rem;
    padding: 1rem;
}

.image-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.image-section .question-progress {
    margin-bottom: 0.75rem;
}

.image-section .question-text {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.question-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-height: 0;
}

.question-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.options-section {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.options-section .options-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options-section .quiz-navigation {
    margin-top: 1rem;
    flex-shrink: 0;
}

/* Text-only options grid */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.options-grid.text-options {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.options-grid.image-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option-letter {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.option.selected .option-letter {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.option-text {
    flex: 1;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.4;
}

.option-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.option.image-option {
    flex-direction: column;
    padding: 0.75rem;
    position: relative;
}

.option.image-option .option-letter {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    margin: 0;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.image-option-wrapper {
    position: relative;
    width: 100%;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    flex-shrink: 0;
}

.quiz-navigation .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.text-only .quiz-navigation {
    max-width: 600px;
    margin: 1.5rem auto 0;
    width: 100%;
}

/* Simulation Page */
.simulation-container {
    padding-top: 70px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.slides-embed {
    flex: 1;
    width: 100%;
    border: none;
}

/* Completion Pages */
.completion-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
}

.completion-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
}

.completion-icon.success {
    background: #d1fae5;
}

.completion-icon.success svg {
    color: var(--success-color);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.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;
}

/* Responsive */
@media (max-width: 768px) {
    .content-card {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .timer-bar {
        padding: 0.75rem 1rem;
    }

    .timer-display .time {
        font-size: 1.25rem;
    }

    .options-grid.image-options {
        grid-template-columns: 1fr;
    }

    .btn-large {
        padding: 1rem 2.5rem;
        font-size: 1.125rem;
    }

    /* Quiz Container - Mobile adjustments */
    .quiz-container {
        padding-top: 60px;
    }

    .quiz-content {
        padding: 0.5rem;
    }

    /* Question Card - Stack layout on mobile */
    .question-card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .question-card.with-image {
        flex-direction: column;
        gap: 1rem;
        overflow-y: auto;
    }

    /* Image Section - Full width on mobile */
    .image-section {
        flex-shrink: 0;
    }

    .image-section .question-text {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .question-image-container {
        min-height: 180px;
        max-height: 40vh;
        padding: 0.25rem;
    }

    .question-image {
        max-height: 100%;
    }

    /* Options Section - Full width on mobile */
    .options-section {
        width: 100%;
        flex-shrink: 0;
    }

    /* Question Text - Better readability */
    .question-text {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .text-only .question-text {
        font-size: 1.1rem;
    }

    /* Options - Larger touch targets */
    .options-grid {
        gap: 0.5rem;
    }

    .option {
        padding: 0.875rem 1rem;
        min-height: 48px;
    }

    .option-text {
        font-size: 0.9rem;
    }

    .option-letter {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    /* Navigation - Better touch targets */
    .quiz-navigation {
        margin-top: 0.75rem;
        gap: 0.5rem;
    }

    .quiz-navigation .btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Progress bar area */
    .question-progress {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .progress-text {
        font-size: 0.8rem;
    }

    .progress-bar {
        max-width: 100px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .timer-bar {
        padding: 0.5rem 0.75rem;
    }

    .timer-bar .logo {
        font-size: 1rem;
    }

    .timer-display {
        padding: 0.375rem 0.75rem;
    }

    .timer-display .time {
        font-size: 1.1rem;
        min-width: 60px;
    }

    .timer-display .timer-icon {
        width: 16px;
        height: 16px;
    }

    .btn-finish {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .quiz-content {
        padding: 0.375rem;
    }

    .question-card {
        padding: 0.75rem;
    }

    .question-image-container {
        min-height: 150px;
        max-height: 35vh;
    }

    .option {
        padding: 0.75rem 0.875rem;
    }

    .quiz-navigation .btn {
        min-width: 90px;
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Introduction page adjustments */
    .intro-content h1 {
        font-size: 1.5rem;
    }

    .intro-content p {
        font-size: 0.95rem;
    }

    .task-list {
        padding: 1rem;
        margin: 1rem 0;
    }

    .task-item {
        padding: 0.75rem;
    }

    .task-item h4 {
        font-size: 0.9rem;
    }

    .task-item p {
        font-size: 0.85rem;
    }
}

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');