/**
 * Custom styles for Pathology Quiz Application
 * Supports both light and dark themes with optimal contrast
 */

/* Theme Toggle Styling */
.form-check-input:checked {
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
}

.form-check-label {
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

/* Light theme specific styles */
[data-bs-theme="light"] {
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;
    --custom-card-bg: #ffffff;
    --custom-card-border: #dee2e6;
    --custom-shadow: rgba(0, 0, 0, 0.15);
    --custom-hover-bg: #f8f9fa;
}

[data-bs-theme="light"] body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
}

[data-bs-theme="light"] .card {
    background-color: var(--custom-card-bg);
    border: 1px solid var(--custom-card-border);
    box-shadow: 0 0.125rem 0.25rem var(--custom-shadow);
}

[data-bs-theme="light"] .text-muted {
    color: #6c757d !important;
}

/* Dark theme specific styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
    --custom-card-bg: #343a40;
    --custom-card-border: #495057;
    --custom-shadow: rgba(0, 0, 0, 0.3);
    --custom-hover-bg: #495057;
}

[data-bs-theme="dark"] body {
    background: linear-gradient(135deg, #212529 0%, #1a1e21 100%);
    color: #dee2e6;
}

[data-bs-theme="dark"] .card {
    background-color: var(--custom-card-bg);
    border: 1px solid var(--custom-card-border);
    box-shadow: 0 0.125rem 0.25rem var(--custom-shadow);
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

/* Common styles for both themes */
body {
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem var(--custom-shadow) !important;
}

.quiz-progress {
    height: 8px;
    border-radius: 4px;
}

.question-card {
    min-height: 400px;
}

.option-btn {
    text-align: left;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
    background-color: var(--custom-hover-bg);
}

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

.option-btn.correct {
    border-color: var(--bs-success);
    background-color: var(--bs-success);
    color: white;
}

.option-btn.incorrect {
    border-color: var(--bs-danger);
    background-color: var(--bs-danger);
    color: white;
}

.feedback-section {
    border-left: 4px solid var(--bs-info);
    padding-left: 1rem;
    margin-top: 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
}

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

.cat-stats {
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.difficulty-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.difficulty-easy { background-color: var(--bs-success); }
.difficulty-medium { background-color: var(--bs-warning); }
.difficulty-hard { background-color: var(--bs-danger); }

/* Enhanced button styling */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Form controls */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--custom-card-border);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Badge styling */
.badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .card-body.p-5 {
        padding: 2rem !important;
    }
    
    .option-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

/* Focus states for accessibility */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--custom-card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}