/* Custom styles for BA|BE British Airways Best Educator App */
/* Minimal custom styles - relying on Bootstrap dark theme */

:root {
    /* Custom variables for specific components */
    --quiz-border-radius: 8px;
    --quiz-transition: all 0.3s ease;
    --quiz-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Custom hover effects for quiz options */
.hover-highlight {
    transition: var(--quiz-transition);
    cursor: pointer;
    border-radius: var(--quiz-border-radius);
}

.hover-highlight:hover {
    background-color: var(--bs-primary-bg-subtle) !important;
    border-color: var(--bs-primary) !important;
    transform: translateY(-1px);
    box-shadow: var(--quiz-shadow);
}

/* Quiz form check styling */
.form-check-input:checked + .form-check-label.hover-highlight {
    background-color: var(--bs-primary-bg-subtle) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: var(--quiz-shadow);
    color: #212529 !important;
}

/* Ensure all quiz answer text is dark and readable */
.form-check-label {
    color: #212529 !important;
}

.form-check-label span {
    color: #212529 !important;
}

/* Override any inherited text colors in quiz answers */
.hover-highlight,
.hover-highlight span,
.hover-highlight * {
    color: #212529 !important;
}

/* Circular Progress Ring Animations */
.progress-ring {
    transition: all 0.3s ease;
}

.progress-circle {
    transition: stroke-dashoffset 1s ease-in-out;
    animation: progressAnimation 1.5s ease-in-out;
}

@keyframes progressAnimation {
    0% {
        stroke-dashoffset: 157;
    }
    100% {
        stroke-dashoffset: var(--final-offset);
    }
}

.progress-ring:hover {
    transform: scale(1.05);
}

.progress-ring circle {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Badge text contrast fixes */
.badge {
    font-weight: 600 !important;
}

.badge.text-white {
    color: #ffffff !important;
}

/* Card hover effects */
.card {
    transition: var(--quiz-transition);
}

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

/* Progress bar animations */
.progress-bar {
    transition: width 0.6s ease;
}

/* Button hover enhancements */
.btn {
    transition: var(--quiz-transition);
}

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

/* Ensure uniform button sizing for practice buttons */
.btn-sm.rounded-pill {
    min-width: 80px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
}

/* Table row hover effects */
.table-hover tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Modal backdrop customization */
.modal-backdrop {
    backdrop-filter: blur(3px);
}

/* Dashboard hover effects */
.hover-lift:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Enhanced card styling for dashboard */
.card {
    border-radius: 16px !important;
}

.rounded-circle {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Badge enhancements */
.badge.rounded-pill {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Responsive text sizing */
@media (max-width: 576px) {
    .display-6 {
        font-size: 1.5rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    small {
        font-size: 0.75rem !important;
    }
}

/* File upload styling */
.file-info {
    font-size: 0.875rem;
    color: var(--bs-text-muted);
}

/* Chart container responsiveness */
canvas {
    max-width: 100%;
    height: auto;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom badge sizes */
.badge.fs-6 {
    font-size: 0.875rem !important;
}

/* Alert icon alignment */
.alert .fas {
    flex-shrink: 0;
}

/* Navigation active states */
.navbar-nav .nav-link.active {
    color: var(--bs-primary) !important;
    font-weight: 600;
}

/* Aircraft selection styling - blue borders instead of purple backgrounds */
.hover-aircraft {
    transition: var(--quiz-transition);
    cursor: pointer;
    border-radius: var(--quiz-border-radius);
    border: 2px solid transparent;
    background-color: transparent;
}

.hover-aircraft:hover {
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-primary-bg-subtle) !important;
    transform: translateY(-1px);
    box-shadow: var(--quiz-shadow);
}

.form-check-input:checked + .form-check-label.hover-aircraft {
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-primary-bg-subtle) !important;
    box-shadow: var(--quiz-shadow);
}

/* Qualification selection styling */
.hover-qualification {
    transition: var(--quiz-transition);
    cursor: pointer;
    border-radius: var(--quiz-border-radius);
    border: 2px solid transparent;
    background-color: transparent;
}

.hover-qualification:hover {
    border-color: var(--bs-success) !important;
    background-color: var(--bs-success-bg-subtle) !important;
    transform: translateY(-1px);
    box-shadow: var(--quiz-shadow);
}

.form-check-input:checked + .form-check-label.hover-qualification {
    border-color: var(--bs-success) !important;
    background-color: var(--bs-success-bg-subtle) !important;
    box-shadow: var(--quiz-shadow);
}

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

/* Responsive text sizing */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.15rem;
    }
    
    /* Mobile performance cards */
    .performance-card {
        margin-bottom: 0.5rem !important;
    }
    
    .performance-card .card-body {
        padding: 0.75rem !important;
    }
    
    /* Compact chart containers on mobile */
    .chart-container {
        height: 200px !important;
    }
    
    /* Mobile topic cards */
    .topic-card-mobile {
        padding: 0.5rem !important;
    }
    
    .topic-card-mobile h6 {
        font-size: 0.9rem !important;
    }
    
    .topic-card-mobile .progress {
        height: 3px !important;
    }
    
    .topic-card-mobile .badge {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

/* Quiz question styling */
.quiz-question {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1rem;
}

.quiz-answer-box {
    transition: all 0.2s ease;
    cursor: pointer;
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    min-height: 80px;
}

.quiz-answer-box:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    transform: translateY(-1px);
}

.quiz-answer-box.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    border-color: var(--bs-primary) !important;
    border-width: 2px !important;
}

/* Results page specific styling - ensure only correct colors show */
.quiz-answer-box.border-success {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border-color: #198754 !important;
}

.quiz-answer-box.border-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545 !important;
}

/* Performance chart containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Topic badge hover effects */
.badge:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Success animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Error state styling */
.is-invalid {
    border-color: var(--bs-danger) !important;
}

/* Focus states for accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

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

/* Text contrast fixes for better visibility */
.text-white {
    color: var(--bs-body-color) !important;
}

.card-text,
.card-body,
.list-group-item,
.form-control,
.form-select,
.form-check-label {
    color: var(--bs-body-color) !important;
}

/* Ensure badges have good contrast */
.badge {
    color: var(--bs-white) !important;
}

.badge.bg-light {
    color: var(--bs-dark) !important;
}

.badge.bg-success,
.badge.text-bg-success {
    color: var(--bs-dark) !important;
    background-color: var(--bs-success) !important;
}

/* Fix any white text on light backgrounds */
.bg-light .text-white,
.bg-white .text-white {
    color: var(--bs-dark) !important;
}

/* White/light background containers - ensure dark text */
.bg-white,
.bg-light,
.card.bg-white,
.card.bg-light,
.alert-light {
    color: var(--bs-dark) !important;
}

.bg-white *,
.bg-light *,
.card.bg-white *,
.card.bg-light *,
.alert-light * {
    color: var(--bs-dark) !important;
}

/* Override any inherited white text in light containers */
.bg-white .text-white,
.bg-light .text-white,
.card.bg-white .text-white,
.card.bg-light .text-white {
    color: var(--bs-dark) !important;
}

/* Quiz option styling for better visibility */
.form-check-label {
    color: var(--bs-body-color) !important;
    background-color: transparent;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.form-check-input:checked + .form-check-label {
    color: var(--bs-body-color) !important;
}

/* Quiz results uniform box height */
.quiz-answer-box {
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
}

/* Ensure only wrong answers show red text */
.quiz-wrong-answer {
    color: #dc3545 !important;
}

.quiz-correct-answer {
    color: var(--bs-body-color) !important;
}

/* Performance chart text */
.chart-container canvas {
    background-color: transparent !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--bs-border-color) !important;
    }
    
    .btn {
        border-width: 2px !important;
    }
    
    /* Enhanced text contrast in high contrast mode */
    body,
    .card-body,
    .form-control,
    .form-select {
        color: var(--bs-body-color) !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
