/* Custom styles for SigmaBrain AI Educational App */

/* Dark theme fallback when Replit CDN is blocked */
[data-bs-theme="dark"] {
    --bs-body-color: #dee2e6;
    --bs-body-bg: #212529;
    --bs-emphasis-color: #fff;
    --bs-secondary-color: rgba(222, 226, 230, 0.75);
    --bs-tertiary-color: rgba(222, 226, 230, 0.5);
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-border-color: #495057;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
    --bs-form-valid-color: #75b798;
    --bs-form-invalid-color: #f1aeb5;
}

[data-bs-theme="dark"] body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .navbar-dark {
    background-color: var(--bs-primary) !important;
}

/* Brighter navigation text for better readability */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #ffffff !important;
}

.navbar-dark .navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
}

.navbar-dark .navbar-nav .dropdown-toggle {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-dark .navbar-nav .dropdown-toggle:hover {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card {
    background-color: #2d3339;
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .alert-success {
    background-color: rgba(25, 135, 84, 0.2);
    border-color: rgba(25, 135, 84, 0.3);
    color: #75b798;
}

/* AP Badge Styling */
.ap-badge {
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    color: #212529 !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    animation: ap-pulse 2s infinite;
}

@keyframes ap-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 4px 8px rgba(255, 193, 7, 0.5);
    }
}

.ap-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.6);
}

/* AP Course Selection Highlight */
optgroup[label*="🎓"] {
    background-color: rgba(255, 193, 7, 0.1);
    font-weight: 600;
}

[data-bs-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.2);
    border-color: rgba(13, 202, 240, 0.3);
    color: #6edff6;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffed4a;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
    color: #f1aeb5;
}

/* Body and general styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Cursor pointer for clickable elements */
.cursor-pointer {
    cursor: pointer;
}

/* Enhanced form styling */
.form-select:focus,
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Answer option hover effects */
.answer-option {
    transition: all 0.3s ease;
    cursor: pointer;
}

.answer-option:hover {
    background-color: var(--bs-light) !important;
    border-color: var(--bs-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Quiz progress styling */
.progress {
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Card enhancements */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Button enhancements */
.btn {
    transition: all 0.3s ease;
}

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

/* Loading animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Score display animations */
.display-2 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Alert enhancements */
.alert {
    border-left: 4px solid;
    border-radius: 8px;
}

.alert-info {
    border-left-color: var(--bs-info);
}

.alert-success {
    border-left-color: var(--bs-success);
}

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

.alert-danger {
    border-left-color: var(--bs-danger);
}

/* Navigation enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Badge styling */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Image styling */
.img-fluid {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.img-fluid:hover {
    transform: scale(1.02);
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Custom color classes for feedback */
.text-correct {
    color: #198754 !important;
}

.text-incorrect {
    color: #dc3545 !important;
}

.bg-correct {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border-color: #198754 !important;
}

.bg-incorrect {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545 !important;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .card-header {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Mobile responsive enhancements */
@media (max-width: 768px) {
    .display-2 {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Dark theme specific enhancements */
[data-bs-theme="dark"] .card {
    border: 1px solid rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .answer-option:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

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

/* Icon styling */
.fas, .far {
    vertical-align: baseline;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading spinner enhancement */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom checkbox and radio styling */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
}

.form-check-label {
    font-size: 1rem;
    margin-left: 0.5rem;
}

/* Enhanced shadow utilities */
.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Typography enhancements */
.fw-medium {
    font-weight: 500;
}

.text-shadow {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Quiz specific styling */
.quiz-container {
    min-height: 60vh;
}

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

/* Result page specific styling */
.result-header {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    font-weight: bold;
    color: white;
}
