@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8fafc; /* Soft white/slate background */
    --bg-secondary: #ffffff; /* Clean white card backgrounds */
    --accent: #ff6b00; /* Avinash College of Commerce Brand Orange */
    --accent-glow: rgba(255, 107, 0, 0.08);
    --accent-hover: #e05e00;
    --text-primary: #0f172a; /* Slate black text for high readability */
    --text-secondary: #475569; /* Slate grey secondary text */
    --text-muted: #94a3b8;
    --border-color: #e2e8f0; /* Subtle light borders */
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 0 0 1px rgba(0, 0, 0, 0.02);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 107, 0, 0.05) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 40%);
    color: var(--text-primary);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-badge {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.user-badge .indicator {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success);
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
}

.auth-container {
    max-width: 450px;
    width: 100%;
    margin: auto;
    text-align: center;
    padding: 3rem 2rem;
}

.auth-container h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-container p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.875rem 2rem;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e2e8f0;
    box-shadow: none;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Course cards grid view */
.courses-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.course-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.course-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.course-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.course-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Student dashboard grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.student-info-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    min-width: 120px;
}

.info-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quiz-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 107, 0, 0.03);
    border: 1px solid rgba(255, 107, 0, 0.08);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.locked {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Exam interface */
.exam-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

@media (max-width: 992px) {
    .exam-layout {
        grid-template-columns: 1fr;
    }
}

.question-area {
    display: flex;
    flex-direction: column;
}

.question-card {
    display: flex;
    flex-direction: column;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 1.125rem 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.option-item.selected {
    background: rgba(255, 107, 0, 0.05);
    border-color: var(--accent);
}

.option-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.option-item.selected .option-badge {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.navigation-bar {
    display: flex;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Sidebar navigator */
.sidebar-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow);
}

.timer-box {
    text-align: center;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

.timer-box.warning {
    background: rgba(239, 68, 68, 0.1);
    animation: pulse 1s infinite alternate;
}

.timer-box .timer-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.timer-box .timer-clock {
    font-size: 2.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--danger);
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.grid-btn {
    aspect-ratio: 1;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.grid-btn:hover {
    background: #f1f5f9;
}

.grid-btn.not-answered {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.grid-btn.answered {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.grid-btn.marked {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #5b21b6;
}

.grid-btn.answered-marked {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #3730a3;
    position: relative;
}

.grid-btn.answered-marked::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    font-weight: bold;
    color: #3730a3;
}

.grid-btn.current {
    outline: 2px solid var(--text-primary);
    outline-offset: 1px;
}

/* Results feedback */
.results-header {
    text-align: center;
    padding: 2rem 0;
}

.results-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
}

.results-badge.passed {
    background: var(--success-bg);
    color: var(--success);
}

.results-badge.failed {
    background: var(--danger-bg);
    color: var(--danger);
}

.results-score-display {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.review-section {
    margin-top: 3rem;
}

.review-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-item.correct {
    border-left: 4px solid var(--success);
}

.review-item.incorrect {
    border-left: 4px solid var(--danger);
}

.explanation-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Admin panel layouts */
.admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .admin-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .admin-metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
}

.metric-card .title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

.admin-columns {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .admin-columns {
        grid-template-columns: 1fr;
    }
}

/* CSV Upload Zones */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.upload-dropzone:hover {
    border-color: var(--accent);
    background: rgba(255, 107, 0, 0.02);
}

.upload-dropzone p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.upload-dropzone input {
    display: none;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:hover td {
    background: #f8fafc;
}

.badge-passed {
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-failed {
    padding: 0.25rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Tab styling for admin console views */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.admin-tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
}

@keyframes pulse {
    from {
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.1);
    }
    to {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
    }
}


@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Mobile & Tablet Responsiveness Enhancements */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        text-align: center;
    }
    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    .logo-text {
        text-align: center;
    }
    main {
        padding: 1rem;
    }
    .card {
        padding: 1.25rem 1rem;
    }
    .quiz-status-card {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    .student-info-row {
        flex-direction: column;
        gap: 1rem;
    }
    .student-info-row .info-item {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .admin-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .admin-tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
}

