/**
 * Institute Management Portal - Test Interface Styles
 * Version: 1.0.0
 */

/* Test Interface Wrapper */
.imp-test-wrapper {
    min-height: 100vh;
    background: #f3f4f6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Test Header */
.imp-test-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.imp-test-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.imp-test-info h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.imp-test-section-name {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.imp-test-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.imp-test-timer i {
    font-size: 20px;
}

.imp-test-timer.warning {
    color: #fbbf24;
    animation: pulse 1s infinite;
}

.imp-test-timer.danger {
    color: #ef4444;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.imp-test-controls {
    display: flex;
    gap: 10px;
}

.imp-test-controls .imp-btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* Test Main Content */
.imp-test-main {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Test Sidebar - Question Navigator */
.imp-test-sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.imp-test-sidebar h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.imp-question-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.imp-question-nav-item {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
}

.imp-question-nav-item:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.imp-question-nav-item.current {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.imp-question-nav-item.answered {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.imp-question-nav-item.flagged {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.imp-question-nav-item.flagged::after {
    content: '\f024';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    position: absolute;
    top: 2px;
    right: 2px;
}

.imp-test-legend {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.imp-test-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #6b7280;
}

.imp-test-legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #e5e7eb;
}

.imp-test-legend-dot.answered {
    background: #10b981;
    border-color: #10b981;
}

.imp-test-legend-dot.flagged {
    background: #f59e0b;
    border-color: #f59e0b;
}

.imp-test-legend-dot.current {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* Test Content Area */
.imp-test-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.imp-question-container {
    max-width: 900px;
    margin: 0 auto;
}

.imp-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.imp-question-number {
    font-size: 14px;
    color: #6b7280;
}

.imp-question-number strong {
    color: #374151;
    font-size: 16px;
}

.imp-flag-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #6b7280;
}

.imp-flag-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.imp-flag-btn.flagged {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

/* Question Card */
.imp-question-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.imp-question-instruction {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

.imp-question-instruction strong {
    color: #334155;
}

.imp-question-body {
    padding: 25px;
}

.imp-question-text {
    font-size: 17px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Answer Options */
.imp-answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.imp-answer-option {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.imp-answer-option:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
}

.imp-answer-option.selected {
    border-color: #4f46e5;
    background: #eef2ff;
}

.imp-answer-option input[type="radio"],
.imp-answer-option input[type="checkbox"] {
    display: none;
}

.imp-answer-indicator {
    width: 28px;
    height: 28px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.imp-answer-option.selected .imp-answer-indicator {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.imp-answer-text {
    font-size: 15px;
    color: #374151;
    line-height: 1.5;
    padding-top: 3px;
}

/* Fill in the Blank */
.imp-fill-blank-input {
    display: inline-block;
    min-width: 150px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.imp-fill-blank-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Essay/Writing Answer */
.imp-essay-answer {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease;
}

.imp-essay-answer:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.imp-word-count {
    text-align: right;
    font-size: 13px;
    color: #6b7280;
    margin-top: 10px;
}

.imp-word-count.warning {
    color: #f59e0b;
}

.imp-word-count.danger {
    color: #ef4444;
}

/* Audio Player */
.imp-audio-player {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.imp-audio-player audio {
    width: 100%;
}

.imp-audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}

.imp-play-count {
    background: #e5e7eb;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Speaking Recording */
.imp-recording-area {
    background: #f8fafc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
}

.imp-record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.imp-record-btn:hover {
    transform: scale(1.05);
    background: #dc2626;
}

.imp-record-btn.recording {
    animation: recording-pulse 1.5s infinite;
}

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.imp-recording-status {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
}

.imp-recording-status.recording {
    color: #ef4444;
    font-weight: 500;
}

.imp-recording-timer {
    font-size: 24px;
    font-weight: 600;
    color: #374151;
}

/* Image in Question */
.imp-question-image {
    margin-bottom: 25px;
    text-align: center;
}

.imp-question-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Passage Reading */
.imp-reading-passage {
    background: #fefce8;
    border-left: 4px solid #eab308;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 0 10px 10px 0;
    font-size: 15px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.imp-reading-passage h4 {
    margin: 0 0 15px 0;
    color: #854d0e;
}

/* Navigation Buttons */
.imp-question-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.imp-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.imp-nav-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.imp-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.imp-nav-btn.primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.imp-nav-btn.primary:hover {
    background: #4338ca;
}

/* Test Submit Modal */
.imp-submit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.imp-submit-modal.active {
    opacity: 1;
    visibility: visible;
}

.imp-submit-modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    padding: 30px;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.imp-submit-modal.active .imp-submit-modal-content {
    transform: scale(1);
}

.imp-submit-icon {
    width: 70px;
    height: 70px;
    background: #fef3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #f59e0b;
}

.imp-submit-modal h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #1f2937;
}

.imp-submit-modal p {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 15px;
}

.imp-submit-stats {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.imp-submit-stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.imp-submit-stats-row:last-child {
    margin-bottom: 0;
}

.imp-submit-stats-row span:first-child {
    color: #6b7280;
}

.imp-submit-stats-row span:last-child {
    font-weight: 600;
    color: #374151;
}

.imp-submit-modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.imp-submit-modal-btns .imp-btn {
    flex: 1;
    max-width: 150px;
}

/* Results Page */
.imp-results-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.imp-results-header {
    text-align: center;
    margin-bottom: 40px;
}

.imp-results-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 48px;
    color: #ffffff;
}

.imp-results-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #1f2937;
}

.imp-results-header p {
    color: #6b7280;
    font-size: 16px;
}

.imp-score-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
}

.imp-score-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 25px;
}

.imp-score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#4f46e5 var(--percentage, 75%), #e5e7eb 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.imp-score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: #ffffff;
    border-radius: 50%;
}

.imp-score-value {
    position: relative;
    z-index: 1;
    text-align: center;
}

.imp-score-value .number {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.imp-score-value .label {
    font-size: 14px;
    color: #6b7280;
}

.imp-score-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.imp-score-detail {
    text-align: center;
}

.imp-score-detail .value {
    font-size: 28px;
    font-weight: 700;
    color: #374151;
}

.imp-score-detail .value.correct {
    color: #10b981;
}

.imp-score-detail .value.wrong {
    color: #ef4444;
}

.imp-score-detail .value.unanswered {
    color: #6b7280;
}

.imp-score-detail .label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 5px;
}

.imp-section-scores {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.imp-section-score-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.imp-section-score-item .section-name {
    font-weight: 500;
    color: #374151;
}

.imp-section-score-item .section-score {
    font-weight: 600;
    color: #4f46e5;
}

.imp-results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 992px) {
    .imp-test-sidebar {
        width: 220px;
    }
    
    .imp-question-nav {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .imp-test-header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .imp-test-info {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .imp-test-info h2 {
        font-size: 16px;
    }
    
    .imp-test-main {
        flex-direction: column;
    }
    
    .imp-test-sidebar {
        width: 100%;
        order: 2;
        border-right: none;
        border-top: 1px solid #e5e7eb;
        max-height: 200px;
    }
    
    .imp-test-content {
        padding: 20px;
        order: 1;
    }
    
    .imp-question-nav {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .imp-score-main {
        flex-direction: column;
        gap: 20px;
    }
    
    .imp-score-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .imp-section-scores {
        grid-template-columns: 1fr;
    }
}

/* Test Type Specific Styles */

/* IELTS */
.imp-test-ielts .imp-test-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* PTE */
.imp-test-pte .imp-test-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* OET */
.imp-test-oet .imp-test-header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* CELPIP */
.imp-test-celpip .imp-test-header {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* NAATI CCL */
.imp-test-naati .imp-test-header {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}
