/* Dark Theme Styles for JEE Question Bank Pro */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
}

/* Tab Active State */
.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

/* Custom Scrollbar - Dark */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Upload Area - Dark */
#upload-area:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

/* Question Card Animations */
.question-card {
    animation: fadeIn 0.3s ease-in;
}

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

/* Badge Styles - Dark Theme */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-subject {
    background: #667eea;
    color: white;
}

.badge-chapter {
    background: #475569;
    color: white;
}

.badge-difficulty-Easy {
    background: #10b981;
    color: white;
}

.badge-difficulty-Medium {
    background: #f59e0b;
    color: white;
}

.badge-difficulty-Hard {
    background: #ef4444;
    color: white;
}

.badge-important {
    background: #ff6b6b;
    color: white;
}

.badge-repeated {
    background: #4ecdc4;
    color: white;
}

.badge-year {
    background: #8b5cf6;
    color: white;
}

.badge-type-text {
    background: #3b82f6;
    color: white;
}

.badge-type-image {
    background: #ec4899;
    color: white;
}

/* Option Cards in Display - Dark */
.option-card {
    padding: 1rem;
    border: 2px solid #334155;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
}

.option-card:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.option-card.selected {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.2);
}

.option-card.correct {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.2);
    animation: correctPulse 0.5s ease-in-out;
}

.option-card.wrong {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.2);
    animation: wrongShake 0.5s ease-in-out;
}

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

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

/* Loading Spinner - Dark */
.spinner {
    border: 4px solid rgba(100, 116, 139, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Messages - Dark */
.status-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

.status-processing {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid #f59e0b;
}

.status-error {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
}

.status-warning {
    background-color: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid #eab308;
}

.status-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

/* Detection Status Box */
.detection-math {
    background-color: rgba(236, 72, 153, 0.2);
    border: 2px solid #ec4899;
    color: #f9a8d4;
}

.detection-text {
    background-color: rgba(59, 130, 246, 0.2);
    border: 2px solid #3b82f6;
    color: #93c5fd;
}

/* Image Preview Zoom - Dark */
#image-preview {
    transition: transform 0.3s ease;
    background: #000;
}

#image-preview:hover {
    transform: scale(1.02);
}

/* Question Display Card - Dark */
.question-display-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Answer Reveal Button */
.reveal-answer-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.reveal-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.reveal-answer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Empty State - Dark */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-state svg {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

/* Written Answer Display */
.written-answer-display {
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1rem;
}

.written-answer-display.revealed {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .stat-card {
        font-size: 0.875rem;
        padding: 1rem;
    }

    .tab-btn {
        padding: 1rem 0.5rem;
        font-size: 0.875rem;
    }

    .question-display-card {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* Focus Styles for Accessibility - Dark */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Image Question Full Display */
.image-question-full {
    max-width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Complex Math Indicator */
.math-detected-badge {
    animation: glow 2s ease-in-out infinite;
}



@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(236, 72, 153, 0.5); }
    50% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.8); }
}

/* Toggle Switch - Dark Theme */
input[type="checkbox"]:checked + div {
    background-color: #667eea;
}

/* Selection Highlight - Dark */
::selection {
    background-color: rgba(102, 126, 234, 0.3);
    color: white;
}