:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0ea5e9;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-border: rgba(203, 213, 225, 0.5);
    --grid-line: rgba(226, 232, 240, 0.8);
    --safe-area: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background: linear-gradient(rgba(240, 249, 255, 0.9), rgba(224, 242, 254, 0.9)), url('campus_unvm.jpg');
    background-size: cover;
    background-position: center 30%;
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--primary);
    padding: 1.1rem var(--safe-area);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-top-bar {
    background: rgba(15, 40, 120, 0.14);
    border-bottom: 1px solid rgba(37, 99, 235, 0.35);
    padding: 0.3rem var(--safe-area);
    margin: -1.1rem -1rem 0.6rem -1rem;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
}

.contact-info-prominent {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

/* New Compact Header Styles */
.official-email-large {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}
.official-email-large a {
    color: var(--primary);
    text-decoration: none;
}

.official-email-large span {
    font-family: 'Inter', sans-serif;
}

.social-links-large {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.social-links-large a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.social-links-large a:hover {
    color: var(--primary);
}

.header-main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
}

.vertical-nav-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    flex: 1;
}

.branding-group h1 {
    font-size: 1.3rem;
    margin: 0;
    color: var(--text-main);
    font-family: "Playfair Display", serif;
    font-weight: 800;
}

.subtitle-horarios {
    font-size: 0.92rem;
    color: #64748b;
    font-family: "Inter", sans-serif;
    margin: 0.1rem 0 0 0;
    font-weight: 500;
    font-style: italic;
}

.year-display-huge {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    font-family: "Playfair Display", serif;
    line-height: 1;
    margin-left: -2px;
}

.view-toggles-container-big {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    gap: 4px;
    flex-shrink: 0;
}

.toggle-btn-big {
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toggle-btn-big.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-search-bar-full {
    flex: 1;
    width: 100%;
}

.header-search-bar-full input {
    width: 100%;
    padding: 0.45rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: white;
    font-size: 0.82rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-auth-corner {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding-top: 1rem;
}

.semester-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.sem-tab-btn {
    padding: 0.3rem 0.7rem;
    border: none;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    white-space: nowrap;
}

.sem-tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Obsolete classes removed */

.tiny-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.tiny-btn:hover {
    background: var(--primary);
    color: white;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

#global-search {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: #f1f5f9;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.8rem center;
    background-size: 1rem;
}

#global-search:focus {
    background-color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* View Mode Selector */
.view-mode-selector {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.secondary-btn {
    background: white;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

/* Navigation Tabs Alignment */
#nav-tabs {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
    width: 100%;
}

#nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-item {
    padding: 0.6rem 1.6rem;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

main {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 var(--safe-area);
}

.schedule-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
}

.grid-header {
    display: flex;
    border-bottom: 2px solid var(--grid-line);
    background: #f8fafc;
}

.time-header {
    width: 70px;
    padding: 1.2rem 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    border-right: 2px solid var(--grid-line);
}

.day-headers {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.day-header {
    padding: 1.2rem 0;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    border-right: 2px solid var(--grid-line);
}

.day-header:last-child {
    border-right: none;
}

.grid-body {
    display: flex;
    position: relative;
    background: #fffef7;
}

.time-column {
    width: 70px;
    border-right: 2px solid var(--grid-line);
    background: #f8fafc;
}

.time-slot {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--grid-line);
}

.grid-content {
    flex: 1;
    position: relative;
    height: 810px;
}

.grid-bg-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--grid-line);
    pointer-events: none;
}

/* Event Cards */
.event-card {
    position: absolute;
    padding: 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    border-left: 5px solid rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: white;
    /* Fallback */
}

.event-card:hover {
    transform: scale(1.02);
    z-index: 50;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.event-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.event-info {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
    margin-top: 1px;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.admin-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-top: auto;
    font-style: italic;
}

.event-note {
    background: #fef08a;
    /* Soft yellow for sticky note */
    color: #854d0e;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 4px;
    border-left: 3px solid #eab308;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease;
    max-width: 90%;
    align-self: flex-start;
}

.fab {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.15) rotate(90deg);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal-content {
    background: white;
    margin: 5vh auto;
    padding: 1.4rem;
    width: 90%;
    max-width: 550px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content.draggable {
    position: absolute;
    margin: 0;
    max-width: 380px;
    padding-top: 0;
}

.modal-header-drag {
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    margin: 0 -2rem 1.5rem -2rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header-drag h2 {
    font-size: 1rem;
    margin: 0;
}

.modal-header-drag .close {
    position: static;
    font-size: 1.2rem;
}

.modal-content.small {
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close:hover {
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    font-size: 1rem;
    resize: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.delete-btn {
    padding: 1rem;
    background: #fff1f2;
    color: #e11d48;
    border: 2px solid #ffe4e6;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    flex: 0.5;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.error-msg {
    color: #e11d48;
    background: #fff1f2;
    padding: 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1.5rem 0;
    border: 2px solid #ffe4e6;
    text-align: center;
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn.danger {
    color: #e11d48;
}

.icon-btn.danger:hover {
    background: #fff1f2;
}

.config-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.config-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.mode-btn.full {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
    margin: 0;
}

.mode-btn.secondary {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.mode-btn.secondary:hover {
    background: #eff6ff;
}

.delete-btn.full {
    width: 100%;
    margin-top: 1rem;
}

#config-open-btn {
    color: var(--text-muted);
}

#config-open-btn:hover {
    color: var(--primary);
    background: #f1f5f9;
}

@media (max-width: 1000px) {
    h1 {
        font-size: 1rem;
    }

    h1 span {
        font-size: 1.1rem;
    }

    .day-header {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    h1 {
        max-width: 100%;
    }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    z-index: 50;
    backdrop-filter: blur(4px);
}
/* Professor Management UI */
.config-professor-management {
    margin-top: 1rem;
}

.config-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.add-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-input-group input {
    flex: 1;
    padding: 0.8rem;
    font-size: 0.9rem;
}

.config-scroll-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    background: white;
}

.config-scroll-list::-webkit-scrollbar {
    width: 6px;
}

.config-scroll-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.manage-item span {
    font-size: 0.85rem;
    font-weight: 500;
}

.delete-btn-small {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.delete-btn-small:hover {
    background: #fecaca;
    color: #dc2626;
}

.icon-btn.success {
    background: #dcfce7;
    color: #16a34a;
    border: none;
    border-radius: 10px;
    padding: 0 1rem;
    font-size: 1.5rem;
    width: 48px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.icon-btn.success:hover {
    background: #bbf7d0;
}

/* Year + Semester on same row */
.year-semester-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Año/Aula + Search on same row */
.view-search-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}
/* Year + Semester on same row */
.year-semester-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Año/Aula + Search on same row */
.view-search-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.view-search-row .header-search-bar-full {
    flex: 1;
}

/* Smaller entry modal */
.modal-content.draggable form {
    font-size: 0.85rem;
}

.modal-content.draggable input,
.modal-content.draggable select,
.modal-content.draggable textarea {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

.modal-content.draggable .form-group {
    margin-bottom: 0.9rem;
}

.modal-content.draggable label {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
}

.modal-content.draggable .submit-btn,
.modal-content.draggable .delete-btn {
    padding: 0.7rem;
    font-size: 0.85rem;
}

.modal-content.draggable .form-actions {
    margin-top: 1.2rem;
}
/* PDF Download Button */
.pdf-download-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pdf-download-btn:hover {
    background: #ffedd5;
    border-color: #fb923c;
    transform: translateY(-1px);
}

/* ===== PRINT / PDF STYLES — A4 Landscape ===== */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 8mm;
    }

    /* Hide everything except the schedule */
    body > * { display: none; }
    #app { display: block !important; }
    header,
    .fab,
    .modal,
    footer,
    .header-auth-corner,
    .pdf-download-btn,
    #global-search,
    .view-search-row,
    .year-semester-row,
    .branding-group,
    .subtitle-horarios,
    .header-top-bar,
    nav#nav-tabs { display: none !important; }

    main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .schedule-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        border-radius: 0 !important;
        width: 100% !important;
        page-break-inside: avoid;
    }

    .grid-content {
        height: auto !important;
        min-height: 150mm;
    }

    .event-card {
        box-shadow: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Print header with title + year */
    .schedule-container::before {
        content: attr(data-print-title);
        display: block;
        font-size: 11pt;
        font-weight: bold;
        padding: 4mm 0 2mm;
        border-bottom: 1px solid #ccc;
        margin-bottom: 2mm;
    }
}

/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 992px) {
    .contact-info-prominent {
        gap: 1rem;
    }
    .social-links-large {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    header { padding: 0.5rem var(--safe-area) !important; }
    .vertical-nav-stack { gap: 0.3rem !important; }
    
    :root {
        --safe-area: 0.8rem;
    
}

    /* Top Bar */
    .header-top-bar {
        padding: 0.5rem var(--safe-area);
    }
    .top-bar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    .contact-info-prominent {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .top-bar-divider {
        display: none !important;
    }

    /* Main Header */
    header {
        padding: 0.8rem var(--safe-area);
    }
    .header-main-content {
        flex-direction: column;
        align-items: stretch;
    }
    .header-auth-corner {
        order: -1;
        justify-content: flex-end;
        padding-top: 0;
        margin-bottom: 0.5rem;
    }
    .year-semester-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .view-search-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    .branding-group h1 { font-size: 1.1rem; }
    .year-display-huge { font-size: 2.2rem; }

    /* Schedule Grid - The core of mobile view */
    .schedule-container {
        overflow-x: auto; /* Enable horizontal scroll */
        -webkit-overflow-scrolling: touch;
    }
    .grid-header, .grid-body {
        min-width: 800px; /* Force minimum width to keep calendar readable */
    }

    /* Nav Tabs */
    nav#nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
        padding: 1rem !important;
    }
    .modal-content.draggable {
        max-width: 95% !important;
        margin-top: 5% !important;
        left: 2.5% !important;
        top: 2.5% !important;
        transform: none !important;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group.half {
        width: 100%;
    }

    /* FAB adjustment */
    .fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .official-email-large { font-size: 0.75rem; }
    .year-display-huge { font-size: 1.8rem; }
    .view-toggles-container-big, .semester-tabs {
        width: 100%;
    }
    .toggle-btn-big, .sem-tab-btn {
        flex: 1;
        justify-content: center;
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    header { padding: 0.5rem var(--safe-area) !important; }
    .vertical-nav-stack { gap: 0.3rem !important; }
    
    .event-card {
        padding: 4px !important;
    
}
    .event-title {
        font-size: 0.75rem !important;
        line-height: 1.1;
    }
    .event-info {
        font-size: 0.65rem !important;
    }
}
