* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: linear-gradient(135deg, #4a4b4c 0%, #252426 100%); 
    min-height: 100vh;
}

/* For screen-reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header section */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Styling for all sections */
section {
    background: #1a202c;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #2d3748;
}

section h2 {
    color: #e2e8f0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Search input wrapper for layout */
.search-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#searchInput,
.filter-controls select {
    padding: 10px 15px;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background: #2d3748;
    color: #e2e8f0;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex: 1;
}

#searchInput:focus,
.filter-controls select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Clear button styling */
.clear-btn {
    background: #718096;
    color: white;
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.clear-btn:hover {
    background: #4a5568;
}

/* Base search status styling */
.search-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    display: none;
    color: #e2e8f0;
}

/* Success search status */
.search-status.success {
    background: rgba(72, 187, 120, 0.15);
    display: block;
}

/* Warning search status */
.search-status.warning {
    background: rgba(237, 137, 54, 0.15);
    display: block;
}

/* Error search status */
.search-status.error {
    background: rgba(245, 101, 101, 0.15);
    display: block;
}

/* Info search status */
.search-status.info {
    background: rgba(66, 153, 225, 0.15);
    display: block;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 25px;
}

.filter-controls select {
    flex: 1;
    min-width: 150px;
    max-width: 475px;
    cursor: pointer;
}

/* Push reset button to the right on desktop */
.filter-controls .clear-btn {
    margin-left: auto;
}

/* Exam count display */
.exam-count {
    margin-bottom: 20px;
    font-weight: 600;
    color: #e2e8f0;
}

/* Table container for responsive design */
.table-container {
    overflow-x: auto;
}

/* Main exam table styling */
.exam-table {
    width: 100%;
    border-collapse: collapse;
    background: #2d3748;
    border-radius: 8px;
    overflow: hidden;
}

/* Table header styling */
.exam-table th {
    background: #4a5568;
    color: #e2e8f0;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #2d3748;
}

/* Sortable table headers */
.exam-table th[data-sort] {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.exam-table th[data-sort]:hover {
    background: #5a6578;
}

.exam-table th[data-sort].sort-asc::after,
.exam-table th[data-sort].sort-desc::after {
    content: '';
    position: absolute;
    right: 10px;
}
.exam-table th[data-sort].sort-asc::after { content: '▲'; }
.exam-table th[data-sort].sort-desc::after { content: '▼'; }

/* Table cell styling */
.exam-table td {
    padding: 12px;
    border-bottom: 1px solid #4a5568;
    color: #e2e8f0;
    position: relative;
}

/* Hover effect for table rows */
.exam-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.exam-table tbody tr:hover {
    background: #4a5568;
    transform: translateY(-1px);
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
}

/* Add subtle calendar icon on hover */
.exam-table tbody tr:hover::after {
    content: "☆";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.7;
}

/* Remove border from last row */
.exam-table tbody tr:last-child td {
    border-bottom: none;
}

/* Styling for when no exams are available */
.no-exams {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}

.no-exams p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

/* Modal content */
.modal {
    background: #1a202c;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #2d3748;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
    opacity: 1;
}

.modal h3 {
    color: #e2e8f0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal p {
    color: #a0aec0;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Calendar buttons */
.calendar-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.calendar-btn {
    background: #2d3748;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    display: block;
    font-size: 1rem;
    text-align: center;
    box-shadow: none;
}

.calendar-btn:hover {
    background: #4a5568;
    transform: translateY(-1px);
}

.calendar-btn.copy,
.calendar-btn.close {
    background: transparent;
    border: 1px solid #4a5568;
    padding: 12px 20px;
    font-weight: 400;
}

.calendar-btn.copy:hover,
.calendar-btn.close:hover {
    background: #4a5568;
}

.calendar-btn.copy.copied {
    background: rgba(72, 187, 120, 0.2);
    color: #e2e8f0;
    border-color: #48bb78;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Footer styling */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: #a0aec0;
    border-top: 1px solid #2d3748;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer a {
    color: #4299e1;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* Back to top button */
#backToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: 1px solid #2d3748;
    outline: none;
    background-color: #2d3748;
    color: #e2e8f0;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 18px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
    transition: background-color 0.3s, opacity 0.3s;
}
#backToTopBtn:hover { background-color: #4a5568; }

/* Tablet and smaller desktop screens */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 20px;
    }
    
    .filter-controls {
        /* Allow filters to wrap, keeping dropdowns side-by-side */
    }

    /* Make the reset button full-width on the next line */
    .filter-controls .clear-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 15px;
    }
    
    .exam-table {
        font-size: 0.9rem;
    }
    
    .exam-table th,
    .exam-table td {
        padding: 8px 6px;
    }
    
    .calendar-buttons {
        flex-direction: column;
    }
    
    .modal {
        padding: 20px;
        margin: 20px;
        max-width: 90%;
    }

    #backToTopBtn {
        right: 15px;
        bottom: 15px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .exam-table th,
    .exam-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    
    .footer a {
        display: block;
        margin: 5px 0;
    }
} 