/* Monolithic UI Styles - From index-monolithic-backup-20250816-110024.html */

/* Progress Section in Legend */
.progress-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.progress-value {
    font-size: 16px;
    font-weight: bold;
    color: #212529;
}

.progress-value#answeredCount {
    color: #4caf50;
}

.progress-value#markedCount {
    color: #ff9800;
}

.progress-value#remainingCount {
    color: #f44336;
}

/* Category Navigation Styles */
.category-navigation {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    width: 97%;
    margin: 0 auto 15px auto;
    order: 0;
}

.category-buttons-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    position: relative;
    min-width: 120px;
    text-align: center;
}

.category-btn:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.category-btn-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
}

.category-progress {
    font-size: 11px;
    opacity: 0.8;
}

.category-progress-bar {
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.unanswered-btn {
    margin-left: auto;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unanswered-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.unanswered-badge {
    background: white;
    color: #ff9800;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Category Panel */
.category-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 15px;
}

.category-panel.expanded {
    max-height: 300px;
    overflow-y: auto;
}

.category-questions-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.category-question-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.category-question-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.category-question-btn.answered {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.category-question-btn.marked {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

.category-question-btn.visited {
    background: #e3f2fd;
    border-color: #2196f3;
}

.category-question-btn.current {
    background: #ffeb3b;
    border-color: #ffc107;
    animation: pulse 1s ease-in-out infinite;
}

/* Unanswered Questions Modal */
.unanswered-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.unanswered-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.unanswered-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.unanswered-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.unanswered-modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.unanswered-close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
}

.unanswered-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.unanswered-category-section {
    margin-bottom: 25px;
}

.unanswered-category-title {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.unanswered-questions-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.unanswered-question-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #ff9800;
    background: #fff3e0;
    color: #ff9800;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unanswered-question-btn:hover {
    background: #ff9800;
    color: white;
    transform: scale(1.1);
}

.unanswered-modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.unanswered-summary {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.unanswered-summary strong {
    color: #ff9800;
    font-size: 18px;
}

/* Mobile Responsive - Category Navigation */
@media (max-width: 768px) {
    /* Reorder elements for mobile */
    .horizontal-question-panel {
        order: 1;
    }
    
    .test-content-wrapper {
        order: 2;
    }
    
    .category-navigation {
        order: 3;
        padding: 10px;
        margin-top: 10px;
        margin-bottom: 5px;
    }
    
    /* Category Navigation Mobile Styles */
    .category-buttons-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding-bottom: 10px;
        overflow-x: visible;
    }
    
    .category-btn {
        width: 100%;
        padding: 10px 12px;
        min-width: unset;
        font-size: 13px;
        min-height: 65px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        white-space: normal;
    }
    
    .category-btn-content {
        width: 100%;
        align-items: center;
    }
    
    .category-name {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 2px;
    }
    
    .category-progress {
        font-size: 11px;
        color: #666;
        margin-bottom: 4px;
    }
    
    .category-btn .category-progress-bar {
        width: 90%;
        height: 4px;
        margin-top: 4px;
    }
    
    .unanswered-btn {
        grid-column: 1 / -1;
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
        min-width: unset;
        margin-left: 0;
        justify-content: center;
        min-height: 45px;
    }
    
    .unanswered-badge {
        padding: 1px 6px;
        font-size: 10px;
    }
    
    .category-questions-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 6px;
        padding: 10px;
    }
    
    .category-panel {
        margin-top: 10px;
    }
    
    .category-panel.expanded {
        max-height: 250px;
    }
    
    .category-question-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    /* Unanswered Modal Mobile */
    .unanswered-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .unanswered-modal-title {
        font-size: 20px;
    }
    
    .unanswered-category-title {
        font-size: 16px;
    }
    
    .unanswered-questions-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
    
    .unanswered-question-btn {
        width: 40px;
        height: 40px;
        font-size: 13px;
    }
    
    /* Mobile legend inside question area */
    .mobile-legend-inside {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        padding: 8px;
        border-radius: 10px;
        margin-top: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        width: 100%;
    }
    
    .mobile-legend-item {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: #666;
    }
    
    .mobile-legend-color {
        width: 16px;
        height: 16px;
        border-radius: 3px;
        border: 1px solid #ddd;
    }
    
    .mobile-legend-color.answered {
        background: #4caf50;
        border-color: #4caf50;
    }
    
    .mobile-legend-color.marked {
        background: #ff9800;
        border-color: #ff9800;
    }
    
    .mobile-legend-color.visited {
        background: #fff3cd;
        border-color: #ffc107;
    }
    
    /* Mobile submit button */
    .mobile-submit-btn {
        display: inline-block !important;
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        color: white;
        padding: 8px 16px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
}