@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    background: #f1f3f5;
    color: #2c3e50;
}

/* Remove any default layout styles */
.page, .sidebar {
    display: none !important;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Button improvements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* Primary button improvements */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    border-color: #5a6fd8 !important;
    color: #ffffff !important;
}

/* Success button improvements */
.btn-success {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

/* Warning button improvements */
.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

/* Danger button improvements */
.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

/* Info button improvements */
.btn-info {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Outline button improvements */
.btn-outline-primary {
    border-color: #667eea !important;
    color: #667eea !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: #667eea !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

.btn-outline-success {
    border-color: #10b981;
    color: #10b981;
    background: transparent;
}

.btn-outline-success:hover {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.btn-outline-warning {
    border-color: #f59e0b;
    color: #f59e0b;
    background: transparent;
}

.btn-outline-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.btn-outline-danger {
    border-color: #ef4444;
    color: #ef4444;
    background: transparent;
}

.btn-outline-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.btn-outline-info {
    border-color: #3b82f6;
    color: #3b82f6;
    background: transparent;
}

.btn-outline-info:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.btn-outline-secondary {
    border-color: #6b7280;
    color: #6b7280;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    border-color: #6b7280;
    color: #ffffff;
}

/* Card improvements */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: #ffffff;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e0;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    color: #2d3748;
}

/* Form improvements */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alert improvements */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Badge improvements */
.badge {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    line-height: 1;
}

.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

.bg-success {
    background: #10b981 !important;
    color: #ffffff !important;
}

.bg-warning {
    background: #f59e0b !important;
    color: #ffffff !important;
}

.bg-danger {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.bg-info {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

.bg-secondary {
    background: #6b7280 !important;
    color: #ffffff !important;
}

/* Text color improvements */
.text-primary {
    color: #667eea !important;
}

.text-success {
    color: #059669 !important;
}

.text-warning {
    color: #d97706 !important;
}

.text-danger {
    color: #dc2626 !important;
}

.text-info {
    color: #2563eb !important;
}

.text-muted {
    color: #6b7280 !important;
}

/* Loading spinner */
.spinner-border {
    color: #667eea;
}

/* Utility classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Statistics cards with improved contrast */
.card.text-white {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card.text-white .card-body {
    position: relative;
    z-index: 2;
}

.card.text-white h4,
.card.text-white p {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.card.text-white i {
    opacity: 0.8;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Specific background improvements for better contrast */
.card.text-white.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card.text-white.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.card.text-white.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.card.text-white.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.card.text-white.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* Improved table styling */
.table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #2d3748;
    font-weight: 600;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Form improvements */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background-color: #ffffff;
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    color: #2d3748;
    font-weight: 600;
}

.modal-body {
    background: #ffffff;
    color: #4a5568;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

h1:focus {
    outline: none;
}

/* Additional contrast improvements for specific components */

/* Improved contrast for stat items in exam management */
.stat-item {
    padding: 0.75rem;
    border-radius: 8px;
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: #f8fafc !important;
    border-color: #cbd5e0;
}

.stat-item i {
    margin-bottom: 0.5rem;
    display: block;
}

.stat-item i.text-primary {
    color: #667eea !important;
}

.stat-item i.text-info {
    color: #3b82f6 !important;
}

.stat-item i.text-warning {
    color: #f59e0b !important;
}

.stat-item i.text-success {
    color: #10b981 !important;
}

/* Assignment card improvements */
.assignment-overdue {
    border-left: 4px solid #ef4444 !important;
    background: #fef2f2;
}

.assignment-due-soon {
    border-left: 4px solid #f59e0b !important;
    background: #fffbeb;
}

.assignment-completed {
    border-left: 4px solid #10b981 !important;
    background: #f0fdf4;
}

/* Improved contrast for small text and details */
.exam-details,
.assignment-info {
    background: #f8fafc;
    border-radius: 6px;
    padding: 1rem;
    margin: 0.75rem 0;
    border: 1px solid #e2e8f0;
}

.exam-details .row > div,
.assignment-info .row > div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Better visibility for dropdown menus */
.dropdown-menu {
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.dropdown-item {
    color: #2d3748;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f7fafc;
    color: #2d3748;
}

/* Improved navigation breadcrumbs */
.breadcrumb {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #6b7280;
}

/* Enhanced search and filter components */
.input-group .input-group-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

/* Better visibility for loading states */
.spinner-border {
    color: #667eea;
}

.text-center .spinner-border {
    margin: 2rem auto;
}

/* Improved contrast for card footers */
.card-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Enhanced button groups */
.btn-group .btn {
    border-color: #e2e8f0;
}

.btn-group .btn:not(:last-child) {
    border-right-color: #e2e8f0;
}

/* Better visibility for navigation tabs */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
}

.nav-tabs .nav-link {
    color: #4a5568;
    border: none;
    background: #f8fafc;
    margin-right: 0.25rem;
    border-radius: 6px 6px 0 0;
}

.nav-tabs .nav-link.active {
    color: #667eea;
    background: #ffffff;
    border-bottom: 2px solid #667eea;
}

/* Improved pagination */
.pagination .page-link {
    color: #667eea;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

.pagination .page-link:hover {
    color: #5a6fd8;
    background-color: #f8fafc;
    border-color: #cbd5e0;
}

.pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

a, .btn-link {
    color: #0071c1;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHZpZXdCb3g9IjAgMCA1NiA0OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjUgNi41TDIwLjUgMTIuNUwyNi41IDYuNUw3MJYOTYVMj4gODT0IjVMmN5PzFIIiBzdHJva2U9IiNEQjJEMzQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Exam specific styles */
.exam-timer {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    font-weight: bold;
}

.question-card {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.answer-option {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    cursor: pointer;
}

.answer-option:hover {
    background-color: #f8f9fa;
}

.answer-option.selected {
    background-color: #e3f2fd;
    border-color: #1976d2;
}

.exam-navigation {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.question-status {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin: 5px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
}

.question-status.answered {
    background-color: #28a745;
    color: white;
}

.question-status.marked {
    background-color: #ffc107;
    color: black;
}

.question-status.current {
    background-color: #007bff;
    color: white;
}

.question-status.unanswered {
    background-color: #e9ecef;
    color: #6c757d;
}