/* Custom styles for Exam System */

:root {
    /* Blue Color Palette */
    --primary-color: #1e3a8a; /* Navy blue */
    --primary-light: #2563eb; /* Medium blue */
    --primary-dark: #1e3a8a;
    --primary-text: #ffffff;
    --primary-hover: #3b82f6;
    --primary-transparent: rgba(30, 58, 138, 0.1);
    
    /* Additional palette colors */
    --cream-bg: #f0f4f8; /* Light blue background */
    --rust-accent: #2563eb; /* Medium blue */
    --peach-light: #dbeafe; /* Light blue */
    --blue-gray: #60a5fa; /* Bright blue */

    /* Bootstrap theme color overrides */
    --bs-primary: #1e3a8a;
    --bs-primary-rgb: 30, 58, 138;
    --bs-primary-text: #1e3a8a;
    --bs-primary-bg-subtle: rgba(30, 58, 138, 0.1);
    --bs-primary-border-subtle: #2563eb;
    --bs-link-color: #1e3a8a;
    --bs-link-hover-color: #2563eb;
    --bs-nav-link-color: #1e3a8a;
    --bs-nav-link-hover-color: #2563eb;
    --bs-nav-pills-link-active-bg: #1e3a8a;
    --bs-nav-pills-link-active-color: #ffffff;
}

/* Additional Bootstrap component overrides */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    color: var(--primary-text);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--primary-text);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Body styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--cream-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
    background-attachment: fixed;
    background-blend-mode: overlay;
}

/* Main content */
main {
    flex: 1 0 auto;
    margin-bottom: 10rem;  /* Add space before footer */
}

/* Footer styles */
.footer {
    margin-top: auto;
    padding: 1rem 0;
    background-color: var(--peach-light); /* Light peach */
    border-top: 1px solid var(--blue-gray); /* Light blue-gray */
    color: var(--primary-color); /* Very dark blue */
}

.footer a {
    color: var(--rust-accent) !important; /* Dark brown/rust */
    opacity: 0.9;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer a:hover {
    opacity: 1;
    color: var(--primary-color) !important; /* Very dark blue */
}

.footer h5 {
    color: var(--primary-color); /* Very dark blue */
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer .social-links a {
    font-size: 1.25rem;
    margin-right: 1rem;
    color: var(--rust-accent) !important; /* Dark brown/rust */
}

.footer .social-links a:hover {
    color: var(--primary-color) !important; /* Very dark blue */
}

/* Card styles */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    transition: transform 0.2s ease-in-out;
}

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

/* Form styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem var(--primary-transparent);
}

/* Button styles */
.btn {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--primary-text);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Alert styles */
.alert {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
    border-left: 5px solid;
    padding-right: 4rem;
}

.alert:not(.alert-dismissible) {
    padding-right: 1.25rem;
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.alert-success {
    border-left-color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.alert-info {
    border-left-color: #0dcaf0;
    background-color: rgba(13, 202, 240, 0.1);
}

.alert-warning {
    border-left-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.alert-dismissible {
    position: relative;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1.25rem;
    opacity: 0.8;
    cursor: pointer;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
}

.alert h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
}

.alert ul {
    margin-bottom: 0;
}

.alert.fade {
    transition: opacity 0.15s linear;
}

.alert.fade.show {
    opacity: 1;
}

/* Navigation styles */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color) !important;
}

.navbar.bg-light {
    background-color: var(--primary-color) !important;
}

.navbar-light .navbar-brand,
.navbar-light .navbar-nav .nav-link {
    color: var(--primary-text) !important;
    position: relative;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-text) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--primary-text) !important;
    opacity: 0.9;
}

.nav-link:hover,
.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-text) !important;
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Active nav item styles */
.nav-link.active,
.navbar-light .navbar-nav .nav-link.active,
.nav-item.active > .nav-link {
    background-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.nav-link.active::after,
.navbar-light .navbar-nav .nav-link.active::after,
.nav-item.active > .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background-color: var(--primary-text);
    border-radius: 2px;
}

/* Dropdown styles in navbar */
.navbar .dropdown-menu {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-light);
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.navbar .dropdown-item {
    color: var(--primary-text);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus,
.navbar .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-text);
}

/* Custom form validation styles */
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Custom animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.slide-in {
    animation: slideInRight 0.5s ease-out forwards;
}

/* Card animations */
.card {
    animation: fadeIn 0.5s ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Button animations */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.btn:active {
    transform: translateY(1px);
}

.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: all 0.5s ease;
}

.btn-primary:hover:before {
    left: 100%;
}

/* Nav link animations */
.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Alert animations */
.alert {
    animation: slideInRight 0.5s ease-out;
}

/* Footer link animations */
.footer .social-links a {
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    transform: translateY(-3px) scale(1.2);
}

/* Table row hover animation */
.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Card loading animation */
.card.loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Floating animation for specific elements */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Pulse animation for notifications or important elements */
.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Add smooth transitions to all interactive elements */
a, button, input, select, textarea {
    transition: all 0.3s ease;
}

/* Dropdown menu animations */
.dropdown-menu {
    animation: fadeIn 0.2s ease-out;
    transform-origin: top;
}

.dropdown-item {
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    transform: translateX(5px);
}

/* Tab content animations */
.tab-pane {
    animation: fadeIn 0.3s ease-out;
}

/* Form focus animations */
.form-control:focus {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Modern UI Enhancements */
.modern-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.modern-card .card-header {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

.gradient-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
}

.gradient-success {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%) !important;
}

.gradient-info {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%) !important;
}

.gradient-warning {
    background: linear-gradient(135deg, #3b82f6 0%, #93c5fd 100%) !important;
}

.stats-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-card p {
    margin-bottom: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.stats-card i {
    opacity: 0.8;
}

/* Enhanced Button Styles */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-lg i.d-block {
    margin-bottom: 0.5rem;
}

/* Enhanced List Groups */
.list-group-item {
    border: none;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
}

.list-group-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: white;
}

.list-group-item.list-group-item-action:hover {
    background: white;
    border-color: transparent;
}

/* Enhanced Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem;
    font-weight: 600;
}

.card-header h6 {
    margin-bottom: 0;
    font-weight: 600;
    color: #495057;
}

.card-body {
    padding: 1.5rem;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-content {
    padding-left: 15px;
}

.timeline-content h6 {
    color: #495057;
    font-weight: 600;
}

/* Enhanced Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.badge.fs-6 {
    font-size: 0.875rem !important;
    padding: 0.6rem 1rem;
}

/* Enhanced Alerts */
.alert {
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    border-left: 4px solid #198754;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%);
    border-left: 4px solid #0dcaf0;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-left: 4px solid #ffc107;
}

/* Enhanced Input Fields */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
}

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

/* Custom utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Glass morphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 15px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .stats-card h3 {
        font-size: 1.8rem;
    }
    
    .modern-card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-marker {
        left: -20px;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Loading animations */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Enhanced hover effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Improved text shadows */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Enhanced borders */
.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box, 
                linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
    border-radius: 15px;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* Dropdown styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item:active {
    background-color: var(--primary-color);
}

/* Card header styles */
.card-header {
    background-color: var(--primary-transparent);
    border-bottom: 1px solid var(--primary-light);
}

/* Table styles */
.table > thead {
    background-color: var(--primary-transparent);
}

.table > tbody > tr:hover {
    background-color: var(--primary-transparent);
}

/* Tab styles */
.nav-tabs .nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    border: none;
    padding: 0.75rem 1.25rem;
    margin-right: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-hover) !important;
    border: none;
    border-bottom: 2px solid var(--primary-light);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--primary-color);
    background-color: transparent;
}

.nav-tabs {
    border-bottom: 1px solid var(--primary-transparent);
}

.tab-content {
    padding-top: 1.5rem;
}

/* Card header tabs */
.card-header .nav-tabs {
    border-bottom: none;
    margin-bottom: -1rem;
}

.card-header .nav-tabs .nav-link {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
}

.card-header .nav-tabs .nav-link.active {
    background-color: #fff;
    border-bottom-color: #fff;
}

/* Content Header Styles */
.content-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.content-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.content-header .container {
    position: relative;
    z-index: 2;
}

.content-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.content-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.content-header .breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    margin-bottom: 0;
}

.content-header .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(255, 255, 255, 0.7);
}

.content-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.content-header .breadcrumb-item a:hover {
    color: white;
}

.content-header .breadcrumb-item.active {
    color: white;
}

/* Responsive adjustments for content header */
@media (max-width: 768px) {
    .content-header h1 {
        font-size: 2rem;
    }
    
    .content-header p {
        font-size: 1rem;
    }
    
    .content-header .breadcrumb {
        margin-top: 1rem;
    }
}