:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #34495e;
    --text-muted: #7f8c8d;
    --progress-bg: #edf2f7;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.main-container {
    padding: 2rem;
}

.main-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.main-container > p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 16px; /* 24px row gap, 16px column gap */
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.category-card {
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: 1rem;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.category-header {
    background: var(--primary-color);
    color: white;
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 4px solid var(--secondary-color);
    margin-bottom: 1rem;
}

.category-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-description {
    margin-bottom: 1.25rem;
    line-height: 1.6;
    flex-grow: 1;
}

.quiz-list {
    padding: 0 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Two-column layout for categories with more than 5 quizzes */
.quiz-list-two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    column-gap: 1.25rem;
}

/* Make category card span 2 columns when using two-column layout */
.category-card-wide {
    grid-column: span 2;
}

.quiz-item-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    min-height: 200px;
}

.quiz-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.quiz-item:hover {
    text-decoration: none;
    color: inherit;
}

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

.guide-button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 8px 16px 16px 16px;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.quiz-guide-button {
    display: block;
    background-color: #4e73df;
    color: white !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    width: fit-content;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.quiz-guide-button:hover:not([disabled]) {
    background-color: #2e53bf;
    text-decoration: none;
    color: white !important;
    transform: translateY(-1px);
}

.quiz-guide-button:focus {
    outline: 2px solid #4e73df;
    outline-offset: 2px;
}

.quiz-guide-button[disabled] {
    background-color: #999;
    pointer-events: none;
}

/* Remove pointer-events: none from quiz items */
.quiz-item * {
    pointer-events: auto;
}

.quiz-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.quiz-info > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.quiz-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.quiz-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

.quiz-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.quiz-completion {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.08);
    z-index: 2;
}

.quiz-pass-fail {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-pass-fail.pass {
    background-color: #4CAF50;
    color: white;
}

.quiz-pass-fail.fail {
    background-color: #F44336;
    color: white;
}

/* Quiz Status Classes for .quiz-item-wrapper only */
.quiz-item-wrapper.not-started {
    background-color: #fff !important;
    border: 2px solid #fff !important;
}
.quiz-item-wrapper.in-progress {
    background-color: #FFF8E7 !important;
    border: 2px solid #EEE8D7 !important;
}
.quiz-item-wrapper.completed-partial {
    background-color: #FFE0B2 !important;
    border: 2px solid #FFB74D !important;
}
.quiz-item-wrapper.completed-perfect {
    background-color: #C8E6C9 !important;
    border: 2px solid #81C784 !important;
}
.quiz-item-wrapper.completed-neutral {
    background-color: #E8E8E8 !important;
    border: 2px solid #BDBDBD !important;
}

/* Higher specificity rules to ensure status classes work */
.category-card .quiz-list .quiz-item-wrapper.not-started {
    background-color: #fff !important;
    border: 2px solid #fff !important;
}
.category-card .quiz-list .quiz-item-wrapper.in-progress {
    background-color: #FFF8E7 !important;
    border: 2px solid #EEE8D7 !important;
}
.category-card .quiz-list .quiz-item-wrapper.completed-partial {
    background-color: #FFE0B2 !important;
    border: 2px solid #FFB74D !important;
}
.category-card .quiz-list .quiz-item-wrapper.completed-perfect {
    background-color: #C8E6C9 !important;
    border: 2px solid #81C784 !important;
}
.category-card .quiz-list .quiz-item-wrapper.completed-neutral {
    background-color: #E8E8E8 !important;
    border: 2px solid #BDBDBD !important;
}

/* Guide Button Styles */
.guide-button-container {
    margin-top: 12px;
    padding-top: 8px;
    text-align: center;
}

.quiz-guide-button {
    display: inline-block;
    background-color: #4e73df;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.quiz-guide-button:hover {
    background-color: #3867d6;
    text-decoration: none;
    color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .quiz-item {
        min-height: 200px;
    }
    
    .quiz-info {
        gap: 8px;
    }
    
    .quiz-title {
        font-size: 16px;
    }
    
    .quiz-description {
        font-size: 13px;
    }
    
    .guide-button-container {
        margin-top: 8px;
    }
}

.category-progress {
    padding: 1.25rem;
    margin-top: auto;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-text {
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    margin-top: 0.75rem;
    overflow: hidden;
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.5s ease;
    display: block;
    min-width: 0%;
}

/* Progress status colors */
.progress-low .progress-fill {
    background: linear-gradient(90deg, var(--warning-color), var(--danger-color));
}

.progress-medium .progress-fill {
    background: linear-gradient(90deg, var(--warning-color), var(--secondary-color));
}

.progress-high .progress-fill {
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
}

.locked-quiz {
    opacity: 0.7;
    cursor: not-allowed;
    background: repeating-linear-gradient(
        45deg,
        var(--background-color),
        var(--background-color) 10px,
        rgba(0, 0, 0, 0.02) 10px,
        rgba(0, 0, 0, 0.02) 20px
    );
}

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

/* Add completion badges */
.completion-badge {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.75rem;
}

/* Auth Pages Styles */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.auth-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.auth-header {
    padding: 2.5rem 2rem;
    text-align: center;
    background: var(--card-background);
}

.auth-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--progress-bg);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
}

.auth-form {
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--progress-bg);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.auth-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

.auth-button:hover {
    background: #2980b9;
}

/* Header for logged-in state */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--card-background);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 32px;
    width: auto;
}

.logo h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.nav-button:hover {
    background-color: #1a2530;
}

.nav-button.logout {
    background-color: var(--secondary-color);
}

.nav-button.logout:hover {
    background-color: #c0392b;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.username {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.logout-button {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background: #c0392b;
}

.hidden {
    display: none;
}

/* Add these styles for error notifications */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--danger-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

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

/* Add these quiz-specific styles to your existing CSS */

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.back-link:hover {
    color: var(--secondary-color);
    transform: translateX(-4px);
}

.quiz-progress {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    min-width: 250px;
}

.level-info {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    height: 8px;
    background: var(--progress-bg);
    border-radius: 12px;
    margin: 0.75rem 0;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    width: 0%;
    transition: width 0.5s ease;
}

.question-counter {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: right;
    margin-top: 0.5rem;
}

.quiz-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.question-section {
    margin-bottom: 2rem;
}

.question-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.question-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

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

.option {
    position: relative;
    padding: 1.25rem;
    border: 2px solid var(--progress-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--background-color);
}

.option:hover {
    border-color: var(--secondary-color);
    background: white;
    transform: translateX(4px);
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option label {
    display: block;
    padding-left: 2.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-primary);
    user-select: none;
}

.option label::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    transition: background-color 0.1s ease, box-shadow 0.1s ease;
    background: white;
}

.option input[type="radio"]:checked + label::before {
    background-color: var(--secondary-color) !important;
    box-shadow: inset 0 0 0 4px white !important;
    transition: none !important;
}

.submit-button {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.submit-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Outcome screen styles */
.outcome-content {
    text-align: center;
    padding: 2rem;
}

#rewards {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

/* Review section styles */
.review-section, 
.recommendations-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--progress-bg);
}

.review-item {
    padding: 1.25rem;
    border-radius: 12px;
    background: var(--background-color);
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
}

.review-item.correct {
    border-left-color: var(--success-color);
    background: rgba(46, 204, 113, 0.05);
}

.review-item.incorrect {
    border-left-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.05);
}

/* Level-specific progress bar colors */
.level-basic #progress-fill {
    background: linear-gradient(90deg, var(--warning-color), var(--secondary-color));
}

.level-intermediate #progress-fill {
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
}

.level-advanced #progress-fill {
    background: linear-gradient(90deg, var(--success-color), #27ae60);
}

/* Add these to your existing styles */

/* Quiz state management */
.hidden {
    display: none !important;
}

/* Animation for screen transitions */
.quiz-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* Option states */
.option.correct {
    border-color: var(--success-color);
    background: rgba(46, 204, 113, 0.05);
}

.option.incorrect {
    border-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.05);
}

/* Focus states */
.option input[type="radio"]:focus + label::before {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.option input[type="radio"]:focus:checked + label::before {
    box-shadow: inset 0 0 0 4px white, 0 0 0 3px rgba(52, 152, 219, 0.2) !important;
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Ensure proper spacing in outcome screen */
.outcome-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Review list structure */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Options container spacing */
#options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Make option text uninteractable to prevent click interference */
.option-text {
    pointer-events: none;
    user-select: none;
}

/* Enhanced option interaction styles */
.option:active {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: var(--secondary-color);
}

/* Ensure smooth rapid clicking */
.option input[type="radio"]:checked + label::before {
    background-color: var(--secondary-color) !important;
    box-shadow: inset 0 0 0 4px white !important;
    transition: none !important;
}

/* Improve visual feedback for selected options */
.option:has(input[type="radio"]:checked) {
    background-color: rgba(52, 152, 219, 0.05);
    border-color: var(--secondary-color);
}

/* Fallback for browsers that don't support :has() selector */
.option.selected {
    background-color: rgba(52, 152, 219, 0.05);
    border-color: var(--secondary-color);
}

/* Also prevent text selection in quiz option labels - rule updated above */

/* Admin Styles */
.admin-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    margin-bottom: 2rem;
}

.admin-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.admin-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--progress-bg);
    border-radius: 8px;
    font-size: 1rem;
    width: 300px;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls select {
    padding: 0.75rem;
    border: 2px solid var(--progress-bg);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.admin-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    padding: 1rem;
    background: var(--background-color);
    border-radius: 12px;
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.user-table-container {
    overflow-x: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th,
.user-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--progress-bg);
}

.user-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--background-color);
}

.user-table tr:hover {
    background: var(--background-color);
}

.user-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar-small {
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    flex: 1;
    overflow: hidden;
}

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

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Ensure action buttons at bottom of modals have proper spacing */
.user-details-content .action-buttons {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.action-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.reset-button {
    background: var(--danger-color);
    color: white;
}

.user-details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
}

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

.quiz-progress-item {
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.quiz-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Admin Login Styles */
.admin-login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-form-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.admin-form-header p {
    color: var(--text-secondary);
}

/* Admin Panel Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* User Details Modal */
.user-details-modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

/* Auth footer and return button styles */
.auth-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--progress-bg);
    text-align: center;
}

.return-button {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.return-button:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
}

/* Admin link styles */
.admin-link {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    text-align: center;
}

.admin-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-button:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 32px;
    width: auto;
}

.logo h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

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

/* Ensure proper focus indicators */
:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

/* Ensure proper focus states for interactive elements */
button:focus,
a:focus,
input:focus,
select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Ensure proper contrast for disabled elements */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#level-transition-container {
    position: relative;
    width: 100%;
    text-align: center;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    background: white;
    margin-top: 60px;
}

#level-transition-container.active {
    height: 60px;
    margin-bottom: 1rem;
}

.level-transition {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: fadeInOut 3s ease-in-out forwards;
    position: relative;
    z-index: 1;
}

@keyframes fadeInOut {
    0% { 
        opacity: 0;
        transform: translateY(-10px);
    }
    15% { 
        opacity: 1;
        transform: translateY(0);
    }
    85% { 
        opacity: 1;
        transform: translateY(0);
    }
    100% { 
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Keep these styles in frontend/styles.css */
.progress-indicator {
    background-color: #e0f2f1;
    color: #00796b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-right: 10px;
}

.quiz-info {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.back-link.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* Add hover effect for quiz items */
.quiz-item:hover .quiz-icon {
    background: rgba(52, 152, 219, 0.2);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Add styles for locked quizzes */
.locked-quiz {
    opacity: 0.7;
    cursor: not-allowed;
    background: repeating-linear-gradient(
        45deg,
        var(--background-color),
        var(--background-color) 10px,
        rgba(0, 0, 0, 0.02) 10px,
        rgba(0, 0, 0, 0.02) 20px
    );
}

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

/* Add styles for category cards grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 16px; /* 24px row gap, 16px column gap */
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    /* On mobile, revert two-column layout back to single column */
    .quiz-list-two-column {
        grid-template-columns: 1fr;
    }
    
    /* On mobile, category cards don't need to span multiple columns */
    .category-card-wide {
        grid-column: span 1;
    }

    /* Only adjust padding, don't override background or border */
    .quiz-item {
        padding: 1.25rem;
    }

    .quiz-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-login-section {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.admin-login-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-field input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

/* Statistics Panel */
.statistics-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

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

/* User Management Panel */
.user-management-panel {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header h2 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

/* Controls row - contains view toggle and search controls */
.controls-row {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    width: 100%;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: fit-content;
}

.view-toggle label {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

.toggle-buttons {
    display: flex;
    gap: 0.5rem;
}

.toggle-button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 36px;
    white-space: nowrap;
}

.toggle-button:hover {
    background-color: #f5f5f5;
    border-color: #2C3E50;
}

.toggle-button.active {
    background-color: #2C3E50;
    color: white;
    border-color: #2C3E50;
}

.toggle-button i {
    font-size: 0.875rem;
}

/* Search Controls */
.search-controls {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 2rem;
    flex: 1;
}

.control-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 250px;
}

.control-field label {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.control-field input,
.control-field select,
.control-field .action-button {
    width: 100%;
    height: 36px;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: white;
    color: #333;
    box-sizing: border-box;
}

.control-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.control-field .action-button {
    background-color: #2C3E50;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    margin-top: auto;
    height: 36px;
}

@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .search-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-field {
        max-width: none;
    }
}

/* User List */
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background: var(--card-background);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.user-header {
    margin-bottom: 1rem;
}

.user-header h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.user-stats {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.view-details-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.view-details-btn:hover {
    background: var(--primary-color);
}

/* User Details Overlay */
.user-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.user-details-content {
    background: var(--card-background);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: 3rem;
    position: relative;
    box-sizing: border-box;
}

.user-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.user-details-header h2 {
    color: var(--primary-color);
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.quiz-progress-list {
    display: grid;
    gap: 1rem;
}

.quiz-progress-item {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

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

.progress-details span {
    display: inline-block;
    margin-right: 1rem;
}

.reset-button {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reset-button:hover {
    background: #c0392b;
}

.error-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 6px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }

    .statistics-panel {
        grid-template-columns: 1fr;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-controls {
        flex-direction: column;
    }

    .control-field {
        max-width: none;
    }

    .users-list {
        grid-template-columns: 1fr;
    }

    .user-details-content {
        width: 95%;
        padding: 1rem;
        padding-bottom: 2rem;
        max-height: 80vh;
    }
    
    .user-details-content .action-buttons {
        margin-top: 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--background-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Add specific hover styles for each state */
.quiz-item.completed-perfect:hover {
    background-color: #43A047 !important; /* Slightly darker green */
    border: none !important;
}

.quiz-item.completed-partial:hover {
    background-color: #F57C00 !important; /* Slightly darker orange */
    border: none !important;
}

.quiz-item.in-progress:hover {
    background-color: #FFA000 !important; /* Slightly darker yellow */
    border: none !important;
}

.quiz-item.not-started:hover {
    background-color: #F5F5F5 !important; /* Slightly darker white */
    border: none !important;
}

.quiz-item.completed-neutral:hover {
    background-color: #D5D5D5 !important; /* Slightly darker gray */
    border: none !important;
}

.quiz-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Password input container styles */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    width: 100%;
    padding-right: 40px; /* Make room for the eye icon */
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #333;
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-color);
}

/* --- Compact Create Account Quiz Selection Styles --- */
.quiz-selection {
    margin: 0;
    padding: 0;
}
.quiz-category {
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding-bottom: 0.5rem;
}
.quiz-category .category-header {
    background: #2c3e50;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.category-quizzes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Ensure 4 items max on all screen sizes */
@media (min-width: 1401px) {
    .category-quizzes {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    .category-quizzes {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .category-quizzes {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .category-quizzes {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

/* Quiz Type Card Styles for Admin Interface */
.quiz-type-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.quiz-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color, #007bff);
}

.quiz-type-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.view-scenarios-btn {
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: auto;
}

.view-scenarios-btn:hover {
    background: var(--primary-dark, #0056b3);
}

.view-scenarios-btn:focus {
    outline: 2px solid var(--primary-color, #007bff);
    outline-offset: 2px;
}

.quiz-card-wrapper {
    width: 100%;
}

/* Category styling for better organization */
.scenario-category {
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.category-heading {
    background: linear-gradient(135deg, #34495e, #5dade2);
    color: #ffffff !important;
    margin: 0;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

/* Loading Container Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.loading-container .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-container p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scenarios wrapper constraints */
.scenarios-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.scenario-categories {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}
.quiz-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 0.25rem 0;
    margin: 0;
    font-weight: 400;
}
.quiz-option input[type='checkbox'] {
    width: 16px;
    height: 16px;
}
.select-category-btn {
    font-size: 0.95rem;
    padding: 0.2rem 0.7rem;
    border-radius: 3px;
    background: #3498db;
    color: #fff;
    border: none;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}
.select-category-btn:hover {
    background: #217dbb;
}
/* --- End Compact Quiz Selection Styles --- */

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 16px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

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

.toast.warning {
    border-left: 4px solid #ff9800;
}

.toast.info {
    border-left: 4px solid var(--secondary-color);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
}

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

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

.toast.warning .toast-icon {
    color: #ff9800;
}

.toast.info .toast-icon {
    color: var(--secondary-color);
}

.toast-message {
    color: var(--text-primary);
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

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

.toast.hiding {
    transform: translateX(100%);
    opacity: 0;
}

/* User cards expanded stats layout */
.user-stats.expanded-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.user-stats.expanded-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: var(--background-color);
    border-radius: 8px;
    min-height: 60px;
    justify-content: center;
}

/* Make the Last Active stat span the full width */
.user-stats.expanded-stats .stat:last-child {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 0;
}

/* Color coding for quiz status stats */
.user-stats.expanded-stats .stat:nth-child(3) {
    /* Quizzes Passed - Green */
    background-color: #C8E6C9 !important;
    border-left: 4px solid #4bb543;
}

.user-stats.expanded-stats .stat:nth-child(4) {
    /* Quizzes Failed - Red */
    background-color: rgba(255, 68, 68, 0.1) !important;
    border-left: 4px solid #ff4444;
}

.user-stats.expanded-stats .stat:nth-child(5) {
    /* Quizzes In Progress - Light Orange */
    background-color: #FFF8E7 !important;
    border-left: 4px solid #FFA000;
}

.user-stats.expanded-stats .stat:nth-child(6) {
    /* Quizzes Not Started - Light Gray */
    background-color: #fff !important;
    border-left: 4px solid #e0e0e0;
}

.user-stats.expanded-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-align: center;
}

.user-stats.expanded-stats .stat-value {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}

/* Row view specific styles for expanded stats */
.users-list.row-view .user-stats.expanded-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    min-width: 0;
    margin-top: 0;
}

.users-list.row-view .user-stats.expanded-stats .stat {
    background: transparent;
    padding: 0;
    min-height: auto;
    min-width: 80px;
    align-items: center;
    text-align: center;
}

.users-list.row-view .user-stats.expanded-stats .stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    text-align: center;
}

.users-list.row-view .user-stats.expanded-stats .stat-value {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

/* Responsive adjustments for expanded stats */
@media (max-width: 1200px) {
    .user-stats.expanded-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .user-stats.expanded-stats .stat-label {
        font-size: 0.7rem;
    }
    
    .user-stats.expanded-stats .stat-value {
        font-size: 1rem;
    }
    
    .user-stats.expanded-stats .stat:last-child {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .user-stats.expanded-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .user-stats.expanded-stats .stat:last-child {
        max-width: 100%;
    }
    
    .users-list.row-view .user-stats.expanded-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .users-list.row-view .user-stats.expanded-stats .stat {
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .user-stats.expanded-stats {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .user-stats.expanded-stats .stat {
        min-height: 50px;
        padding: 0.25rem;
    }
    
    .user-stats.expanded-stats .stat:last-child {
        max-width: 100%;
    }
    
    .users-list.row-view .user-stats.expanded-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Header button styles for info and badges buttons */
.info-button, .badges-button {
    color: white;
    border-radius: 4px;
    padding: 8px 16px;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: 500;
    font-size: 14px;
}

.info-button {
    background-color: #28a745;
}

.info-button:hover {
    background-color: #218838;
    color: white;
}

.badges-button {
    background-color: var(--primary-color, #4a90e2);
}

.badges-button:hover {
    background-color: var(--primary-color-dark, #3a80d2);
    color: white;
}

.info-button i, .badges-button i {
    margin-right: 6px;
}
