/* AUCA Exam Platform - Custom Styles */

/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Code editor styling */
.sql-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

/* Result table styling */
.result-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 0.875rem;
}

.result-table th,
.result-table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
    white-space: nowrap;
}

.result-table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.result-table tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Ensure console output scrolls horizontally for wide tables */
#console-output {
    overflow-x: auto;
    overflow-y: auto;
}

#console-output .overflow-x-auto {
    overflow-x: auto;
    max-width: 100%;
}

/* Status badges */
.badge-pass {
    background-color: #d1fae5;
    color: #065f46;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
}

.badge-fail {
    background-color: #dc2626;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-error {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Timer warning states */
.timer-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.timer-danger {
    background-color: #fee2e2;
    color: #991b1b;
    animation: pulse 1s infinite;
}

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

/* Print styles for access codes */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        margin: 0;
        padding: 10mm;
    }
    
    .code-grid {
        page-break-inside: avoid;
    }
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions */
.transition-smooth {
    transition: all 0.2s ease-in-out;
}

/* Focus states */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
}

/* Question navigation active state */
.question-nav-active {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

/* Console output styling */
.console-output {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Scrollbar styling for console */
.console-output::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.console-output::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.console-output::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.console-output::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* =====================================================
   QUESTION CONTENT STYLING
   Light theme (student view) and Dark theme (admin preview)
   ===================================================== */

/* Base question prompt styling */
.question-prompt {
    line-height: 1.7;
    font-size: 0.95rem;
}

.question-prompt p {
    margin-bottom: 0.75rem;
}

.question-prompt h4 {
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.question-prompt code {
    background-color: #dbeafe;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85em;
    color: #1e40af;
    font-weight: 500;
}

.question-prompt ul,
.question-prompt ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.question-prompt ul {
    list-style-type: disc;
}

.question-prompt ol {
    list-style-type: decimal;
}

.question-prompt li {
    margin-bottom: 0.25rem;
}

/* Spec table - for column specifications (LIGHT THEME) */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
}

.spec-table th,
.spec-table td {
    padding: 0.625rem 1rem;
    text-align: left;
    border: 1px solid #d1d5db;
}

.spec-table th {
    background-color: #e5e7eb;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.spec-table td {
    background-color: #ffffff;
    color: #374151;
}

.spec-table td code {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* Data table - for showing sample data (LIGHT THEME) */
.data-table {
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    text-align: left;
}

.data-table th {
    background-color: #e5e7eb;
    font-weight: 700;
    color: #111827;
    font-size: 0.8rem;
}

.data-table td {
    background-color: #ffffff;
    color: #374151;
}

.data-table tr:nth-child(even) td {
    background-color: #f9fafb;
}

/* Output spec table - for expected output format (LIGHT THEME) */
.output-spec {
    margin: 0.75rem 0;
    font-size: 0.85rem;
    border: 2px dashed #9ca3af;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background-color: #f3f4f6;
}

.output-spec th {
    text-align: right;
    padding-right: 0.75rem;
    color: #4b5563;
    font-weight: 600;
    vertical-align: top;
    width: 100px;
}

.output-spec td {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    color: #1f2937;
}

/* =====================================================
   QUESTION CONTENT STYLING - LIGHT THEME (Default)
   Used in student exam view and admin question view modal
   ===================================================== */

.question-content {
    line-height: 1.7;
    font-size: 0.95rem;
    color: #1f2937;
}

.question-content p {
    margin-bottom: 0.75rem;
    color: #374151;
}

.question-content strong {
    color: #111827;
    font-weight: 600;
}

.question-content h4 {
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.question-content code {
    background-color: #1e3a5f;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85em;
    color: #f8fafc;
    font-weight: 500;
}

.question-content ul,
.question-content ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: #374151;
}

.question-content ul {
    list-style-type: disc;
}

.question-content ol {
    list-style-type: decimal;
}

.question-content li {
    margin-bottom: 0.25rem;
}

/* Light theme tables in question content */
.question-content .spec-table,
.question-content .data-table {
    border: 2px solid #d1d5db;
}

.question-content .spec-table th,
.question-content .data-table th {
    background-color: #e5e7eb;
    color: #111827;
    font-weight: 700;
    border-color: #d1d5db;
}

.question-content .spec-table td,
.question-content .data-table td {
    background-color: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.question-content .spec-table td code {
    background-color: #fef3c7;
    color: #92400e;
}

.question-content .data-table tr:nth-child(even) td {
    background-color: #f9fafb;
}

.question-content .output-spec {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.question-content .output-spec th {
    color: #4b5563;
}

.question-content .output-spec td {
    color: #1f2937;
}

/* =====================================================
   DARK THEME - .question-content-dark class
   For admin preview on dark backgrounds
   ===================================================== */

.question-content-dark,
.bg-gray-700 .question-content,
.bg-gray-800 .question-content {
    color: #f3f4f6;
}

.question-content-dark p,
.bg-gray-700 .question-content p,
.bg-gray-800 .question-content p {
    color: #e5e7eb;
}

.question-content-dark strong,
.bg-gray-700 .question-content strong,
.bg-gray-800 .question-content strong {
    color: #ffffff;
}

.question-content-dark h4,
.bg-gray-700 .question-content h4,
.bg-gray-800 .question-content h4 {
    color: #f9fafb;
}

.question-content-dark code,
.bg-gray-700 .question-content code,
.bg-gray-800 .question-content code {
    background-color: #4b5563;
    color: #f472b6;
}

.question-content-dark ul,
.question-content-dark ol,
.bg-gray-700 .question-content ul,
.bg-gray-700 .question-content ol,
.bg-gray-800 .question-content ul,
.bg-gray-800 .question-content ol {
    color: #e5e7eb;
}

/* Dark theme tables */
.question-content-dark .spec-table,
.question-content-dark .data-table,
.bg-gray-700 .question-content .spec-table,
.bg-gray-700 .question-content .data-table,
.bg-gray-800 .question-content .spec-table,
.bg-gray-800 .question-content .data-table {
    border-color: #6b7280;
}

.question-content-dark .spec-table th,
.question-content-dark .data-table th,
.bg-gray-700 .question-content .spec-table th,
.bg-gray-700 .question-content .data-table th,
.bg-gray-800 .question-content .spec-table th,
.bg-gray-800 .question-content .data-table th {
    background-color: #374151;
    color: #f9fafb;
    border-color: #6b7280;
}

.question-content-dark .spec-table td,
.question-content-dark .data-table td,
.bg-gray-700 .question-content .spec-table td,
.bg-gray-700 .question-content .data-table td,
.bg-gray-800 .question-content .spec-table td,
.bg-gray-800 .question-content .data-table td {
    background-color: #4b5563;
    color: #f3f4f6;
    border-color: #6b7280;
}

.question-content-dark .spec-table td code,
.bg-gray-700 .question-content .spec-table td code,
.bg-gray-800 .question-content .spec-table td code {
    background-color: #1f2937;
    color: #fbbf24;
}

.question-content-dark .data-table tr:nth-child(even) td,
.bg-gray-700 .question-content .data-table tr:nth-child(even) td,
.bg-gray-800 .question-content .data-table tr:nth-child(even) td {
    background-color: #374151;
}

.question-content-dark .output-spec,
.bg-gray-700 .question-content .output-spec,
.bg-gray-800 .question-content .output-spec {
    background-color: #374151;
    border-color: #6b7280;
}

.question-content-dark .output-spec th,
.bg-gray-700 .question-content .output-spec th,
.bg-gray-800 .question-content .output-spec th {
    color: #d1d5db;
}

.question-content-dark .output-spec td,
.bg-gray-700 .question-content .output-spec td,
.bg-gray-800 .question-content .output-spec td {
    color: #f3f4f6;
}

