/* style.css */
/* Modern, Premium Glassmorphism Design System for the Interview Portal */

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

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #111126;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-border-focus: rgba(99, 102, 241, 0.4);
    
    --primary-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --accent-grad: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --danger-grad: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --success-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-grad: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-accent: #06b6d4;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow-primary: 0 0 25px rgba(99, 102, 241, 0.3);
    --shadow-glow-accent: 0 0 25px rgba(6, 118, 212, 0.3);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.07) 0%, transparent 40%);
    color: var(--color-text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-accent);
}

/* Glassmorphism Containers */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

/* Layout Shell */
.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    margin-bottom: 2rem;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, var(--color-text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand span {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-grad);
    color: #ffffff;
    box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

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

.btn-secondary {
    background: var(--glass-bg);
    color: #ffffff;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-grad);
    color: #ffffff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Forms styling */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

label {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

input, select, textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

/* Specific view styling */
.view-card {
    max-width: 700px;
    margin: 2rem auto;
    padding: 3rem;
    border-radius: var(--radius-lg);
}

.view-card h2 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    text-align: center;
}

.view-card p.subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
}

/* Domain Selector styling */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.domain-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.domain-card:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.domain-card.selected {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.domain-card h4 {
    color: #ffffff;
    font-size: 1.1rem;
}

.domain-card span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Rules Section */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--color-primary);
}

.rule-item.malpractice {
    border-left-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.03);
}

.rule-item-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.rule-item-text h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.rule-item-text p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 2rem 0;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-container input {
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
}

/* Exam interface layout */
.exam-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    height: calc(100vh - 150px);
    min-height: 550px;
}

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

.exam-sidebar {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    height: 100%;
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.timer-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

.timer-box.warning {
    border-color: var(--color-danger);
    color: var(--color-danger);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
    100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
}

.question-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.2rem;
    max-height: 350px;
}

.q-btn {
    aspect-ratio: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.q-btn:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.q-btn.active {
    background: var(--primary-grad);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.q-btn.answered {
    background: rgba(20, 184, 166, 0.15);
    border-color: var(--color-accent);
    color: #ffffff;
}

.q-btn.unanswered {
    background: rgba(255, 255, 255, 0.02);
}

/* Exam main workspace */
.exam-workspace {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border-radius: var(--radius-md);
    height: 100%;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.workspace-header h3 {
    font-size: 1.3rem;
}

.workspace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.question-text-box {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #ffffff;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
}

/* Options for MCQ */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.option-item.selected {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.option-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    margin-right: 1.2rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.option-item.selected .option-badge {
    background: var(--primary-grad);
}

.option-text {
    font-size: 1rem;
}

/* Text area for theory and coding */
.text-answer-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.text-answer-box textarea {
    flex: 1;
    min-height: 220px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
}

/* Workspace footer controls */
.workspace-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 15, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    padding: 2.5rem;
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--color-danger);
}

.modal-content p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* Result panel styling */
.result-stats-card {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
}

.result-badge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.result-badge.pass {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 2px solid var(--color-success);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.result-badge.fail {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 2px solid var(--color-danger);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.score-display {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-display span {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.score-label {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.round-breakdown {
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.round-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.round-row span.score {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
}

/* ========================================== */
/* ADMIN DASHBOARD SPECIFIC STYLES            */
/* ========================================== */
.admin-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

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

/* Admin Dashboard Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-card h4 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
}

/* Admin Layout Panel Split */
.admin-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

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

.admin-panel {
    padding: 2rem;
    border-radius: var(--radius-lg);
}

/* Custom Styled Tables */
.table-responsive {
    overflow-x: auto;
    max-height: 600px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th, td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.01);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Status Tags */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-tag.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-tag.testing {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.status-tag.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-tag.disqualified {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
    animation: flash-border 1.5s infinite;
}

@keyframes flash-border {
    0%, 100% { border-color: rgba(245, 158, 11, 0.2); }
    50% { border-color: rgba(245, 158, 11, 0.8); }
}

.malpractice-count {
    font-weight: 700;
    font-family: var(--font-heading);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.malpractice-count.alert {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Question Manager CSS */
.q-manager-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.q-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.q-card:hover {
    border-color: rgba(255,255,255,0.12);
}

.q-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.q-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.q-card-actions {
    display: flex;
    gap: 0.8rem;
}

.q-card-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.q-card-detail {
    font-size: 0.85rem;
    background: rgba(0,0,0,0.15);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    word-break: break-all;
}

.q-card-detail strong {
    color: #ffffff;
}

/* Modals for admin questions */
.admin-modal-content {
    max-width: 750px;
    width: 95%;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    overflow-y: auto;
    max-height: 90vh;
}

.admin-modal-content h3 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.8rem;
}

/* Tabs for Admin panels */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.8rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #ffffff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.9rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-grad);
    border-radius: 2px;
}

.admin-view-panel {
    display: none;
}

.admin-view-panel.active {
    display: block;
}

/* ========================================== */
/* RESPONSIVE MOBILE VIEW OVERRIDES           */
/* ========================================== */

@media (max-width: 900px) {
    .exam-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        gap: 1.5rem;
    }
    .exam-sidebar {
        height: auto;
        padding: 1.25rem;
    }
    .question-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
        max-height: 200px;
    }
    .exam-workspace {
        height: auto;
        padding: 1.25rem;
    }
    .workspace-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .navbar {
        padding: 1rem 1.25rem;
        margin-bottom: 1.25rem;
    }

    .brand {
        font-size: 1.3rem;
    }

    .view-card {
        padding: 1.5rem;
        margin: 1rem auto;
        border-radius: var(--radius-md);
    }

    .view-card h2 {
        font-size: 1.6rem;
    }

    .view-card p.subtitle {
        margin-bottom: 1.5rem;
    }

    .admin-container {
        padding: 1rem;
    }

    .admin-panel {
        padding: 1.25rem;
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-nav {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        align-items: center;
    }

    .admin-nav .btn {
        width: 100%;
    }

    .admin-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
    }

    .tab-btn {
        font-size: 0.95rem;
        padding: 0.4rem 0.6rem;
        flex: 1 1 auto;
        text-align: center;
    }

    .tab-btn.active::after {
        bottom: -0.6rem;
    }

    .q-manager-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .q-manager-controls div {
        flex-direction: column;
        width: 100%;
    }

    #questions-count-meta {
        align-self: flex-start;
    }

    .admin-modal-content, .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .rules-list {
        margin: 1.5rem 0;
    }
}

@media (max-width: 580px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.6rem;
    }
}

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

    .option-item {
        padding: 0.8rem 1rem;
    }

    .option-badge {
        margin-right: 0.8rem;
    }

    .workspace-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .workspace-footer div {
        display: flex;
        justify-content: space-between;
    }

    .workspace-footer .btn {
        flex: 1;
        margin: 0;
    }

    #btn-submit-test {
        margin-left: 0.5rem !important;
    }

    .q-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .q-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .table-responsive {
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .score-display {
        font-size: 3rem;
    }
}

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