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

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e1b2e 0%, #2d1b3d 30%, #4c1d4f 60%, #6b21a8 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
    color: #e2e8f0;
    width: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.has-nav {
    display: block;
    padding: 0;
}

/* Snowflakes Animation */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    color: rgba(196, 181, 253, 0.6);
    font-size: 1.5em;
    animation: snowfall linear infinite;
    opacity: 0.5;
    will-change: transform;
    transform: translateZ(0);
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 30%; animation-duration: 12s; animation-delay: 1s; }
.snowflake:nth-child(3) { left: 50%; animation-duration: 14s; animation-delay: 2s; }
.snowflake:nth-child(4) { left: 70%; animation-duration: 11s; animation-delay: 0.5s; }
.snowflake:nth-child(5) { left: 90%; animation-duration: 13s; animation-delay: 1.5s; }

@keyframes snowfall {
    0% {
        transform: translate3d(0, -100px, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translate3d(0, 100vh, 0) rotate(360deg);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
}

.login-card, .result-card {
    background: rgba(30, 27, 46, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(168, 85, 247, 0.2) inset,
                0 0 40px rgba(147, 51, 234, 0.15);
    animation: slideUp 0.5s ease-out;
    will-change: transform;
    transform: translateZ(0);
    border: 1px solid rgba(168, 85, 247, 0.15);
}

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

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 3em;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}

.subtitle {
    color: #c4b5fd;
    font-size: 0.9em;
    font-weight: 500;
    letter-spacing: 1px;
}

.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #c4b5fd;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: rgba(45, 27, 61, 0.6);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
}

.form-group input:focus {
    outline: none;
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2),
                0 0 20px rgba(147, 51, 234, 0.4);
    background: rgba(45, 27, 61, 0.8);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 50%, #6b21a8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4),
                0 0 20px rgba(147, 51, 234, 0.2);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5),
                0 0 30px rgba(147, 51, 234, 0.3);
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #9333ea 100%);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-message {
    margin-top: 20px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.9em;
    text-align: center;
    backdrop-filter: blur(10px);
}

.result-card {
    margin-top: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
}

.result-header h2 {
    color: #c4b5fd;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #c4b5fd;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: rotate(90deg);
    color: #c084fc;
}

.result-content {
    color: #e2e8f0;
    font-size: 0.95em;
    line-height: 1.6;
}

.result-content pre {
    background: rgba(45, 27, 61, 0.6);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(168, 85, 247, 0.2);
    font-size: 0.85em;
    backdrop-filter: blur(10px);
    color: #d1d5db;
}

.result-content .info-item {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(147, 51, 234, 0.15);
    border-radius: 6px;
    border-left: 3px solid #c084fc;
    backdrop-filter: blur(10px);
}

.result-content .info-label {
    font-weight: 600;
    color: #c4b5fd;
    margin-right: 8px;
}

/* Grades page specific styles */
.year-section {
    margin-bottom: 50px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

#gradesContent {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

.year-header {
    color: #c4b5fd;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #c084fc;
    font-size: 1.5em;
}

.term-section {
    margin-bottom: 30px;
    margin-left: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.term-header {
    color: #c4b5fd;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
    font-size: 1.2em;
}

.year-level-badge {
    font-size: 0.85em;
    font-weight: normal;
    color: #a78bfa;
}

.gwa-badge {
    font-size: 0.9em;
    font-weight: 600;
    color: #c084fc;
    margin-left: 15px;
    padding: 4px 12px;
    background: rgba(147, 51, 234, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    backdrop-filter: blur(5px);
}

.grades-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.grades-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.grades-table-wrapper::-webkit-scrollbar-track {
    background: rgba(30, 27, 46, 0.3);
    border-radius: 4px;
}

.grades-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 4px;
}

.grades-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.7);
}

.grades-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed; /* Fixed layout for better control */
    min-width: 600px; /* Ensure table has minimum width for scrolling */
}

.grades-table thead tr {
    background: rgba(147, 51, 234, 0.15);
    backdrop-filter: blur(10px);
}

.grades-table th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #c084fc;
    color: #c4b5fd;
    white-space: nowrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Column width definitions for table headers */
.grades-table th:nth-child(1) { width: 10%; } /* Course Code */
.grades-table th:nth-child(2) { width: 30%; } /* Course Title */
.grades-table th:nth-child(3) { width: 6%; } /* Units */
.grades-table th:nth-child(4) { width: 8%; } /* Midterm */
.grades-table th:nth-child(5) { width: 8%; } /* Final */
.grades-table th:nth-child(6) { width: 10%; } /* Final Grade */
.grades-table th:nth-child(7) { width: 10%; } /* Status */
.grades-table th:nth-child(8) { width: 18%; } /* Professor */

.grades-table th.text-center {
    text-align: center;
}

.grades-table tbody tr {
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    transition: background 0.2s ease;
}

.grades-table tbody tr:hover {
    background: rgba(147, 51, 234, 0.1);
}

.grades-table td {
    padding: 12px;
    color: #e2e8f0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
    overflow: hidden;
}

.grades-table td.text-center {
    text-align: center;
    white-space: nowrap;
}

.course-code {
    font-weight: 600;
    color: #c084fc;
    white-space: nowrap;
    max-width: 120px;
}

.final-grade {
    font-weight: 600;
    color: #c084fc;
    white-space: nowrap;
}

.professor-name {
    font-size: 0.9em;
    color: #cbd5e1;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Course title column - allow wrapping */
.grades-table td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
}

/* Course code column */
.grades-table td:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Units, Midterm, Final, Final Grade columns - center aligned, no wrap */
.grades-table td:nth-child(3),
.grades-table td:nth-child(4),
.grades-table td:nth-child(5),
.grades-table td:nth-child(6) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status column */
.grades-table td:nth-child(7) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Professor column - last */
.grades-table td:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
}

.status-passed {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    backdrop-filter: blur(5px);
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    backdrop-filter: blur(5px);
}

.professor-name {
    font-size: 0.9em;
    color: #cbd5e1;
}

.grades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px; /* Minimum touch target size */
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 160px;
    width: 160px;
    text-align: center;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.5),
                0 0 20px rgba(147, 51, 234, 0.2);
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.year-indicator {
    color: #c4b5fd;
    font-weight: 600;
    padding: 0 10px;
    font-size: 0.95em;
    white-space: nowrap;
    flex-shrink: 0;
}

.no-grades {
    color: #c4b5fd;
    text-align: center;
    padding: 40px;
}

/* Navigation Bar Styles */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(30, 27, 46, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.3));
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-link {
    padding: 10px 20px;
    color: #c4b5fd;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95em;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background: rgba(147, 51, 234, 0.2);
    color: #c084fc;
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(147, 51, 234, 0.3);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.nav-logout {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: white !important;
    box-shadow: 0 2px 10px rgba(147, 51, 234, 0.3);
}

.nav-logout:hover {
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
    color: white !important;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4);
    transform: translateY(-2px);
}

/* About Page Styles */
.about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.about-content {
    background: rgba(30, 27, 46, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(168, 85, 247, 0.2) inset,
                0 0 40px rgba(147, 51, 234, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.15);
    color: #e2e8f0;
}

.about-content h1 {
    color: #c084fc;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-align: center;
}

.about-content h2 {
    color: #c4b5fd;
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
    padding-bottom: 10px;
}

.about-content h3 {
    color: #c084fc;
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.about-section {
    margin-bottom: 30px;
}

.about-section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #e2e8f0;
}

.info-card {
    background: rgba(147, 51, 234, 0.1);
    border-left: 3px solid #c084fc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.info-card h3 {
    margin-top: 0;
}

.features-list,
.steps-list {
    color: #e2e8f0;
    line-height: 2;
    padding-left: 20px;
}

.features-list li,
.steps-list li {
    margin-bottom: 10px;
}

.steps-list li strong {
    color: #c084fc;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-container {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .nav-brand {
        font-size: 1.3em;
        margin-bottom: 10px;
        width: 100%;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 5px;
    }

    .nav-link {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.85em;
        text-align: center;
        justify-content: center;
    }

    .about-container {
        padding: 20px 15px;
    }

    .about-content {
        padding: 25px 20px;
    }

    .about-content h1 {
        font-size: 2em;
    }

    .about-content h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 10px 12px;
    }

    .nav-brand {
        font-size: 1.2em;
    }

    .nav-links {
        flex-direction: column;
        gap: 8px;
    }

    .nav-link {
        width: 100%;
        padding: 12px;
    }

    .about-content {
        padding: 20px 15px;
    }

    .about-content h1 {
        font-size: 1.8em;
    }

    .about-content h2 {
        font-size: 1.3em;
    }

    .about-content h3 {
        font-size: 1.1em;
    }

    .info-card {
        padding: 15px;
    }
}

/* Tablet styles */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        max-width: 100%;
    }

    .login-card, .result-card {
        padding: 30px 25px;
    }

    .grades-container {
        padding: 15px;
    }

    .user-header, .grades-content {
        padding: 20px;
    }

    .user-info {
        grid-template-columns: 1fr;
    }

    .grades-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .pagination-nav {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .pagination-btn {
        flex: 0 1 auto;
        padding: 12px 18px;
        font-size: 0.85em;
        min-width: 140px;
        width: 140px;
        text-align: center;
    }

    .year-indicator {
        font-size: 0.9em;
        padding: 0 8px;
    }

    .grades-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .grades-table {
        min-width: 600px;
        font-size: 0.9em;
        width: 100%;
    }

    .grades-table th,
    .grades-table td {
        padding: 10px 8px;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .login-card, .result-card {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .logo h1 {
        font-size: 2.5em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .login-btn {
        padding: 16px;
        font-size: 1em;
    }

    .snowflakes {
        display: none; /* Disable snowflakes on mobile for better performance */
    }

    .grades-container {
        padding: 10px;
    }

    .user-header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .user-header h2 {
        font-size: 1.3em;
    }

    .info-box {
        padding: 12px;
    }

    .info-label {
        font-size: 0.8em;
    }

    .info-value {
        font-size: 0.95em;
    }

    .logout-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.95em;
    }

    .grades-content {
        padding: 20px 15px;
    }

    .grades-header h2 {
        font-size: 1.4em;
    }

    .pagination-nav {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .pagination-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
        max-width: calc(50% - 4px);
        padding: 12px 10px;
        font-size: 0.85em;
        text-align: center;
        width: auto;
    }

    .year-indicator {
        order: 3;
        width: 100%;
        text-align: center;
        padding: 8px 0;
        font-size: 0.85em;
        flex-basis: 100%;
    }

    .year-header {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .term-section {
        margin-left: 0;
        margin-bottom: 25px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .term-header {
        font-size: 1.1em;
        margin-bottom: 12px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .gwa-badge {
        font-size: 0.8em;
        margin-left: 0;
        padding: 3px 10px;
    }

    .grades-table-wrapper {
        margin: 0 -15px;
        padding: 0 15px;
        width: calc(100% + 30px);
        max-width: calc(100% + 30px);
    }

    .grades-table {
        min-width: 700px;
        font-size: 0.85em;
        width: 100%;
    }

    .grades-table th,
    .grades-table td {
        padding: 10px 6px;
        font-size: 0.85em;
    }

    .grades-table th {
        font-size: 0.85em;
        white-space: nowrap;
    }

    /* Mobile column adjustments */
    .grades-table th:nth-child(1),
    .grades-table td:nth-child(1) {
        width: 12%;
    }
    .grades-table th:nth-child(2),
    .grades-table td:nth-child(2) {
        width: 28%;
        font-size: 0.8em;
    }
    .grades-table th:nth-child(3),
    .grades-table td:nth-child(3),
    .grades-table th:nth-child(4),
    .grades-table td:nth-child(4),
    .grades-table th:nth-child(5),
    .grades-table td:nth-child(5),
    .grades-table th:nth-child(6),
    .grades-table td:nth-child(6) {
        width: 7%;
        font-size: 0.8em;
    }
    .grades-table th:nth-child(7),
    .grades-table td:nth-child(7) {
        width: 10%;
        font-size: 0.75em;
    }
    .grades-table th:nth-child(8),
    .grades-table td:nth-child(8) {
        width: 18%;
        font-size: 0.75em;
    }

    .course-code {
        font-size: 0.9em;
    }

    .status-badge {
        font-size: 0.75em;
        padding: 3px 6px;
    }

    .professor-name {
        font-size: 0.8em;
    }

    .no-grades {
        padding: 30px 20px;
        font-size: 0.95em;
    }

    .error-message {
        font-size: 0.85em;
        padding: 12px;
    }

    .result-header h2 {
        font-size: 1.3em;
    }

    .result-content {
        font-size: 0.9em;
    }

    .result-content pre {
        font-size: 0.75em;
        padding: 12px;
    }
}

/* Small mobile devices */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 2em;
    }

    .login-card, .result-card {
        padding: 20px 15px;
    }

    .form-group input {
        padding: 12px 14px;
    }

    .login-btn {
        padding: 14px;
    }

    .user-header,
    .grades-content {
        padding: 15px 12px;
    }

    .grades-table {
        min-width: 650px;
        font-size: 0.8em;
        width: 100%;
    }

    .grades-table th,
    .grades-table td {
        padding: 8px 4px;
    }

    .pagination-nav {
        gap: 6px;
        justify-content: center;
    }

    .pagination-btn {
        flex: 1 1 calc(50% - 3px);
        min-width: calc(50% - 3px);
        max-width: calc(50% - 3px);
        padding: 10px 8px;
        font-size: 0.8em;
        text-align: center;
        width: auto;
    }

    .year-indicator {
        font-size: 0.8em;
        padding: 6px 0;
    }
}

