/* Main CSS Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Tables */
.table {
    background-color: white;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
}

.table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 6px;
    border: none;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
}

/* Dashboard */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.dashboard-card.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dashboard-card.green {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dashboard-card.orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.dashboard-card.purple {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.dashboard-card h3 {
    font-size: 2rem;
    font-weight: bold;
}

.dashboard-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Exam Interface */
.exam-question {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    /* Anti-copy protection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.exam-question.active {
    border-left-color: var(--success-color);
    background-color: #f0f8ff;
}

.exam-question h5 {
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.exam-question p {
    /* Prevent text selection on questions */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.exam-question img {
    /* Prevent image dragging and right-click */
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.exam-options {
    margin-left: 20px;
}

.matrix-table th,
.matrix-table td {
    vertical-align: middle;
    padding: 12px 8px !important;
}

.matrix-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    border: 1px solid #dee2e6;
}

.matrix-table tbody td {
    text-align: center;
    border: 1px solid #dee2e6;
}

.matrix-table tbody td input[type="radio"] {
    margin: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.matrix-row-label {
    min-width: 250px;
    text-align: left;
    font-weight: 500;
    background-color: #f8f9fa;
    padding: 12px 15px !important;
    border: 1px solid #dee2e6;
}

.matrix-list .input-group-text {
    background: transparent;
    border: none;
}

.exam-option {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.3s;
    /* Anti-copy protection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.exam-option:hover {
    background-color: #f8f9fa;
}

.exam-option input[type="radio"],
.exam-option input[type="checkbox"] {
    margin-right: 10px;
    /* Allow interaction with input elements */
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

.exam-option label {
    cursor: pointer;
}

/* Timer */
.exam-timer {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--danger-color);
    margin-bottom: 20px;
}

/* Results */
.result-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-score {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
}

.result-percentage {
    font-size: 1.2rem;
    text-align: center;
    color: #666;
}

.progress {
    height: 25px;
    border-radius: 6px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Sidebar Navigation */
.sidebar {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 0;
}

.sidebar .nav-link {
    color: #495057;
    border-left: 3px solid transparent;
    padding: 12px 20px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #e9ecef;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    margin-right: 10px;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Status Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
}

.badge-success {
    background-color: #198754;
}

.badge-warning {
    background-color: #ffc107;
    color: #000;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-info {
    background-color: #0dcaf0;
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-card h3 {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .exam-question {
        padding: 15px;
    }
}

/* Exam Card Styles */
.exam-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.exam-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    border: none;
}

.exam-card-title {
    color: white;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.exam-card .card-body {
    padding: 24px;
}

/* Exam Info Grid */
.exam-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.exam-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.exam-info-item:hover {
    background-color: #e9ecef;
}

.exam-info-item i {
    font-size: 1.5rem;
}

.exam-info-item > div {
    display: flex;
    flex-direction: column;
}

.exam-info-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exam-info-value {
    font-size: 1.1rem;
    color: #212529;
    font-weight: 600;
    margin-top: 2px;
}

.exam-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* Papers Section */
.exam-papers-section {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.papers-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.papers-heading i {
    color: #667eea;
}

.papers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Paper Item */
.paper-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.paper-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.paper-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.paper-name {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
}

.paper-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.badge-published {
    background-color: #d1f4e0;
    color: #0a6e3a;
}

.badge-draft {
    background-color: #fff3cd;
    color: #664d03;
}

.badge-inactive {
    background-color: #e9ecef;
    color: #6c757d;
}

/* Result Badges */
.result-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-passed {
    background-color: #d1f4e0;
    color: #0a6e3a;
}

.badge-failed {
    background-color: #f8d7da;
    color: #842029;
}

.percentage-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    padding: 4px 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

/* Button Refinements */
.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.paper-actions .btn {
    font-size: 0.85rem;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.paper-actions .btn i {
    font-size: 0.9rem;
}

/* Responsive Design for Exam Cards */
@media (max-width: 768px) {
    .exam-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .paper-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .paper-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Bootstrap Icons Fix */
.bi {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

/* Ensure icons are visible in cards */
.card-body .bi {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .no-print {
        display: none !important;
    }

    body {
        background-color: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
