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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.header-text {
    flex: 1;
    text-align: center;
}

.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.left-logo {
    justify-content: flex-start;
}

.right-logo {
    justify-content: flex-end;
}

.logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo:hover {
    transform: scale(1.05);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/>svg>');
    pointer-events: none;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.controls {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 20px;
    align-items: end;
    border: 1px solid rgba(0,0,0,0.05);
}

.filter-section, .search-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-section label, .search-section label {
    font-weight: 600;
    color: #555;
}

select, input[type="text"] {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    background: #fafbfc;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Priority Exam Sections */
.priority-section {
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.priority-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.today-exams {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 2px solid #28a745;
}

.next-exams {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    border: 2px solid #007bff;
}

.past-exams {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: 2px solid #6c757d;
    margin-top: 40px;
}

.priority-header {
    padding: 20px 30px;
    color: white;
    text-align: center;
}

.priority-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.priority-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

.priority-container {
    background: white;
    padding: 20px;
}

.priority-container .exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.priority-container .exam-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.today-exams .priority-container .exam-card {
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    border: 1px solid #c3e6cb;
}

.today-exams .priority-container .exam-card::before {
    background: #28a745 !important;
}

.next-exams .priority-container .exam-card {
    background: linear-gradient(135deg, #f8fbff 0%, #e3f2fd 100%);
    border: 1px solid #b8daff;
}

.next-exams .priority-container .exam-card::before {
    background: #007bff !important;
}

.past-exams .priority-container .exam-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    opacity: 0.8;
    position: relative;
    border: 1px solid #dee2e6;
}

.past-exams .priority-container .exam-card::before {
    background: #6c757d !important;
}

.past-exams .priority-container .exam-card::before {
    background: #6c757d !important;
}

.past-exams .priority-container .exam-card::after {
    content: "COMPLETED";
    position: absolute;
    top: 0px;
    right: 0px;
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.past-exams .priority-container .exam-card:hover {
    opacity: 0.9;
}

.priority-container .exam-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.routine-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding: 20px 0;
}

.date-group {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.05);
}

.date-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
}

.date-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.exams-grid {
    padding: 25px;
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.exam-card {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.course-header {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.course-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.course-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.course-id {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    white-space: nowrap;
}

.exam-date-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.exam-date-badge::before {
    content: "📅 ";
    font-size: 0.7rem;
    margin-right: 3px;
}

.exam-time {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
    text-align: center;
    align-self: center;
}

.exam-time::before {
    content: "🕐 ";
    font-size: 0.8rem;
    margin-right: 4px;
}

.exam-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.9rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.detail-label {
    font-weight: 600;
    color: #555;
}

.detail-value {
    color: #333;
    text-align: right;
}

.section-tag {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.batch-tag {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.teacher-tag {
    display: inline-block;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.department-tag {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Department-specific colors for department tags */
.department-tag.cse {
    background: #3f7fc0;
}

.department-tag.eee {
    background: #f39c12;
}

.department-tag.swe {
    background: #2ecc71;
}

.department-tag.civil {
    background: #e74c3c;
}

.department-tag.mech {
    background: #9b59b6;
}

.room-info {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 12px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.room-info::before {
    content: "🏢 Rooms & Seats";
    position: absolute;
    top: -8px;
    left: 12px;
    background: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #667eea;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

.room-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.room-details {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 6px 12px;
    border-radius: 8px;
    margin: 4px 6px 4px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.room-details:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.room-number {
    font-weight: 600;
    color: #1976d2;
    font-size: 0.9rem;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.room-number::before {
    content: "📍 ";
    font-size: 0.8rem;
    margin-right: 2px;
}

.seat-info {
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.seat-info::before {
    content: "👥 ";
    font-size: 0.8rem;
    margin-right: 2px;
}

.seat-info:hover {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.no-results p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Footer Styles */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

footer .subtitle {
    color: #666;
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Current Date Highlighting */
.current-date {
    border: 3px solid #27ae60;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
    animation: pulse-green 2s infinite;
}

.current-date .date-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    position: relative;
}

.today-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(39, 174, 96, 0.7);
    }
    100% {
        box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(243, 156, 18, 0.6);
    }
    100% {
        box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
    }
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    to {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

/* Notice Banner */
.notice-banner {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 2px solid rgba(253, 203, 110, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.2);
    animation: gentle-pulse 3s ease-in-out infinite;
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.notice-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: bounce 2s ease-in-out infinite;
}

.notice-text {
    color: #8b4513;
    font-size: 1rem;
    line-height: 1.4;
    flex: 1;
}

.notice-text strong {
    color: #d35400;
    font-weight: 700;
}

@keyframes gentle-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(253, 203, 110, 0.2);
    }
    50% {
        box-shadow: 0 6px 20px rgba(253, 203, 110, 0.3);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Department Selector */
.department-selector {
    margin-bottom: 30px;
}

.department-tabs {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.department-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.department-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.department-tab:hover::after {
    width: 60%;
}

.department-tab.active::after {
    width: 80%;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
}

/* Department-specific color themes */
.department-tab[data-department="cse"] {
    --dept-color: #667eea;
    --dept-color-light: rgba(102, 126, 234, 0.1);
}

.department-tab[data-department="cse"] .tab-text {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.department-tab[data-department="eee"] {
    --dept-color: #f39c12;
    --dept-color-light: rgba(243, 156, 18, 0.1);
}

.department-tab[data-department="eee"] .tab-text {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.department-tab[data-department="swe"] {
    --dept-color: #2ecc71;
    --dept-color-light: rgba(46, 204, 113, 0.1);
}

.department-tab[data-department="swe"] .tab-text {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.department-tab[data-department="civil"] {
    --dept-color: #e74c3c;
    --dept-color-light: rgba(231, 76, 60, 0.1);
}

.department-tab[data-department="civil"] .tab-text {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.department-tab[data-department="mech"] {
    --dept-color: #9b59b6;
    --dept-color-light: rgba(155, 89, 182, 0.1);
}

.department-tab[data-department="mech"] .tab-text {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.department-tab:hover {
    background: var(--dept-color-light, rgba(102, 126, 234, 0.1));
    border-color: var(--dept-color, #667eea);
    color: var(--dept-color, #667eea);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.department-tab:hover .tab-text {
    color: var(--dept-color, #667eea);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.department-tab.active {
    background: linear-gradient(135deg, var(--dept-color, #667eea) 0%, var(--dept-color, #764ba2) 100%);
    border-color: var(--dept-color, #667eea);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    position: relative;
}

.department-tab.active .tab-text {
    color: white !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

/* Animated highlight effect */
.department-tab .tab-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
    border-radius: inherit;
}

.department-tab:hover .tab-text::before {
    left: 100%;
}

.department-tab.active .tab-text::before {
    display: none;
}

/* Pulse effect for active tab */
.department-tab.active {
    animation: dept-pulse 2s ease-in-out infinite;
}

@keyframes dept-pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    }
}

.tab-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.department-tab.active .tab-icon {
    transform: scale(1.1);
}

.tab-text {
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: inline-block;
    color: #667eea;
}

.department-tab:hover .tab-text {
    background: var(--dept-color, #667eea);
    color: white !important;
    border-color: var(--dept-color, #667eea);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    letter-spacing: 1px;
}

.department-tab.active .tab-text {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Loading state for department switch */
.department-tab.loading {
    pointer-events: none;
    opacity: 0.7;
}

.department-tab.loading .tab-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Exam Resources Section */
.exam-resources {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.resource-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.resource-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.resource-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.resource-icon {
    font-size: 1.1rem;
}

.resource-label {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.resource-content {
    margin-left: 22px;
}

.resource-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

.resource-link:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateY(-1px);
}

.resource-na {
    color: #7f8c8d;
    font-size: 0.85rem;
    font-style: italic;
}

/* Date styling for priority exam cards */
.exam-date {
    font-weight: 600;
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.today-exams .exam-date {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.next-exams .exam-date {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.past-exams .exam-date {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

/* Tablet Responsiveness */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        gap: 20px;
    }
    
    .controls {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .exam-card {
        padding: 16px;
    }
}

/* iPad Mini and Mid-level Tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Improved exam card layout for tablets */
    .course-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .course-title-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 12px;
        width: 100%;
    }
    
    .course-meta {
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 8px;
        display: flex;
        flex-direction: column;
    }
    
    .exam-date-badge {
        align-self: center;
        margin: 0 auto 8px auto;
        font-size: 0.85rem;
        padding: 6px 12px;
        border-radius: 8px;
        box-shadow: 0 3px 6px rgba(231, 76, 60, 0.4);
        display: block;
        text-align: center;
        order: 1;
        width: fit-content;
    }
    
    .exam-time {
        align-self: center;
        font-size: 0.9rem;
        padding: 8px 16px;
        border-radius: 10px;
        box-shadow: 0 3px 6px rgba(74, 144, 226, 0.4);
        margin: 8px auto;
        text-align: center;
        min-width: 140px;
        display: block;
        width: fit-content;
    }
    
    .course-title {
        text-align: center;
        margin: 0 auto 12px auto;
        font-size: 1.15rem;
        line-height: 1.4;
        width: 100%;
    }
    
    .course-id {
        text-align: center;
        font-size: 0.95rem;
        margin: 0 auto 8px auto;
        width: 100%;
    }
    
    /* Better spacing for exam details on tablets */
    .exam-details {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 16px;
    }
    
    .detail-item {
        padding: 6px 0;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    
    .detail-label {
        font-size: 0.9rem;
        font-weight: 700;
    }
    
    .detail-value {
        font-size: 0.9rem;
        font-weight: 500;
    }
}

/* Large Mobile / Small Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .department-tabs {
        flex-direction: row;
        gap: 10px;
    }
    
    .department-tab {
        flex: 1;
        min-width: 0;
    }
    
    .controls {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .search-section {
        grid-column: 1 / -1;
    }
}

/* Mobile Responsiveness (General mobile devices) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 1.6rem;
        margin-bottom: 5px;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .logo {
        height: 45px;
    }
    
    /* Department Tabs */
    .department-selector {
        margin-bottom: 20px;
    }
    
    .department-tabs {
        flex-direction: column;
        gap: 10px;
        padding: 6px;
    }
    
    .department-tab {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
        background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
        border: 2px solid #e9ecef;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .department-tab::after {
        height: 2px;
    }
    
    .tab-text {
        font-size: 0.85rem;
        letter-spacing: 0.6px;
        padding: 3px 8px;
        border-radius: 8px;
    }
    
    .department-tab:hover .tab-text {
        background: var(--dept-color, #667eea);
        color: white !important;
    }
    
    .department-tab.active .tab-text {
        background: rgba(255, 255, 255, 0.2);
        color: white !important;
    }
    
    /* Controls */
    .controls {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
        padding: 20px;
    }
    
    .filter-section, .search-section {
        margin-bottom: 15px;
    }
    
    .filter-section label, .search-section label {
        font-weight: 600;
        color: #555;
        font-size: 0.9rem;
        margin-bottom: 8px;
        display: block;
    }
    
    select, input[type="text"] {
        width: 100%;
        padding: 12px 14px;
        font-size: 0.9rem;
        border-radius: 8px;
        border: 2px solid #e1e5e9;
        background: #fafbfc;
        transition: all 0.3s ease;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px;
    }
    
    select:focus, input[type="text"]:focus {
        outline: none;
        border-color: #667eea;
        background: white;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    /* Style the select dropdown options */
    select option {
        padding: 10px;
        background: white;
        color: #333;
        font-size: 0.9rem;
        border: none;
    }
    
    select option:hover,
    select option:focus {
        background: #f8f9fa;
        color: #667eea;
    }
    
    select option:checked {
        background: #667eea;
        color: white;
        font-weight: 600;
    }
    
    /* Notice Banner */
    .notice-banner {
        padding: 12px 16px;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .notice-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .notice-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* Exam Display */
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .exam-card {
        padding: 16px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
    
    .exam-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .course-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .date-header {
        font-size: 1.1rem;
        padding: 12px 15px;
        border-radius: 10px;
    }
    
    /* Priority Sections */
    .priority-header h2 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .priority-subtitle {
        font-size: 0.85rem;
    }
    
    .priority-container {
        padding: 15px;
    }
    
    /* Room info improvements */
    .room-info {
        padding: 10px 12px;
        margin-top: 10px;
        border-radius: 8px;
    }
    
    .room-details {
        padding: 5px 10px;
        margin: 3px 5px 3px 0;
        border-radius: 6px;
        font-size: 0.85rem;
    }
    
    /* Footer */
    footer {
        margin-top: 30px;
        padding: 20px 15px;
        text-align: center;
        border-radius: 12px;
    }
    
    footer .subtitle {
        font-size: 0.85rem;
    }
}

/* Small Mobile Devices (iPhone 8, similar sized phones) */
@media (max-width: 480px) {
    .container {
        padding: 6px;
    }
    
    header {
        padding: 12px 8px;
        margin-bottom: 12px;
        border-radius: 6px;
    }
    
    .header-text h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .logo {
        height: 35px;
    }
      /* Department Tabs */
    .department-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 6px;
        min-height: 40px;
        background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
        border: 1px solid #e9ecef;
    }
    
    .department-tab::after {
        height: 1px;
    }

    .tab-icon {
        font-size: 1rem;
    }

    .tab-text {
        font-size: 0.75rem;
        letter-spacing: 0.4px;
        padding: 2px 5px;
        border-radius: 5px;
    }
    
    .department-tab:hover .tab-text {
        background: var(--dept-color, #667eea);
        color: white !important;
    }
    
    .department-tab.active .tab-text {
        background: rgba(255, 255, 255, 0.2);
        color: white !important;
    }
    
    /* Controls */
    .controls {
        gap: 10px;
        margin-bottom: 15px;
        padding: 18px;
    }
    
    .filter-section, .search-section {
        margin-bottom: 12px;
    }
    
    .filter-section label, .search-section label {
        font-size: 0.85rem;
        margin-bottom: 6px;
        font-weight: 600;
        color: #555;
        display: block;
    }
    
    select, input[type="text"] {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 6px;
        min-height: 42px;
        border: 2px solid #e1e5e9;
        background: #fafbfc;
        transition: all 0.3s ease;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 14px;
        padding-right: 35px;
    }
    
    select:focus, input[type="text"]:focus {
        outline: none;
        border-color: #667eea;
        background: white;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    select option {
        padding: 8px;
        background: white;
        color: #333;
        font-size: 0.85rem;
    }
    
    select option:hover,
    select option:focus {
        background: #f8f9fa;
        color: #667eea;
    }
    
    select option:checked {
        background: #667eea;
        color: white;
        font-weight: 600;
    }
    
    /* Notice Banner */
    .notice-banner {
        padding: 10px 14px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .notice-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .notice-text {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    /* Exam Display */
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 8px;
    }
    
    .exam-card {
        padding: 8px;
        margin-bottom: 4px;
        border-radius: 6px;
        min-height: auto;
    }
    
    .course-header {
        margin-bottom: 8px;
        gap: 4px;
    }
    
    .course-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .course-title {
        font-size: 0.9rem;
        line-height: 1.2;
        margin-bottom: 4px;
        font-weight: 700;
    }
    
    .course-id {
        font-size: 0.75rem;
        order: 2;
    }
    
    .exam-date-badge {
        font-size: 0.75rem;
        padding: 2px 5px;
        order: -1;
        align-self: flex-start;
        margin-bottom: 3px;
    }
    
    .exam-time {
        font-size: 0.8rem;
        padding: 4px 8px;
        margin: 6px 0;
        border-radius: 6px;
        align-self: stretch;
        text-align: center;
    }
    
    .exam-details {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-top: 6px;
    }
    
    .detail-item {
        padding: 2px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .detail-label {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .detail-value {
        font-size: 0.8rem;
        text-align: right;
    }
    
    .date-header {
        font-size: 1rem;
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    /* Priority Sections */
    .priority-header h2 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .priority-subtitle {
        font-size: 0.85rem;
    }
    
    .priority-container {
        padding: 15px;
    }
    
    /* Room info improvements */
    .room-info {
        padding: 10px 12px;
        margin-top: 10px;
        border-radius: 8px;
    }
    
    .room-details {
        padding: 5px 10px;
        margin: 3px 5px 3px 0;
        border-radius: 6px;
        font-size: 0.85rem;
    }
    
    /* Footer */
    footer {
        margin-top: 30px;
        padding: 20px 15px;
        text-align: center;
        border-radius: 12px;
    }
    
    footer .subtitle {
        font-size: 0.85rem;
    }
}

/* iPhone 12 Pro and similar mid-size mobile devices (390px) */
@media (max-width: 390px) and (min-width: 376px) {
    .container {
        padding: 8px;
    }
    
    header {
        padding: 14px 10px;
        margin-bottom: 14px;
        border-radius: 8px;
    }
    
    .header-text h1 {
        font-size: 1.3rem;
        margin-bottom: 3px;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .logo {
        height: 38px;
    }
    
    /* Department Tabs optimized for 390px width */
    .department-tab {
        padding: 9px 11px;
        font-size: 0.82rem;
        border-radius: 7px;
        min-height: 41px;
        background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
        border: 1.5px solid #e9ecef;
    }
    
    .tab-icon {
        font-size: 1.05rem;
    }

    .tab-text {
        font-size: 0.78rem;
        letter-spacing: 0.45px;
        padding: 2px 6px;
        border-radius: 6px;
    }
    
    /* Controls section for iPhone 12 Pro */
    .controls {
        gap: 9px;
        margin-bottom: 14px;
        padding: 16px;
    }
    
    .filter-section, .search-section {
        margin-bottom: 11px;
    }
    
    .filter-section label, .search-section label {
        font-size: 0.82rem;
        margin-bottom: 5px;
        font-weight: 600;
        color: #555;
        display: block;
    }
    
    select, input[type="text"] {
        width: 100%;
        padding: 9px 11px;
        font-size: 0.82rem;
        border-radius: 6px;
        min-height: 41px;
        border: 2px solid #e1e5e9;
        background: #fafbfc;
        transition: all 0.3s ease;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 9px center;
        background-size: 13px;
        padding-right: 32px;
    }
    
    select option {
        padding: 7px;
        background: white;
        color: #333;
        font-size: 0.82rem;
    }
    
    /* Notice Banner for iPhone 12 Pro */
    .notice-banner {
        padding: 9px 13px;
        margin-bottom: 13px;
        border-radius: 7px;
    }
    
    .notice-text {
        font-size: 0.78rem;
        line-height: 1.3;
    }
    
    /* Exam Display optimized for 390px */
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 8px;
    }
    
    .exam-card {
        padding: 10px;
        margin-bottom: 6px;
        border-radius: 7px;
        min-height: auto;
    }
    
    .course-header {
        margin-bottom: 9px;
        gap: 5px;
    }
    
    .course-title {
        font-size: 0.88rem;
        line-height: 1.2;
        margin-bottom: 5px;
        font-weight: 700;
    }
    
    .course-id {
        font-size: 0.78rem;
        order: 2;
    }
    
    .exam-date-badge {
        font-size: 0.78rem;
        padding: 3px 6px;
        order: -1;
        align-self: flex-start;
        margin-bottom: 4px;
        border-radius: 6px;
    }
    
    .exam-time {
        font-size: 0.82rem;
        padding: 5px 9px;
        margin: 7px 0;
        border-radius: 7px;
        align-self: stretch;
        text-align: center;
    }
    
    .exam-details {
        grid-template-columns: 1fr;
        gap: 7px;
        margin-top: 7px;
    }
    
    .detail-item {
        padding: 3px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .detail-label {
        font-size: 0.82rem;
        font-weight: 600;
    }
    
    .detail-value {
        font-size: 0.82rem;
        text-align: right;
    }
    
    .date-header {
        font-size: 1.05rem;
        padding: 11px 13px;
        border-radius: 8px;
    }
    
    /* Priority Sections for iPhone 12 Pro */
    .priority-header h2 {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }
    
    .priority-subtitle {
        font-size: 0.82rem;
    }
    
    .priority-container {
        padding: 14px;
    }
    
    .priority-container .exams-grid {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 7px;
    }
    
    /* Room info for iPhone 12 Pro */
    .room-info {
        padding: 9px 11px;
        margin-top: 9px;
        border-radius: 7px;
    }
    
    .room-details {
        padding: 4px 8px;
        margin: 2px 4px 2px 0;
        border-radius: 5px;
        font-size: 0.82rem;
    }
    
    /* Badge icons for iPhone 12 Pro */
    .exam-date-badge::before {
        content: "📅";
        font-size: 0.55rem;
        margin-right: 2px;
    }
    
    .exam-time::before {
        content: "🕐";
        font-size: 0.55rem;
        margin-right: 2px;
    }
    
    /* Tags and badges optimized for 390px */
    .batch-tag, .section-tag, .teacher-tag {
        display: inline-block;
        margin: 1px 3px;
        white-space: nowrap;
        font-size: 0.78rem;
        padding: 2px 5px;
        border-radius: 4px;
    }
    
    /* Footer for iPhone 12 Pro */
    footer {
        margin-top: 25px;
        padding: 18px 12px;
        text-align: center;
        border-radius: 10px;
    }
    
    footer .subtitle {
        font-size: 0.82rem;
    }
}

/* Extra Small Mobile Devices (iPhone SE, small Android phones) */
@media (max-width: 375px) {
    .container {
        padding: 6px;
    }
    
    header {
        padding: 12px 8px;
        margin-bottom: 12px;
        border-radius: 6px;
    }
    
    .header-text h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .logo {
        height: 35px;
    }
      /* Department Tabs */
    .department-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 6px;
        min-height: 40px;
        background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
        border: 1px solid #e9ecef;
    }
    
    .department-tab::after {
        height: 1px;
    }

    .tab-icon {
        font-size: 1rem;
    }

    .tab-text {
        font-size: 0.75rem;
        letter-spacing: 0.4px;
        padding: 2px 5px;
        border-radius: 5px;
    }
    
    .department-tab:hover .tab-text {
        background: var(--dept-color, #667eea);
        color: white !important;
    }
    
    .department-tab.active .tab-text {
        background: rgba(255, 255, 255, 0.2);
        color: white !important;
    }
    
    /* Controls */
    .controls {
        gap: 10px;
        margin-bottom: 15px;
        padding: 18px;
    }
    
    .filter-section, .search-section {
        margin-bottom: 12px;
    }
    
    .filter-section label, .search-section label {
        font-size: 0.8rem;
        margin-bottom: 4px;
        font-weight: 600;
        color: #555;
        display: block;
    }
    
    select, input[type="text"] {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 5px;
        min-height: 40px;
        border: 2px solid #e1e5e9;
        background: #fafbfc;
        transition: all 0.3s ease;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 12px;
        padding-right: 30px;
    }
    
    select:focus, input[type="text"]:focus {
        outline: none;
        border-color: #667eea;
        background: white;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    select option {
        padding: 6px;
        background: white;
        color: #333;
        font-size: 0.8rem;
    }
    
    select option:hover,
    select option:focus {
        background: #f8f9fa;
        color: #667eea;
    }
    
    select option:checked {
        background: #667eea;
        color: white;
        font-weight: 600;
    }
    
    /* Notice Banner */
    .notice-banner {
        padding: 8px 12px;
        margin-bottom: 12px;
        border-radius: 6px;
    }
    
    .notice-icon {
        font-size: 1rem;
    }
    
    .notice-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    /* Exam Display */
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 8px;
    }
    
    .exam-card {
        padding: 8px;
        margin-bottom: 4px;
        border-radius: 6px;
        min-height: auto;
    }
    
    .course-header {
        margin-bottom: 8px;
        gap: 4px;
    }
    
    .course-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .course-title {
        font-size: 0.9rem;
        line-height: 1.2;
        margin-bottom: 4px;
        font-weight: 700;
    }
    
    .course-id {
        font-size: 0.75rem;
        order: 2;
    }
    
    .exam-date-badge {
        font-size: 0.75rem;
        padding: 2px 5px;
        order: -1;
        align-self: flex-start;
        margin-bottom: 3px;
    }
    
    .exam-time {
        font-size: 0.8rem;
        padding: 4px 8px;
        margin: 6px 0;
        border-radius: 6px;
        align-self: stretch;
        text-align: center;
    }
    
    .exam-details {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-top: 6px;
    }
    
    .exam-details div {
        font-size: 0.8rem;
    }
    
    .detail-item {
        padding: 2px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .detail-label {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .detail-value {
        font-size: 0.8rem;
        text-align: right;
    }
    
    .date-header {
        font-size: 1rem;
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    /* Priority Sections */
    .priority-header h2 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .priority-subtitle {
        font-size: 0.85rem;
    }
    
    .priority-container {
        padding: 15px;
    }
    
    /* Room info improvements */
    .room-info {
        padding: 10px 12px;
        margin-top: 10px;
        border-radius: 8px;
    }
    
    .room-details {
        padding: 5px 10px;
        margin: 3px 5px 3px 0;
        border-radius: 6px;
        font-size: 0.85rem;
    }
    
    /* Footer */
    footer {
        margin-top: 30px;
        padding: 20px 15px;
        text-align: center;
        border-radius: 12px;
    }
    
    footer .subtitle {
        font-size: 0.85rem;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    /* Better text truncation for small screens */
    .course-title {
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    /* Improve course meta layout */
    .course-meta {
        width: 100%;
        align-items: flex-start;
    }
    
    /* Better badge positioning */
    .exam-date-badge::before {
        content: "📅";
        font-size: 0.6rem;
        margin-right: 2px;
    }
    
    .exam-time::before {
        content: "🕐";
        font-size: 0.6rem;
        margin-right: 2px;
    }
    
    /* Compact priority container grid */
    .priority-container .exams-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
    }
    
    /* Responsive tags */
    .batch-tag, .section-tag, .teacher-tag {
        display: inline-block;
        margin: 1px 2px;
        white-space: nowrap;
    }
}

@media (max-width: 375px) {
    /* Even more compact for very small screens */
    .course-title {
        font-size: 0.8rem !important;
        line-height: 1.1 !important;
        margin-bottom: 2px !important;
    }
    
    .exam-date-badge::before {
        content: "📅";
        font-size: 0.5rem;
        margin-right: 1px;
    }
    
    .exam-time::before {
        content: "🕐";
        font-size: 0.5rem;
        margin-right: 1px;
    }
    
    /* Ultra compact priority grids */
    .priority-container .exams-grid {
        gap: 4px;
        padding: 4px;
    }
}

@media (max-width: 320px) {
    /* Maximum compactness for ultra small screens */
    .course-title {
        font-size: 0.75rem !important;
        line-height: 1 !important;
        margin-bottom: 1px !important;
    }
    
    .exam-date-badge::before,
    .exam-time::before {
        display: none; /* Remove icons on ultra small screens */
    }
    
    /* Remove room info icons to save space */
    .room-info::before {
        display: none;
    }
    
    .room-number::before,
    .seat-info::before {
        display: none;
    }
    
    /* Ultra compact priority container */
    .priority-container .exams-grid {
        gap: 2px;
        padding: 2px;
    }
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
    /* GPU acceleration for smoother animations */
    .exam-card, .department-tab, .priority-section {
        will-change: transform;
        transform: translateZ(0);
    }
    
    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .exam-card {
            border: 2px solid #000;
        }
        
        .department-tab {
            border: 1px solid #000;
        }
        
        select, input[type="text"] {
            border: 2px solid #000;
        }
    }
}

/* Improved focus states for accessibility */
@media (max-width: 768px) {
    .department-tab:focus,
    select:focus,
    input[type="text"]:focus {
        outline: 3px solid #667eea;
        outline-offset: 2px;
    }
    
    /* Better focus visibility for exam cards */
    .exam-card:focus-within {
        outline: 2px solid #667eea;
        outline-offset: 2px;
    }
}

/* Print styles for mobile */
@media print {
    .container {
        max-width: none;
        padding: 0;
    }
    
    .controls,
    .department-selector,
    .notice-banner {
        display: none;
    }
    
    .exam-card {
        break-inside: avoid;
        margin-bottom: 10px;
        border: 1px solid #000;
        box-shadow: none;
        background: white !important;
    }
    
    .priority-section {
        break-inside: avoid;
    }
    
    header {
        background: white !important;
        color: black !important;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Additional mobile-specific improvements */
@media (max-width: 480px) {
    /* Improve text readability */
    body {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Better spacing for small screens */
    .routine-container {
        gap: 20px;
        padding: 10px 0;
    }
    
    .date-group {
        margin-bottom: 15px;
    }
    
    /* Improved button spacing */
    .department-tabs {
        gap: 8px;
    }
    
    /* Better visual hierarchy */
    .course-title {
        font-weight: 700;
        color: #2c3e50;
    }
    
    .detail-label {
        font-weight: 700;
        color: #34495e;
    }
    
    /* Improved tags appearance */
    .batch-tag, .section-tag, .teacher-tag {
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }
}

/* Loading states for mobile */
@media (max-width: 768px) {
    .exam-card.loading {
        opacity: 0.6;
        pointer-events: none;
    }
    
    .exam-card.loading::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid #f3f3f3;
        border-top: 2px solid #667eea;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
}
