/**
 * TMT - Target Mock Test
 * Test Page Stylesheet
 * 
 * यह Test Page के लिए Specific CSS Styles है।
 * Timer, Questions, Navigation, Status Dots, etc.
 * 
 * ⭐ NEW: Carry-forward timer info label & negative timer styles जोड़े गए हैं।
 */

/* ============================================
   1. TEST CONTAINER
   ============================================ */
.test-container {
    background: var(--white, #ffffff);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.12));
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   2. TEST HEADER BAR
   ============================================ */
.test-header-bar {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    padding: 12px 20px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.test-header-bar .test-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-header-bar .test-title i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.test-header-bar .test-timer {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 14px;
    border-radius: var(--radius-full, 9999px);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.test-header-bar .test-timer i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.test-header-bar .test-timer.warning {
    background: rgba(245, 124, 0, 0.8);
    animation: pulse 1s infinite;
}

.test-header-bar .test-timer.danger {
    background: rgba(198, 40, 40, 0.9);
    animation: pulse 0.5s infinite;
}

.test-header-bar .test-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-header-bar .test-actions .question-counter {
    font-size: 0.75rem;
    opacity: 0.9;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full, 9999px);
}

/* ============================================
   3. TEST BODY
   ============================================ */
.test-body {
    padding: 20px;
}

/* ============================================
   4. QUESTION STATUS DOTS
   ============================================ */
.test-question-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px;
    background: var(--gray-50, #fafafa);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 20px;
    border: 1px solid var(--gray-200, #eeeeee);
}

.test-status-dot {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm, 4px);
    border: 2px solid var(--gray-300, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white, #ffffff);
    color: var(--gray-500, #9e9e9e);
    position: relative;
}

.test-status-dot:hover {
    transform: scale(1.1);
    border-color: var(--primary, #0d47a1);
    z-index: 2;
}

.test-status-dot.answered {
    background: var(--success, #2e7d32);
    border-color: var(--success, #2e7d32);
    color: var(--white, #ffffff);
}

.test-status-dot.unanswered {
    background: var(--gray-200, #eeeeee);
    border-color: var(--gray-400, #bdbdbd);
    color: var(--gray-600, #757575);
}

.test-status-dot.not-visited {
    background: var(--white, #ffffff);
    border-color: var(--gray-300, #e0e0e0);
    color: var(--gray-400, #bdbdbd);
}

.test-status-dot.reviewed {
    background: var(--warning, #f57c00);
    border-color: var(--warning, #f57c00);
    color: var(--white, #ffffff);
}

.test-status-dot.current {
    border-color: var(--primary, #0d47a1);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.2);
    transform: scale(1.08);
    z-index: 1;
}

/* Status Dot Legend */
.test-status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.75rem;
    color: var(--gray-600, #757575);
}

.test-status-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.test-status-legend .legend-dot {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid var(--gray-300, #e0e0e0);
}

.test-status-legend .legend-dot.answered {
    background: var(--success, #2e7d32);
    border-color: var(--success, #2e7d32);
}

.test-status-legend .legend-dot.unanswered {
    background: var(--gray-200, #eeeeee);
    border-color: var(--gray-400, #bdbdbd);
}

.test-status-legend .legend-dot.not-visited {
    background: var(--white, #ffffff);
    border-color: var(--gray-300, #e0e0e0);
}

.test-status-legend .legend-dot.reviewed {
    background: var(--warning, #f57c00);
    border-color: var(--warning, #f57c00);
}

.test-status-legend .legend-dot.current {
    border-color: var(--primary, #0d47a1);
    box-shadow: 0 0 0 2px rgba(13, 71, 161, 0.2);
}

/* ============================================
   5. QUESTION WRAPPER
   ============================================ */
.test-question-wrapper {
    animation: fadeIn 0.3s ease;
}

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

.test-question-wrapper.d-none {
    display: none !important;
}

/* ============================================
   6. QUESTION HEADER
   ============================================ */
.test-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.test-question-number {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gray-900, #212121);
}

.test-question-number .subject-name {
    font-size: 0.7rem;
    color: var(--gray-500, #9e9e9e);
    font-weight: 400;
    margin-left: 8px;
}

.test-question-timer {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary, #0d47a1);
    font-variant-numeric: tabular-nums;
    padding: 4px 12px;
    background: var(--primary-lightest, #e3f2fd);
    border-radius: var(--radius-full, 9999px);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.test-question-timer i {
    font-size: 0.8rem;
}

.test-question-timer.success {
    color: var(--success, #2e7d32);
    background: var(--success-bg, #e8f5e9);
}

.test-question-timer.warning {
    color: var(--warning, #f57c00);
    background: var(--warning-bg, #fff3e0);
}

.test-question-timer.danger {
    color: var(--danger, #c62828);
    background: var(--danger-bg, #ffebee);
    animation: pulse 1s infinite;
}

/* ⭐ NEW: NEGATIVE TIMER (carry-forward negative होने पर) */
.test-question-timer.negative {
    color: #c62828 !important;
    background: #ffebee !important;
    animation: pulse-red 0.8s infinite;
    font-weight: 700;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.03);
    }
}

/* ============================================
   6a. ⭐ NEW: CARRY-FORWARD INFO LABEL
   ============================================ */
.test-carry-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 8px 0 12px 0;
    border-radius: var(--radius-md, 8px);
    font-size: 0.85rem;
    font-weight: 500;
    animation: carryInfoIn 0.4s ease;
    line-height: 1.4;
}

.test-carry-info i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.test-carry-info .carry-info-text {
    flex: 1;
}

.test-carry-info .carry-info-text strong {
    font-weight: 700;
}

/* Positive carry (बचा हुआ समय) - हरा */
.test-carry-info.carry-positive {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.test-carry-info.carry-positive i {
    color: #2e7d32;
}

/* Negative carry (अतिरिक्त समय) - लाल */
.test-carry-info.carry-negative {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.test-carry-info.carry-negative i {
    color: #c62828;
}

@keyframes carryInfoIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   7. QUESTION TEXT
   ============================================ */
.test-question-text {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: var(--gray-50, #fafafa);
    border-radius: var(--radius-md, 8px);
    border-left: 4px solid var(--primary-light, #42a5f5);
}

.test-question-text .question-image {
    margin-top: 12px;
    max-width: 100%;
}

.test-question-text .question-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid var(--gray-200, #eeeeee);
}

/* ============================================
   8. OPTIONS
   ============================================ */
.test-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.test-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--gray-200, #eeeeee);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white, #ffffff);
    position: relative;
}

.test-option:hover {
    border-color: var(--primary-light, #42a5f5);
    background: var(--primary-lightest, #e3f2fd);
}

.test-option.selected {
    border-color: var(--primary, #0d47a1);
    background: var(--primary-lightest, #e3f2fd);
}

.test-option.correct {
    border-color: var(--success, #2e7d32);
    background: var(--success-bg, #e8f5e9);
}

.test-option.incorrect {
    border-color: var(--danger, #c62828);
    background: var(--danger-bg, #ffebee);
}

.test-option input[type="radio"] {
    display: none;
}

.test-option .option-label {
    font-weight: 700;
    color: var(--gray-700, #616161);
    min-width: 24px;
    font-size: 0.95rem;
}

.test-option .option-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--gray-800, #424242);
}

.test-option .option-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.test-option .option-icon.selected {
    color: var(--primary, #0d47a1);
}

.test-option .option-icon.correct {
    color: var(--success, #2e7d32);
}

.test-option .option-icon.incorrect {
    color: var(--danger, #c62828);
}

/* ============================================
   9. NAVIGATION
   ============================================ */
.test-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200, #eeeeee);
    flex-wrap: wrap;
}

.test-nav-btn {
    padding: 8px 20px;
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.test-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.test-nav-btn-prev {
    background: var(--gray-200, #eeeeee);
    color: var(--gray-700, #616161);
}

.test-nav-btn-prev:hover:not(:disabled) {
    background: var(--gray-300, #e0e0e0);
}

.test-nav-btn-next {
    background: var(--primary, #0d47a1);
    color: var(--white, #ffffff);
}

.test-nav-btn-next:hover:not(:disabled) {
    background: var(--primary-dark, #1a237e);
}

.test-nav-btn-review {
    background: var(--warning, #f57c00);
    color: var(--white, #ffffff);
}

.test-nav-btn-review:hover:not(:disabled) {
    background: #e65100;
}

.test-nav-btn-review.reviewed {
    background: var(--gray-200, #eeeeee);
    color: var(--gray-600, #757575);
}

.test-nav-btn-clear {
    background: var(--gray-200, #eeeeee);
    color: var(--gray-700, #616161);
}

.test-nav-btn-clear:hover:not(:disabled) {
    background: var(--danger, #c62828);
    color: var(--white, #ffffff);
}

.test-nav-btn-submit {
    background: var(--success, #2e7d32);
    color: var(--white, #ffffff);
}

.test-nav-btn-submit:hover:not(:disabled) {
    background: #1b5e20;
}

.test-nav-center {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   10. SUBMIT SECTION
   ============================================ */
.test-submit-section {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200, #eeeeee);
}

.test-submit-btn {
    padding: 12px 40px;
    border-radius: var(--radius-md, 8px);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--success, #2e7d32);
    color: var(--white, #ffffff);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.test-submit-btn:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
}

.test-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   11. MODAL (Submit Confirmation)
   ============================================ */
.test-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.test-modal-overlay.open {
    display: flex;
}

.test-modal {
    background: var(--white, #ffffff);
    border-radius: var(--radius-lg, 16px);
    max-width: 480px;
    width: 100%;
    padding: 32px;
    box-shadow: var(--shadow-xl, 0 16px 48px rgba(0,0,0,0.15));
    animation: modalIn 0.3s ease;
}

.test-modal .modal-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 16px;
}

.test-modal h3 {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gray-900, #212121);
    margin-bottom: 8px;
}

.test-modal p {
    text-align: center;
    color: var(--gray-600, #757575);
    margin-bottom: 20px;
    line-height: 1.6;
}

.test-modal .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.test-modal .modal-actions .btn {
    padding: 10px 24px;
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-width: 120px;
}

.test-modal .modal-actions .btn-cancel {
    background: var(--gray-200, #eeeeee);
    color: var(--gray-700, #616161);
}

.test-modal .modal-actions .btn-cancel:hover {
    background: var(--gray-300, #e0e0e0);
}

.test-modal .modal-actions .btn-submit {
    background: var(--success, #2e7d32);
    color: var(--white, #ffffff);
}

.test-modal .modal-actions .btn-submit:hover {
    background: #1b5e20;
}

@keyframes modalIn {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ============================================
   12. KEYBOARD SHORTCUTS HELP
   ============================================ */
.test-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: var(--gray-50, #fafafa);
    border-radius: var(--radius-md, 8px);
    font-size: 0.7rem;
    color: var(--gray-500, #9e9e9e);
    margin-top: 16px;
    border: 1px dashed var(--gray-300, #e0e0e0);
}

.test-shortcuts .shortcut-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.test-shortcuts .shortcut-key {
    padding: 1px 6px;
    background: var(--gray-200, #eeeeee);
    border-radius: var(--radius-sm, 4px);
    font-weight: 600;
    font-size: 0.6rem;
    border: 1px solid var(--gray-300, #e0e0e0);
}

/* ============================================
   13. ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ============================================
   14. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .test-header-bar {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .test-header-bar .test-title {
        font-size: 0.85rem;
        justify-content: center;
    }

    .test-header-bar .test-timer {
        font-size: 0.95rem;
        justify-content: center;
    }

    .test-header-bar .test-actions {
        justify-content: center;
    }

    .test-body {
        padding: 12px;
    }

    .test-question-status {
        gap: 4px;
        padding: 8px 10px;
    }

    .test-status-dot {
        width: 28px;
        height: 28px;
        font-size: 0.55rem;
    }

    .test-question-number {
        font-size: 0.9rem;
    }

    .test-question-timer {
        font-size: 0.8rem;
        padding: 2px 10px;
    }

    .test-question-text {
        font-size: 0.95rem;
        padding: 12px 14px;
    }

    /* ⭐ NEW: Carry info responsive */
    .test-carry-info {
        font-size: 0.75rem;
        padding: 6px 10px;
        gap: 6px;
    }

    .test-carry-info i {
        font-size: 0.85rem;
    }

    .test-option {
        padding: 10px 12px;
    }

    .test-option .option-text {
        font-size: 0.9rem;
    }

    .test-navigation {
        flex-direction: column;
        gap: 6px;
    }

    .test-nav-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    .test-nav-center {
        width: 100%;
        flex-direction: row;
        justify-content: center;
    }

    .test-shortcuts {
        display: none;
    }

    .test-modal {
        padding: 24px 20px;
    }

    .test-modal .modal-actions {
        flex-direction: column;
    }

    .test-modal .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .test-header-bar .test-title {
        font-size: 0.75rem;
    }

    .test-header-bar .test-timer {
        font-size: 0.85rem;
        padding: 2px 10px;
    }

    .test-status-dot {
        width: 24px;
        height: 24px;
        font-size: 0.5rem;
    }

    .test-question-text {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    /* ⭐ NEW: Carry info small screens */
    .test-carry-info {
        font-size: 0.7rem;
        padding: 5px 8px;
        gap: 5px;
        line-height: 1.3;
    }

    .test-carry-info i {
        font-size: 0.8rem;
    }

    .test-option {
        padding: 8px 10px;
        gap: 8px;
    }

    .test-option .option-text {
        font-size: 0.85rem;
    }

    .test-status-legend {
        font-size: 0.65rem;
        gap: 8px;
    }
}

/* ============================================
   15. TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .test-option {
        min-height: 48px;
    }

    .test-nav-btn {
        min-height: 44px;
    }

    .test-status-dot {
        min-width: 28px;
        min-height: 28px;
    }

    .test-status-dot:hover {
        transform: none;
    }

    .test-option:hover {
        border-color: var(--gray-200, #eeeeee);
        background: var(--white, #ffffff);
    }

    .test-option.selected {
        border-color: var(--primary, #0d47a1);
        background: var(--primary-lightest, #e3f2fd);
    }

    .test-nav-btn:active {
        transform: scale(0.97);
    }
}

/* ============================================
   16. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .test-question-wrapper {
        animation: none !important;
    }

    .test-status-dot {
        transition: none !important;
    }

    .test-option {
        transition: none !important;
    }

    .test-nav-btn {
        transition: none !important;
    }

    .test-header-bar .test-timer.warning,
    .test-header-bar .test-timer.danger {
        animation: none !important;
    }

    .test-question-timer.danger,
    .test-question-timer.negative {
        animation: none !important;
    }

    .test-modal {
        animation: none !important;
    }

    .test-carry-info {
        animation: none !important;
    }
}

/* ============================================
   17. PRINT STYLES
   ============================================ */
@media print {
    .test-header-bar,
    .test-navigation,
    .test-submit-section,
    .test-shortcuts,
    .test-status-legend,
    .test-question-timer,
    .test-modal-overlay,
    .test-carry-info {
        display: none !important;
    }

    .test-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .test-body {
        padding: 0 !important;
    }

    .test-question-wrapper {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 20px;
    }

    .test-option {
        border-color: #ddd !important;
        background: #fff !important;
    }

    .test-option.selected {
        border-color: #000 !important;
        background: #f5f5f5 !important;
    }

    .test-question-text {
        border-left-color: #000 !important;
        background: #fafafa !important;
    }

    .test-status-dot {
        border-color: #ddd !important;
        background: #fff !important;
        color: #000 !important;
    }

    .test-status-dot.answered {
        background: #e8f5e9 !important;
        border-color: #2e7d32 !important;
        color: #2e7d32 !important;
    }
}

/* ============================================
   END OF TEST.CSS
   ============================================ */
   