/**
 * Exams List Page - Beautiful and Attractive Styling
 * Modern design with gradients, animations, and hover effects
 */

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa; /* Light gray background instead of purple */
    min-height: 100vh;
    color: #333;
}

/* Header Section */
.exam-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.5rem 0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06); /* Lighter shadow */
    position: relative;
    overflow: hidden;
}

.exam-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745, #17a2b8, #6f42c1);
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #007bff, #28a745);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
}

.user-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #2c3e50;
}

.user-status .btn {
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.user-status .btn:hover {
    transform: translateY(-1px);
}

/* Main Content */
.exam-main {
    padding: 1rem; /* 16px - balanced spacing */
    min-height: 70vh;
    max-width: 100%; /* Full width */
}

/* Search Section */
.search-section {
    background: #ffffff; /* Pure white background */
    padding: 1rem; /* 16px - comfortable but compact */
    border-radius: 12px; /* Slightly more rounded */
    box-shadow: 0 1px 6px rgba(0,0,0,0.05); /* Much lighter shadow */
    margin-bottom: 1rem; /* 16px - good separation */
    border: 1px solid #e9ecef;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff;
    font-size: 1rem;
}

.search-box .form-control {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-box .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.3rem rgba(0, 123, 255, 0.15);
    background: white;
    transform: translateY(-1px); /* Smoother focus effect */
}

#examTypeFilter {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#examTypeFilter:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.3rem rgba(0, 123, 255, 0.15);
    background: white;
}

/* Exams Container */
.exams-container {
    position: relative;
    max-width: 100%; /* Full width */
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 12px; /* More rounded */
    box-shadow: 0 1px 6px rgba(0,0,0,0.05); /* Lighter shadow */
}

.loading-state .spinner-border {
    width: 2rem;
    height: 2rem;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.loading-state p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 12px; /* More rounded */
    box-shadow: 0 1px 6px rgba(0,0,0,0.05); /* Lighter shadow */
}

.empty-icon {
    font-size: 2.5rem;
    color: #dee2e6;
    margin-bottom: 0.5rem;
}

.empty-state h4 {
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.empty-state p {
    color: #adb5bd;
}

/* Exams List - Updated for 3 columns */
.exams-list {
    display: grid;
    gap: 1rem; /* 16px - cards not too close, not too far */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* 3 exams per row */
    max-width: 100%; /* Full width */
}

.exam-card {
    background: white;
    border-radius: 12px; /* Modern rounded corners */
    padding: 1.25rem; /* 20px - comfortable content spacing */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* Much lighter shadow */
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745, #17a2b8);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.exam-card:hover::before {
    transform: scaleX(1);
}

.exam-card:hover {
    transform: translateY(-2px); /* Smoother hover effect */
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); /* Lighter hover shadow */
}

.exam-header {
    margin-bottom: 0.75rem;
}

.exam-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem; /* Slightly more spacing */
}

.exam-title {
    font-size: 1.1rem;
    font-weight: 700; /* Bolder for caps */
    color: #2c3e50;
    line-height: 1.3;
    margin: 0;
    flex: 1;
    text-transform: uppercase; /* ALL CAPS */
    letter-spacing: 0.5px; /* Better spacing for caps */
}

.exam-title i {
    color: #007bff;
}

.exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem; /* Slightly more gap */
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem; /* Better padding for touch targets */
    background: #f8f9fa; /* Better contrast */
    border-radius: 15px;
    font-size: 0.8rem;
    color: #495057; /* Better readability */
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6; /* Better border */
}

.meta-item:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.meta-item i {
    font-size: 0.7rem;
    opacity: 0.8;
}

.start-exam-btn {
    background: linear-gradient(135deg, #007bff, #0056b3); /* More modern gradient */
    border: none;
    padding: 0.6rem 1.2rem; /* Better padding */
    border-radius: 8px; /* More modern border radius */
    font-weight: 500; /* Medium weight */
    font-size: 0.75rem;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25); /* Subtle shadow */
    white-space: nowrap;
    margin-left: 0.5rem;
    min-width: auto;
    height: auto;
    line-height: 1.2;
}

.start-exam-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085); /* Darker on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.35);
    color: white;
}

.start-exam-btn:active {
    transform: translateY(0);
}

/* Footer */
.exam-footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 1rem 0;
    margin-top: 1.5rem;
}

.footer-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #007bff;
}

/* No Exams */
.no-exams {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 12px; /* More rounded */
    box-shadow: 0 1px 6px rgba(0,0,0,0.05); /* Lighter shadow */
    grid-column: 1 / -1;
}

.no-exams p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Design - Updated for 3 columns */
@media (min-width: 1200px) {
    .exams-list {
        grid-template-columns: repeat(3, 1fr); /* Force 3 columns on large screens */
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .exams-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
}

@media (max-width: 767px) {
    .exams-list {
        grid-template-columns: 1fr; /* 1 column on mobile */
        gap: 0.75rem;
    }
    
    .exam-card {
        padding: 1rem;
    }
    
    .exam-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .start-exam-btn {
        margin-left: 0;
        align-self: flex-end;
        padding: 0.35rem 0.7rem;
        font-size: 0.7rem;
    }
    
    .exam-meta {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .meta-item {
        justify-content: flex-start;
        min-width: auto;
        white-space: nowrap;
    }
    
    .search-section {
        padding: 0.75rem;
    }
    
    .search-section .row > div {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .exam-header {
        padding: 1rem 0;
    }
    
    .header-title {
        font-size: 1.3rem;
    }
    
    .exam-title-section {
        gap: 0.5rem;
    }
    
    .start-exam-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
        border-radius: 12px;
    }
    
    .exam-meta {
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .meta-item {
        padding: 0.2rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Mobile-specific exam card layout optimization */
@media (max-width: 768px) {
    .exam-card {
        padding: 0.75rem;
    }
    
    .exam-header {
        margin-bottom: 0.5rem;
    }
    
    .exam-title-section {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .exam-title {
        font-size: 0.9rem;
        flex: 1;
        margin-right: 0.5rem;
    }
    
    .start-exam-btn {
        flex-shrink: 0;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .exam-meta {
        display: flex;
        flex-direction: row;
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    .meta-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        background: #f8f9fa;
        border-radius: 12px;
        border: 1px solid #dee2e6;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exam-card {
    animation: fadeInUp 0.6s ease forwards;
}

.exam-card:nth-child(1) { animation-delay: 0.1s; }
.exam-card:nth-child(2) { animation-delay: 0.2s; }
.exam-card:nth-child(3) { animation-delay: 0.3s; }
.exam-card:nth-child(4) { animation-delay: 0.4s; }
.exam-card:nth-child(5) { animation-delay: 0.5s; }
.exam-card:nth-child(6) { animation-delay: 0.6s; }

/* Hover Effects */
.exam-card:hover .exam-title {
    color: #007bff;
}

.exam-card:hover .meta-item {
    background: #007bff;
    color: white;
}

/* Focus States */
.start-exam-btn:focus {
    box-shadow: 0 0 0 0.3rem rgba(40, 167, 69, 0.25);
    outline: none;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.3rem rgba(0, 123, 255, 0.15);
}
