:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: var(--primary);
    font-size: 2rem;
}

/* Dashboard */
.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
}

/* Sidebar and Layout Fixes */
.sidebar {
    position: fixed;
    top: 56px; /* Header height */
    left: 0;
    bottom: 0;
    z-index: 100;
    padding: 20px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    width: 280px;
    overflow-y: auto;
    background: #f8f9fa;
}

.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: calc(100vh - 56px);
    width: calc(100% - 280px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        width: 100%;
        height: auto;
        top: 56px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    
    .sidebar.collapse {
        display: none;
    }
    
    .sidebar.collapse.show {
        display: block;
    }
}

/* Assessment Container Fix */
.assessment-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 100px);
    margin-bottom: 20px;
}

/* Question Card Styling */
.question-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background: white;
}

.question-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

.question-body {
    padding: 1.5rem;
}

/* Options Styling */
.options-list {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.form-check {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.form-check:last-child {
    border-bottom: none;
}

.form-check-input {
    margin-top: 0.3rem;
}

.form-check-label {
    margin-left: 0.5rem;
}

/* Code Editor Styling */
.code-editor {
    font-family: 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 200px;
    width: 100%;
    padding: 10px;
    resize: vertical;
}

.output-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

/* Timer and Header Fix */
.timer-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1000;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}


/* Cards */
.dashboard-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 2rem;
    opacity: 0.7;
}

/* Assessment Interface */
.assessment-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 80vh;
}

.question-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background: white;
}

.question-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

.question-body {
    padding: 1.5rem;
}

.timer-container {
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

/* Navigation */
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--secondary);
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
}

.btn-primary:hover {
    background: #0b5ed7;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary);
    background: #f8f9fa;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .auth-card {
        margin: 1rem;
    }
}

/* Code Editor */
.code-editor {
    font-family: 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 200px;
}

/* Proctoring warnings */
.proctoring-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--danger);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: shake 0.5s;
}

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

/* ===== COMPACT UI - SMALLER CARDS ===== */
.card {
    margin-bottom: 1rem !important;
}

.card-body {
    padding: 0.75rem 1rem !important;
}

.card-header {
    padding: 0.5rem 1rem !important;
    font-size: 0.95rem;
}

/* Compact stat cards */
.dashboard-card .card-body,
.stat-card .card-body {
    padding: 0.75rem !important;
}

.dashboard-card h4,
.stat-card h4 {
    font-size: 1.5rem !important;
    margin-bottom: 0.25rem !important;
}

.dashboard-card .text-uppercase,
.stat-card .text-uppercase {
    font-size: 0.7rem !important;
}

/* Compact table cells */
.table td,
.table th {
    padding: 0.5rem !important;
    font-size: 0.9rem;
}

/* Compact list items */
.list-group-item {
    padding: 0.5rem 0.75rem !important;
}

/* Compact alerts */
.alert {
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.75rem !important;
}

/* ===== ACTION ICONS - CONSISTENT DESIGN ===== */
/* All action button icons - consistent size and alignment */
.btn i.bi,
.btn-group .btn i.bi,
.btn-group-sm .btn i.bi,
td .btn i.bi,
.action-btn i.bi {
    font-size: 1rem !important;
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
    margin: 0;
}

/* Make action buttons uniform size and spacing */
.btn-group .btn,
.btn-group-sm .btn,
td .btn-sm,
.action-btn {
    padding: 0.375rem 0.75rem !important;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* Consistent button colors */
.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover {
    background-color: #198754;
    color: white;
}

/* Icon-only buttons - perfect square */
.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== COMPACT FORMS ===== */
.form-control,
.form-select {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem;
}

.form-label {
    margin-bottom: 0.25rem !important;
    font-size: 0.9rem;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* ===== COMPACT MODALS ===== */
.modal-header {
    padding: 0.75rem 1rem !important;
}

.modal-body {
    padding: 1rem !important;
}

.modal-footer {
    padding: 0.75rem 1rem !important;
}

/* ===== RESPONSIVE SPACING ===== */
.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.px-3 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

/* ===== COMPACT BADGES ===== */
.badge {
    padding: 0.35em 0.65em !important;
    font-size: 0.75rem !important;
}