/* Custom styles for Physics Question Bank */

body {
    font-family: 'Vazir', 'Tahoma', Arial, sans-serif;
    background-color: #f5f5f5;
}

/* RTL adjustments */
body[dir="rtl"] {
    text-align: right;
}

/* Navbar */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Card styling */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
}

/* Filter panel */
.sticky-top {
    position: sticky;
}

/* Checkbox styling with RTL support */
.form-check {
    padding: 0rem 0;
    direction: rtl;
    text-align: right;
    padding-right: 2rem;
}

.form-check-input {
    float: right;
    margin-left: 0rem;
    margin-right: 0;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    padding-right: 0;
    padding-left: 0;
}

/* Button styling */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Results container */
#results-container img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Question and Answer cards */
.border-bottom {
    border-bottom: 2px solid #dee2e6 !important;
}

.border-bottom:last-child {
    border-bottom: none !important;
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sticky-top {
        position: relative !important;
    }
    
    .card-body {
        max-height: none !important;
    }
}

/* Local font loading */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Dastnevis font for subtitle (like Android) */
@font-face {
    font-family: 'Dastnevis';
    src: url('../fonts/dastnevis.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Apply Dastnevis to subtitle text */
.subtitle-text {
    font-family: 'Dastnevis', 'Vazir', Tahoma, sans-serif;
    font-size: 1.4rem;
    color: #6c757d;
}



/* Improve readability */
p, label, .form-check-label {
    line-height: 1.8;
}

/* Number input styling */
input[type="number"] {
    text-align: center;
}

/* Alert styling */
.alert {
    border-radius: 8px;
    border: none;
}

/* Custom scrollbar */
.card-body::-webkit-scrollbar {
    width: 8px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Question/Answer numbering */
h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Image container */
.img-fluid {
    display: block;
    margin: 0 auto;
}

/* Floating buttons container */
.floating-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.floating-buttons .btn {
    flex: 1;
    max-width: 170px;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .floating-buttons {
        padding: 0.5rem;
        gap: 5px;
    }
    
    .floating-buttons .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
        border-radius: 4px;
    }
}


/* ========== NAVBAR STYLES ========== */
/* Left side navigation */
.navbar-nav {
    flex-direction: row;
    gap: 5px;
}

.navbar-nav .nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

/* Right side profile/login */
.navbar .btn-sm {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar .btn-sm:hover {
    transform: translateY(-2px);
}

.username-badge {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        text-align: center;
        margin-top: 10px;
    }
    
    .navbar-collapse {
        margin-top: 10px;
    }
    
    .d-flex.align-items-center.gap-2 {
        margin-left: 0;
    }
}



/* Small brand next to username/login */
.small-brand {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 12px;
    margin-left: 5px;
}


.small-brand:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    }

/* Mobile optimization - keep brand but make it smaller */
@media (max-width: 768px) {
    .small-brand {
        font-size: 0.8rem;
        padding-left: 6px;
        margin-left: 3px;
        border-left-width: 0.5px;
    }

    
    .username-badge {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
    
    .navbar .btn-sm {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    .navbar-nav .nav-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .d-flex.align-items-center.gap-3 {
        gap: 6px;
    }
}



/* ========== TEST MODE STYLES ========== */
.mode-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
}

.mode-switch {
    display: inline-flex;
    background: #e8eef4;
    border-radius: 40px;
    padding: 4px;
    border: 1px solid #c8d6e5;
}

.mode-option {
    padding: 7px 20px;
    border-radius: 36px;
    cursor: pointer;
    transition: all 0.22s ease;
    font-size: 0.88rem;
    color: #5a7a94;
    font-weight: 500;
    white-space: nowrap;
}

.mode-option.active {
    background: white;
    color: #1a4f6e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.13);
}

/* Test options container (gozineha)*/ 
.test-options {
    margin: 16px 0 6px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;             /* Desktop: 14px gap */
    direction: rtl;
}

/* Mobile override */
@media (max-width: 768px) {
    .test-options {
        gap: 8px;          /* Mobile: smaller 8px gap */
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .test-options {
        gap: 6px;          /* Even smaller for tiny screens */
    }
}

/* Each option pill */


/* Your existing desktop styles remain exactly as is */
.option-label {
    border: 1.5px solid #c8d6e5;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    background: #f4f8fb;
    font-size: 0.9rem;
    color: #3a4a5a;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}

/* Mobile overrides - only changes what's needed */
@media (max-width: 768px) {
    .option-label {
        padding: 4px 10px;      /* Slightly smaller on mobile */
        font-size: 0.8rem;      /* Smaller text on mobile */
        border-radius: 6px;      /* Slightly smaller corners */
        /* All other properties (border, background, color, etc.) stay the same */
    }
}

/* For very small phones */
@media (max-width: 480px) {
    .option-label {
        padding: 3px 8px;
        font-size: 0.75rem;
        border-radius: 5px;
    }
}



.option-label:hover {
    border-color: #378ADD;
    background: #E6F1FB;
    color: #0C447C;
}

/* Selected by user */
.option-label.selected {
    border-color: #185FA5;
    background: #E6F1FB;
    color: #0C447C;
    font-weight: 600;
}

/* Reset touch hover state when deselected */
.option-label:not(.selected):not(.correct):not(.wrong) {
    border-color: #c8d6e5;
    background: #f4f8fb;
    color: #3a4a5a;
    font-weight: normal;
}

/* Correct answer */
.option-label.correct {
    border-color: #3B6D11;
    background: #EAF3DE;
    color: #27500A;
    font-weight: 600;
}

/* Wrong answer */
.option-label.wrong {
    border-color: #A32D2D;
    background: #FCEBEB;
    color: #791F1F;
    font-weight: 600;
}

/* Feedback banner */
/* Your existing desktop styles */
.answer-feedback {
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    direction: rtl;
    border-radius: 0;
    border-right: 3px solid transparent;
}

/* Mobile version */
@media (max-width: 768px) {
    .answer-feedback {
        padding: 6px 10px;      /* Smaller padding on mobile */
        font-size: 0.8rem;      /* Smaller text on mobile */
        margin-top: 8px;        /* Slightly less margin */
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .answer-feedback {
        padding: 5px 8px;
        font-size: 0.75rem;
        margin-top: 6px;
    }
}
.answer-feedback.correct {
    background: #EAF3DE;
    color: #27500A;
    border-right-color: #3B6D11;
}

.answer-feedback.wrong {
    background: #FCEBEB;
    color: #791F1F;
    border-right-color: #A32D2D;
}

