:root {
    /* SRC Supply Brand Colors */
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8A5C;
    --secondary: #2D3436;
    --accent: #00B894;
    --accent-light: #00CEC9;
    --warning: #FDCB6E;
    --danger: #D63031;
    
    /* Neutrals */
    --bg: #0F0F23;
    --bg-light: #1A1A2E;
    --bg-card: #16213E;
    --bg-elevated: #1E2A4A;
    --text: #FFFFFF;
    --text-muted: #A0A0B8;
    --text-dim: #6C6C8A;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FF6B35 0%, #FF8A5C 100%);
    --gradient-secondary: linear-gradient(135deg, #2D3436 0%, #636E72 100%);
    --gradient-accent: linear-gradient(135deg, #00B894 0%, #00CEC9 100%);
    --gradient-bg: linear-gradient(180deg, #0F0F23 0%, #1A1A2E 50%, #16213E 100%);
    
    /* Effects */
    --glow-primary: 0 0 30px rgba(255, 107, 53, 0.4);
    --glow-accent: 0 0 20px rgba(0, 184, 148, 0.4);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.4);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

.hidden {
    display: none !important;
}

/* Loading Screen */
#loading-screen {
    justify-content: center;
    align-items: center;
}

.loader {
    text-align: center;
    padding: var(--space-xl);
}

.loader-icon {
    font-size: 4rem;
    animation: bounce 1s infinite;
    margin-bottom: var(--space-lg);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.loader h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader p {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    width: 0%;
    animation: loadingProgress 2s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 60%; }
    100% { width: 100%; }
}

/* Start Screen */
#start-screen {
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
}

.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.logo-animation {
    margin-bottom: var(--space-xl);
}

.safety-icon {
    font-size: 5rem;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.5)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 40px rgba(255, 107, 53, 0.8)); }
}

#start-screen h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2xl);
}

.start-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

input[type="text"] {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition-normal);
    text-align: center;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

input[type="text"]::placeholder {
    color: var(--text-dim);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-text {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

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

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

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--text-dim);
}

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

.btn-text {
    background: transparent;
    color: var(--text-muted);
    text-decoration: underline;
}

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

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    transition: var(--transition-fast);
}

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

.icon-btn {
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-arrow {
    transition: var(--transition-normal);
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

/* Stats Preview */
.stats-preview {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

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

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

/* Dashboard */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: rgba(22, 33, 62, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-small {
    font-weight: 700;
    font-size: 1.25rem;
}

.user-stats {
    display: flex;
    gap: var(--space-lg);
}

.stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-icon {
    font-size: 1rem;
}

.xp { color: var(--warning); }
.level { color: var(--accent-light); }
.streak { color: var(--primary); }

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dashboard {
    padding: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

/* Welcome Banner */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-secondary);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(60px);
}

.welcome-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.welcome-text p {
    color: var(--text-muted);
}

/* Progress Circle */
.progress-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 8;
}

.progress-ring {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Module Cards */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.module-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 2px solid transparent;
    transition: var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
}

.module-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.module-card.locked:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.module-card.completed {
    border-color: var(--accent);
}

.module-card.completed::after {
    content: '✓';
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--accent);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

.module-card.attempted {
    border-color: var(--warning);
}

.module-card.attempted::after {
    content: '!';
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--warning);
    color: var(--secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

.module-meta .status-passed {
    color: var(--accent);
    font-weight: 600;
}

.module-meta .status-locked {
    color: var(--text-dim);
}

.module-meta .status-available {
    color: var(--primary);
    font-weight: 600;
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.module-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.module-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.module-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.module-progress-mini {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.module-progress-mini .progress-bar {
    width: 60px;
    height: 4px;
}

/* Achievements */
.achievements-section h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

.badges-container {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-elevated);
    font-size: 0.875rem;
}

.badge.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

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

/* Module Screen */
#module-screen {
    background: var(--bg);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-card);
    border-bottom: 1px solid var(--bg-elevated);
}

.module-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.module-content {
    flex: 1;
    padding: var(--space-xl);
    max-width: 800px;
    margin: 0 auto;
    overflow-y: auto;
}

.module-actions {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-card);
    border-top: 1px solid var(--bg-elevated);
}

/* Lesson Content */
.lesson-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--primary);
}

.lesson-section {
    margin-bottom: var(--space-xl);
}

.lesson-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.lesson-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    border-left: 4px solid var(--primary);
}

.info-card h4 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: var(--space-xs) 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.info-card li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-lg) 0;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--bg-elevated);
}

.data-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--primary);
}

.data-table tr:hover {
    background: rgba(255, 107, 53, 0.05);
}

/* Quiz Styles */
.quiz-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.quiz-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.quiz-question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    text-align: center;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
}

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

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.1);
}

.quiz-option.correct {
    border-color: var(--accent);
    background: rgba(0, 184, 148, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(214, 48, 49, 0.1);
}

.option-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.quiz-option.selected .option-letter {
    background: var(--primary);
}

.quiz-option.correct .option-letter {
    background: var(--accent);
}

.quiz-option.incorrect .option-letter {
    background: var(--danger);
}

/* Scenario Styles */
.scenario-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.scenario-customer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--bg-card);
}

.customer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.customer-info h4 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.customer-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.scenario-dialogue {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    position: relative;
}

.scenario-dialogue::before {
    content: '"';
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.3;
    position: absolute;
    top: -10px;
    left: 10px;
}

.scenario-dialogue p {
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.scenario-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.scenario-option {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
}

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

.scenario-option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.1);
}

.scenario-option strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--primary);
}

.scenario-option p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Results Screen */
#results-screen {
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
}

.results-container {
    text-align: center;
    max-width: 500px;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: var(--space-lg);
    animation: bounce 1s ease;
}

#result-title {
    font-size: 2rem;
    margin-bottom: var(--space-xl);
}

.score-display {
    margin-bottom: var(--space-xl);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    box-shadow: var(--glow-primary);
}

#score-percent {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}

#score-message {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.rewards {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.reward {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.reward-icon {
    font-size: 1.5rem;
}

.reward-label {
    font-weight: 600;
}

.xp-earned {
    color: var(--warning);
}

.badge-earned {
    color: var(--accent-light);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

/* Certificate Screen */
#certificate-screen {
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
    background: var(--bg);
}

.certificate-container {
    text-align: center;
    width: 100%;
    max-width: 900px;
}

.certificate {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 3px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-elevated);
    margin-bottom: var(--space-xl);
}

.certificate-border {
    background: var(--bg);
    border: 2px solid var(--primary);
    border-radius: calc(var(--radius-xl) - 3px);
    padding: var(--space-2xl);
    position: relative;
}

.certificate-border::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: calc(var(--radius-xl) - 10px);
    pointer-events: none;
}

.certificate-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 2px solid var(--bg-elevated);
}

.certificate-logo {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

.certificate-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.certificate-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.certificate-body {
    text-align: center;
    padding: var(--space-xl) 0;
}

.certificate-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.certificate-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.certification-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.certificate-description {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

.certificate-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: var(--space-xl);
    border-top: 2px solid var(--bg-elevated);
    margin-top: var(--space-xl);
}

.cert-date, .cert-score {
    text-align: center;
}

.cert-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

.cert-seal {
    background: var(--gradient-accent);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.certificate-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: 300px;
}

.toast.success {
    border-left-color: var(--accent);
}

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

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .top-bar {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    
    .user-stats {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: var(--space-sm);
    }
    
    .stat {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-lg);
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .results-actions,
    .certificate-actions {
        flex-direction: column;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: var(--space-lg);
    }
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.4s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pop {
    animation: pop 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}


/* ========================================
   LIGHTBOX / IMAGE MODAL
   ======================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-container {
    transform: scale(1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: var(--space-sm);
}

/* Clickable images in training content */
.lesson-content img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lesson-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.data-table img {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.data-table img:hover {
    transform: scale(1.1);
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}
