html.modal-open, body.modal-open {
    overflow: hidden !important;
    overscroll-behavior: contain;
    touch-action: none;
}

body.modal-open {
    position: fixed;
    width: 100vw;
}
/* View button for schedule tab */
.view-btn {
    background: #222;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin: 0 4px;
}
.view-btn:hover {
    background: #444;
    color: #fff;
}
#saveExamReviewBtn {
    background: #222;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-top: 4px;
}
#saveExamReviewBtn:hover {
    background: #444;
    color: #fff;
}
.view-reviews-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-left: 12px;
}
.view-reviews-btn:hover {
    background: #5a67d8;
}
.recent-exam-review {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(102,126,234,0.10);
    padding: 20px 24px 18px 24px;
    margin-bottom: 20px;
    font-family: inherit;
}
.recent-exam-review h3 {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.recent-exam-name {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 8px;
}
.emoji-levels {
    display: flex;
    gap: 16px;
    font-size: 2rem;
    margin-bottom: 10px;
}
.emoji-review {
    cursor: pointer;
    transition: border 0.2s, box-shadow 0.2s;
    border-radius: 50%;
    padding: 2px 6px;
}
.emoji-review:hover {
    box-shadow: 0 0 0 4px #e3fcec;
    background: #f7fafc;
}
#addExamCommentBtn, #saveExamCommentBtn {
    background: #222;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-top: 4px;
}
#addExamCommentBtn:hover, #saveExamCommentBtn:hover {
    background: #444;
    color: #fff;
}
/* Unified button styles for all main actions */
.add-reminder-btn, .view-bookmarks-btn, .notification-btn,
.tab-btn, .tab-btn.active, .tab-btn:not(.active):hover,
#saveExamReviewBtn, #addExamCommentBtn, #saveExamCommentBtn,
.view-topics-btn, .view-btn {
    background: #232946;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: none;
}
.add-reminder-btn:hover, .view-bookmarks-btn:hover, .notification-btn:hover,
.tab-btn:hover, .tab-btn.active,
#saveExamReviewBtn:hover, #addExamCommentBtn:hover, #saveExamCommentBtn:hover,
.view-topics-btn:hover, .view-btn:hover {
    background: #2a2d3a;
    color: #fff;
}
.tab-btn {
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}
.view-topics-btn, .view-btn {
    padding: 14px 22px;
    width: 100%;
    margin-top: 18px;
}
#saveExamReviewBtn, #addExamCommentBtn, #saveExamCommentBtn {
    padding: 8px 16px;
    margin-top: 4px;
}
.add-reminder-btn, .view-bookmarks-btn, .notification-btn {
    padding: 12px 18px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#examCommentInput {
    border: 1.5px solid #667eea;
    font-size: 1rem;
    background: #f7fafc;
    color: #2d3748;
    margin-bottom: 4px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#examCommentInput:focus {
    border-color: #5a67d8;
    background: #fff;
}
#savedExamComment {
    color: #4a5568;
    font-size: 0.98rem;
    margin-top: 8px;
    font-style: italic;
}
/* Search Bar Styling */
.search-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 18px;
    padding: 0 0px;
    width: 100%;
}

#searchExamInput {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 14px 38px 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    -webkit-border-radius: 16px;
    backdrop-filter: blur(8px);
}

#searchExamInput:focus {
    border-color: #667eea;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.12),
        0 0 0 3px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-1px);
}

#searchExamInput::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

#searchExamInput {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23667eea" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 21l-4.35-4.35m2.35-6.65a7 7 0 1 1-14 0 7 7 0 0 1 14 0z" stroke="%23667eea" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-size: 22px 22px;
    background-position: right 10px center;
}
.exam-set {
    margin-bottom: 32px;
    border-left: 6px solid #667eea;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.10);
    padding: 24px 24px 18px 24px;
    transition: box-shadow 0.3s;
}
.exam-set:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.modal-content {
    background: #f7fafc;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    max-width: 90%;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.18);
    animation: modalSlideIn 0.3s ease;
}
.modal-body {
    padding: 28px 24px 24px 24px;
    max-height: 60vh;
    overflow-y: auto;
    background: #f7fafc;
    border-radius: 0 0 20px 20px;
}
.exam-group {
    background: #f3f4f6;
    border-radius: 10px;
    margin: 18px 12px 18px 12px;
    padding: 12px 0 8px 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.07);
}
.exam-group h4 {
    margin: 0 0 10px 20px;
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 500;
}
.exam-item {
    margin: 0 20px 10px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.05);
}
.exam-item:last-child {
    margin-bottom: 0;
}
/* Loading state */
body.loading {
    cursor: wait;
}

body.loading * {
    pointer-events: none;
}

/* Improved touch targets and mobile interactions */
.tab-btn, .add-reminder-btn, .view-topics-btn, .view-topics-small, 
.close-btn, .month-header, .emoji-review {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Focus styles for accessibility */
.tab-btn:focus, .add-reminder-btn:focus, .view-topics-btn:focus,
.view-topics-small:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #667eea;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1001;
}

.skip-link:focus {
    top: 6px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    scroll-behavior: smooth;
}
*, *::before, *::after {
    box-sizing: inherit;
}
/* Enhanced mobile scrolling and performance */
.modal-body, .month-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll issues on mobile */
.upcoming-exam-card, .stat-card, .exam-item, .modal-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Improved button states for mobile */
button:active, .tab-btn:active, .emoji-review:active {
    transform: scale(0.98);
}

/* Better text selection on mobile */
.exam-info h4, .countdown, .stat-card h4 {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth animations for better perceived performance */
.tab-content, .month-content, .modal {
    will-change: transform, opacity;
}

/* Optimized for mobile viewport */
.container {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    position: relative;
}

.container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, rgba(102, 126, 234, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Ensure all header buttons have consistent styling */

.add-reminder-btn, .view-bookmarks-btn, .notification-btn {
    background: #222;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn {
    background: #444;
}

.notification-btn:hover, .add-reminder-btn:hover, .view-bookmarks-btn:hover {
    background: #111;
    color: #fff;
    transform: none;
    box-shadow: none;
}

.notification-btn:hover {
    background: #222;
}

.add-reminder-btn:hover, .view-bookmarks-btn:hover {
    background: #333;
}


/* Remove shimmer effect for minimal look */

.notification-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Optional: Style for grouped exams in modal */
.exam-set {
    margin-bottom: 24px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 16px;
    transform: translateY(-2px);
}

.tab-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    margin: 0 20px;
    border-radius: 18px;
    padding: 6px;
    margin-top: 16px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(102, 126, 234, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: sticky;
    top: 76px;
    z-index: 90;
}

.tab-btn {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: #eee;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    color: #222;
    position: relative;
    overflow: hidden;
}

.tab-btn.active {
    background: #222;
    color: #fff;
    box-shadow: none;
    transform: none;
}

.tab-btn:not(.active):hover {
    background: #ccc;
    color: #111;
    transform: none;
}

.tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-status-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.notification-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-icon {
    font-size: 1.8rem;
    filter: grayscale(50%);
    transition: filter 0.3s ease;
}

.notification-status-card.enabled .status-icon {
    filter: grayscale(0%);
}

.status-text h4 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.status-text p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.quick-toggle-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-toggle-btn:hover {
    background: #1976D2;
}

.quick-toggle-btn:disabled {
    background: #4CAF50;
    cursor: default;
}

.upcoming-exam-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 28px 25px;
    margin-top: 48px;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.12),
        0 2px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.upcoming-exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    border-radius: 24px 24px 0 0;
}
.upcoming-exam-card .countdown {
    width: 100%;
    box-sizing: border-box;
    display: block;
    margin-left: 0;
    margin-right: 0;
    border-radius: 15px;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: 
        0 3px 12px rgba(102, 126, 234, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #48bb78, #ed8936, #e53e3e);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h4 {
    color: #667eea;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card p {
    color: #718096;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.exam-header h2 {
    color: #2d3748;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.exam-date {
    color: #667eea;
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 15px;
}

.countdown {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 50%, #ff4757 100%);
    color: white;
    padding: 18px 15px;
    border-radius: 16px;
    text-align: center;
    margin: 18px 0;
    font-size: 1.3rem;
    font-weight: 600;
    box-shadow: 
        0 6px 20px rgba(255, 107, 107, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.countdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: -100%; }
    100% { left: 100%; }
}

.view-topics-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 18px;
    box-shadow: 0 4px 16px rgba(72, 187, 120, 0.3), 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

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

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

.view-topics-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.month-group {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 
        0 6px 24px rgba(102, 126, 234, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.month-group:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.month-header {
    background: #4a5568;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.month-header:hover {
    background: #2d3748;
}

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

.arrow.expanded {
    transform: rotate(90deg);
}

.month-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.month-content.expanded {
    max-height: none;
    overflow: visible;
}

.exam-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    min-height: 60px;
    gap: 12px;
}

.exam-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.exam-info h4 {
    margin: 0;
    color: #2d3748;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Bookmark icon positioning */
.bookmark-svg-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.bookmark-svg {
    transition: stroke 0.2s;
    cursor: pointer;
    vertical-align: middle;
}

.bookmark-svg.active {
    stroke: #48bb78;
}

.view-topics-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}

.exam-item:last-child {
    border-bottom: none;
}

.exam-info span {
    color: #667eea;
    font-size: 0.9rem;
}

.view-topics-small:hover {
    background: #5a67d8;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 10% auto;
    padding: 0;
    border-radius: 24px;
    max-width: 90%;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 8px 32px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-30px) scale(0.95); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.modal-header {
    background: #232946;
    color: #fff;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #2a2d3a;
}

.modal-header h3 {
    margin: 0;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.topic-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.topic-section h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 600;
}

.topic-section ul {
    list-style: none;
    padding: 0;
}

.topic-section li {
    padding: 6px 0;
    color: #4a5568;
    position: relative;
    padding-left: 24px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.topic-section li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 8px;
    top: 6px;
    line-height: 1.5;
}

.no-topics {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
}

.flash-btn {
    animation: flashHighlight 1.2s linear;
    box-shadow: 0 0 0 4px #48bb78, 0 0 12px #38a169;
    background: #38a169 !important;
    color: #fff !important;
}

@keyframes flashHighlight {
    0% { box-shadow: 0 0 0 0 #48bb78; }
    30% { box-shadow: 0 0 0 8px #48bb78; }
    60% { box-shadow: 0 0 0 4px #38a169; }
    100% { box-shadow: 0 0 0 0 #48bb78; }
}

.highlight-exam {
    background: linear-gradient(90deg, #e3fcec 0%, #c6f6d5 100%);
    border: 2px solid #48bb78;
    box-shadow: 0 0 10px #48bb7833;
    transition: background 0.3s, box-shadow 0.3s;
}

/* Highlight only matched text in exam name */
.highlight-text {
    background: #ffe066;
    color: #2d3748;
    border-radius: 4px;
    padding: 2px 4px;
    font-weight: bold;
}

/* Stats sections layout */
.stats-sections {
    margin: 20px 0 10px 0;
    padding: 10px 0;
    background: #f7fafc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 1.05rem;
    padding: 6px 0;
}
.stats-row div {
    background: #e3e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 0 4px;
    font-weight: 500;
    color: #4a5568;
}
/* Bookmark icon styles */
.bookmark-icon {
    font-size: 1.3rem;
    margin-right: 10px;
    vertical-align: middle;
    transition: color 0.2s;
}
.bookmark-icon[title="Bookmark"] {
    color: #667eea;
}
.bookmark-icon.active {
    color: #48bb78;
}
.bookmarked-countdown {
    background: #d4f5e9;
    color: #2d3748;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(72,187,120,0.10);
}

/* Review Modal Card Styles */
.review-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(102,126,234,0.10);
    padding: 20px 22px 16px 22px;
    margin-bottom: 22px;
    transition: box-shadow 0.3s;
    border-left: 6px solid #667eea;
    position: relative;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.review-exam {
    font-size: 1.08rem;
    font-weight: 500;
    color: #2d3748;
}
.review-date {
    color: #718096;
    font-size: 0.98rem;
    margin-left: 8px;
}
.review-level {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    margin-bottom: 6px;
}
.review-level-label {
    font-size: 1rem;
    color: #667eea;
    margin-left: 4px;
}
.review-comment {
    color: #4a5568;
    font-size: 1.01rem;
    margin-top: 2px;
    padding-left: 2px;
}
.review-comment-label {
    font-weight: 500;
    color: #667eea;
    margin-right: 4px;
}
.review-no-comment {
    color: #a0aec0;
    font-style: italic;
}
.edit-review-btn {
    background: #f6e05e;
    color: #2d3748;
    border: none;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}
.edit-review-btn:hover {
    background: #ecc94b;
}
.edit-review-form {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(102,126,234,0.10);
    padding: 20px 22px 16px 22px;
    margin-bottom: 10px;
    border-left: 6px solid #667eea;
}
.emoji-review.selected {
    border: 2px solid #667eea;
    background: #e6e8fa;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .notification-btn, .add-reminder-btn, .view-bookmarks-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-height: 40px;
        width: 100%;
        flex: none;
    }

    .tab-bar {
        margin: 0 16px;
        margin-top: 12px;
        top: 70px;
    }
    
    .tab-content {
        padding: 16px 16px 24px 16px;
    }

    .quick-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .notification-status-card {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin: 0 16px;
    }
    
    .upcoming-exam-card {
        margin: 0 8px;
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    .search-bar {
        padding: 0 2px;
        margin-bottom: 16px;
    }
    
    #searchExamInput {
        font-size: 16px;
        padding: 12px 36px 12px 12px;
        border-radius: 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        max-width: 95%;
        max-height: 90%;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 20px 16px 24px 16px;
        max-height: 70vh;
    }
}

/* Intermediate breakpoint for tablets and medium screens */
@media (max-width: 640px) {
    .exam-item {
        padding: 14px 16px;
        align-items: center;
        gap: 8px;
    }
    
    .exam-info {
        align-items: flex-start;
    }
    
    .exam-info h4 {
        font-size: 0.95rem;
    }
    
    .view-topics-small {
        font-size: 0.8rem;
        padding: 6px 10px;
        min-width: 80px;
    }
}

/* For very tight horizontal space */
@media (max-width: 480px) {
    .exam-item {
        padding: 12px 16px;
        align-items: center;
        gap: 6px;
    }
    
    .exam-info h4 {
        font-size: 0.9rem;
    }
    
    .view-topics-small {
        font-size: 0.75rem;
        padding: 5px 8px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
        flex-direction: column;
        gap: 12px;
        position: sticky;
        top: 0;
    }

    .header h1 {
        font-size: 1.25rem;
        text-align: center;
    }

    .header-buttons {
        flex-direction: row;
        gap: 8px;
        width: 100%;
        justify-content: center;
    }

    .notification-btn, .add-reminder-btn, .view-bookmarks-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.8rem;
        min-height: 44px;
        min-width: 0; /* Allow buttons to shrink equally */
    }
    
    .tab-bar {
        margin: 0 12px;
        margin-top: 8px;
        top: 85px;
    }

    .upcoming-exam-card, .notification-status-card {
        margin: 0 8px;
        padding: 16px 12px;
        border-radius: 12px;
    }

    .tab-content {
        padding: 12px 8px 20px 8px;
    }

    .status-info {
        gap: 8px;
    }

    .status-text h4 {
        font-size: 0.95rem;
    }

    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 12px 8px;
        border-radius: 8px;
    }

    .stat-card h4 {
        font-size: 1.2rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    .search-bar {
        padding: 0;
        margin-bottom: 12px;
    }
    
    #searchExamInput {
        font-size: 16px;
        padding: 12px 32px 12px 10px;
        border-radius: 8px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-width: 98%;
        max-height: 96%;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 14px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 16px 12px 20px 12px;
        max-height: 75vh;
    }
    
    .topic-section {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    .topic-section h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .topic-section li {
        padding: 4px 0;
        font-size: 0.9rem;
        line-height: 1.4;
        padding-left: 22px;
    }
    
    .topic-section li:before {
        left: 6px;
        top: 4px;
    }
}
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(60px, 1fr));
    gap: 6px;
    margin: 0 auto 0 auto;
    width: 100%;
    max-width: 400px;
    position: relative;
    justify-content: center;
    padding: 0;
    border: none;
}
.quick-stats-grid::-webkit-scrollbar {
    height: 6px;
    background: #f7fafc;
}
.quick-stats-grid::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
@media (max-width: 600px) {
    .quick-stats-grid {
        max-width: 100vw;
        padding: 0 4px;
    }
}
.main-exam-countdown-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px 0 24px 0;
    width: 100%;
}
.main-exam-countdown-card {
    background: #f7fafc;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(102,126,234,0.06);
    padding: 14px 18px 12px 18px;
    min-width: 180px;
    max-width: 320px;
    text-align: center;
    margin: 0 auto;
}
.main-exam-countdown-card h4 {
    color: #667eea;
    font-size: 0.98rem;
    margin-bottom: 4px;
    font-weight: 600;
}
#mainExamCountdown {
    font-size: 1.05rem;
    color: #2d3748;
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.5px;
}
@media (max-width: 600px) {
    .main-exam-countdowns {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .main-exam-countdown-card {
        min-width: 0;
        width: 100%;
    }
}
@media (max-width: 500px) {
    .upcoming-exam-card {
        max-width: 98vw;
        padding: 12px 2vw 10px 2vw;
    }
    .upcoming-exam-card .countdown {
        font-size: 1.05rem;
        padding-left: 0;
        padding-right: 0;
    }
}
.tab-content.active#home {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
}
.upcoming-exam-card {
    align-self: center;
    margin-top: auto;
    margin-bottom: 32px;
}
.quick-stats-grid,
.main-exam-countdown-row,
#recentExamReview {
    align-self: stretch;
}
