/* --- Base Styles --- */
body {
    font-family: sans-serif;
    margin: 2em;
    background-color: #fdfdfd;
    color: #333;
    min-height: 100vh;
    box-sizing: border-box;
}
body.mobile-menu-open {
    overflow: hidden;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 0.7em;
    font-size: 2.2em;
    font-weight: bold;
}

.safsa-logo {
    height: 2.2em;
    width: auto;
    vertical-align: middle;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    background: #fff;
}

h1 {
    margin-bottom: 0.5em;
    color: #4a0e6b;
}
h2 {
    color: #555;
    margin-top: 0;
    margin-bottom: 1em;
    font-weight: normal;
}

header.main-header {
    position: relative; /* Keep for potential absolute children if needed */
    padding-bottom: 0.5em; /* Add some padding below header content */
    border-bottom: 2px solid #e0e0e0; /* Move border here */
    margin-bottom: 1.5em; /* Space below header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap if needed */
}

/* --- Desktop Menu Bar (inside .navigation-container) --- */
.navigation-container {
    width: 100%; /* Takes full width */
    order: 3; /* Ensure it comes after H2 and button in flex order */
    /* Desktop view: */
    display: block; /* Default display */
    transition: transform 0.3s ease-in-out;
}

.menu-bar {
    display: flex; /* This is the flex container for desktop links */
    flex-wrap: wrap;
    gap: 1.5em;
    margin-top: 0.5em; /* Add some space above menu on desktop */
}

.menu-link {
    text-decoration: none;
    color: #0056b3;
    font-weight: normal;
    font-size: 1.1em;
    padding: 0.2em 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.menu-link:hover {
    color: #4a0e6b;
    border-bottom-color: #d1abd8;
}
.menu-link.selected {
    font-weight: bold;
    color: #4a0e6b;
    border-bottom-color: #4a0e6b;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    /* Visual Styles (Keep these) */
    font-size: 0.95em;
    color: #666;
    background-color: #f4f4f4;
    padding: 0.5em 1em;
    border-radius: 4px;

    /* Layout Styles (Add/Ensure these are present) */
    width: 100%; /* Ensure breadcrumb takes full width */
    order: 4; /* Place below menu in the header's flex order */
    margin: 1.5em 0 0 0; /* Adjust top margin */
}

/* --- Other Breadcrumb Styles (Keep these too) --- */
.breadcrumb a.breadcrumb-link {
    color: #0056b3;
    text-decoration: none;
}
.breadcrumb a.breadcrumb-link:hover {
    text-decoration: underline;
}
.breadcrumb .sep {
    margin: 0 0.6em;
    color: #999;
}
.breadcrumb span:not(.sep) {
    font-weight: bold;
    color: #333;
}

/* --- Subfolder List Area --- */
#subfolders-list {
    margin-top: 1em;
    min-height: 50px;
}

/* --- Subfolder Table --- */
.subfolder-table { /* Styles remain the same */
    width: 100%; border-collapse: collapse; font-size: 0.95em;
}
/* ... other table styles ... */
.subfolder-table th, .subfolder-table td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; vertical-align: top; }
.subfolder-table thead th { background-color: #f2f2f2; font-weight: bold; color: #333; }
.subfolder-table tbody tr:nth-child(odd) { background-color: #f9f9f9; }
.subfolder-table tbody tr:hover { background-color: #eaf2fa; cursor: default; }
.subfolder-table tbody tr:hover a { cursor: pointer; }
.subfolder-table td:nth-child(1) { width: 65%; }
.subfolder-table td:nth-child(2), .subfolder-table td:nth-child(3) { width: 17.5%; white-space: nowrap; }
.subfolder-table a.subfolder-link { font-weight: bold; text-decoration: none; color: #0077cc; }
.subfolder-table a.subfolder-link:hover { text-decoration: underline; color: #0056b3; }


/* --- Fallback list styles --- */
#subfolders-list ul { /* Styles remain the same */
    list-style: none; padding-left: 1em;
}
/* ... other list styles ... */
#subfolders-list li { margin-bottom: 0.5em; }
#subfolders-list li a.subfolder-link, #subfolders-list li a.event-link { text-decoration: none; color: #0077cc; font-size: 1.05em; transition: color 0.2s ease; }
#subfolders-list li a.subfolder-link:hover, #subfolders-list li a.event-link:hover { text-decoration: underline; color: #0056b3; }


/* --- Results Viewer --- */
.results-viewer { /* Styles remain the same */
    margin-top: 1.5em; border: 1px solid #ccc; padding: 1.5em;
    background: #ffffff; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 4px; min-height: 100px;
}
/* ... other results viewer styles ... */
.results-viewer h1, .results-viewer h2, .results-viewer h3 { margin-top: 0; color: #333; }
.results-viewer table { width: 100%; border-collapse: collapse; margin-top: 1em; }
.results-viewer th, .results-viewer td { border: 1px solid #ddd; padding: 8px; text-align: left; }
.results-viewer th { background-color: #f2f2f2; }


/* --- Footer --- */
#footer { /* Styles remain the same */
    margin-top: 3em; padding-top: 1em; border-top: 1px solid #e0e0e0;
    font-size: 0.9em; color: #777; text-align: left; width: 100%;
}
#footer p { margin: 0.3em 0; text-align: left; }

/* --- Version Info --- */
.version-info { /* Styles remain the same */
    font-size: 0.8em; color: #aaa; text-align: left;
    margin-top: 0.5em; width: 100%;
}

.hamburger-button {
    display: none;
}

/* =================================== */
/* --- Hamburger Menu Styles START --- */
/* =================================== */

@media (max-width: 767px) {
    .hamburger-button {
        display: block;
        position: fixed;
        /* Always visible, even when scrolling */
        top: 18px;
        /* Adjust as needed */
        right: 18px;
        /* Adjust as needed */
        margin: 0;
        /* Remove any margin */
        order: initial;
        /* Remove flex order */
        z-index: 1100;
        /* Above the menu */
        background: #fff;
        /* Optional: white background for contrast */
        border: 1px solid #ccc;
        /* Optional: subtle border */
        border-radius: 4px;
        /* Optional: rounded corners */
        padding: 6px 10px;
        /* Optional: more clickable area */
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
        /* Optional: subtle shadow */
    }
}
/* --- Mobile Styles --- */
@media (max-width: 767px) {
    header.main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0.5em;
        position: relative;
        /* Add this */
    }

    header.main-header h2 {
        margin-bottom: 0;
        flex-grow: 1;
        order: 1;
    }

    .hamburger-button {
        display: block;
        order: 2;
        margin-left: auto;
        /* Push to right */
        margin-right: 18px;
        /* Add some spacing */
    }

    /* Alternative option - slide in from right instead of left */
    .navigation-container {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        top: 0;
        right: 0;
        /* Change from left: 0 to right: 0 */
        width: 250px;
        height: 100%;
        background-color: #f8f8f8;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
        /* Adjust shadow direction */
        padding-top: 20px;
        z-index: 1000;
        overflow-y: auto;
        border-left: 1px solid #ccc;
        /* Change from border-right */
        transition: opacity 0.3s, visibility 0.3s;
    }
}

        .navigation-container.active {
            visibility: visible;
            opacity: 1;
            pointer-events: auto;
        }

        /* --- Style the menu bar *inside* the active container --- */
        .navigation-container.active .menu-bar {
            display: flex;
            flex-direction: column;
            gap: 0;
            padding: 0;
            align-items: stretch;
            margin-top: 0;
        }

        /* --- Style links *inside* the active container --- */
        .navigation-container.active .menu-link {
            font-size: 1.1em;
            padding: 12px 20px;
            border-bottom: 1px solid #eee;
            width: 100%;
            font-weight: normal;
            color: #333;
            box-sizing: border-box;
            border-right: 4px solid transparent;
            /* Changed from border-left */
            transition: background-color 0.2s ease, border-right-color 0.2s ease;
            /* Updated property */
        }

        .navigation-container.active .menu-link:hover {
            background-color: #eee;
            color: #4a0e6b;
            border-bottom-color: #eee;
            border-right-color: #d1abd8;
            /* Changed from border-left-color */
        }

        .navigation-container.active .menu-link.selected {
            font-weight: bold;
            color: #4a0e6b;
            background-color: #e8d9ef;
            border-bottom-color: #e8d9ef;
            border-right-color: #4a0e6b;
            /* Changed from border-left-color */
        }

        /* Ensure breadcrumbs appear below the header area */
        .breadcrumb {
            margin-top: 1.5em;
            order: 4;
        }

/* =================================== */
/* --- Hamburger Menu Styles END --- */
/* =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    width: 90vw;
    height: 90vh;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    font-family: inherit;
}



#event-iframe {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2em;
    color: #666;
    cursor: pointer;
    z-index: 10;
}

@media (max-width: 600px) {
    .modal-content {
        width: 98vw;
        height: 98vh;
        max-width: 98vw;
        max-height: 98vh;
    }
}
#event-iframe {
    flex: 1 1 auto;
    width: 100%;
    min-height: 60vh;
    border: none;
    margin-top: 2.5em;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 0.5em 0.2em 0.2em 0.2em;
        max-width: 100vw;
        max-height: 100vh;
    }

    #event-iframe {
        min-height: 50vh;
    }
}

.popout-btn {
    background: #4a0e6b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.4em;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    transition: background 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    font-family: inherit;
}

.popout-btn:hover,
.popout-btn:focus {
    background: #6c2a8a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    outline: none;
}

.popout-icon svg {
    display: block;
}

.help-support-buttons {
    margin-bottom: 2em;
}

.help-btn {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.4em;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    transition: background 0.2s, box-shadow 0.2s;
}

.help-btn:hover,
.help-btn:focus {
    background: #125ea2;
}

.support-btn {
    background: #43a047;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.4em;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    transition: background 0.2s, box-shadow 0.2s;
}

.support-btn:hover,
.support-btn:focus {
    background: #2e7031;
}

.btn-icon {
    font-size: 1.3em;
    vertical-align: middle;
}

.small-modal .modal-content {
    width: 400px;
    max-width: 95vw;
    height: auto;
    max-height: 80vh;
    min-height: 200px;
    padding: 2em 1.5em 1.5em 1.5em;
    margin: 0 auto;
    font-family: 'Segoe UI', 'Arial', 'Liberation Sans', 'sans-serif';
}

@media (max-width: 600px) {

    .modal-content,
    .small-modal .modal-content {
        width: 98vw;
        max-width: 98vw;
        min-width: 0;
        padding: 0;
    }
}

.modal-iframe-body,
.modal-iframe-body * {
    font-family: 'Segoe UI', Arial, 'Liberation Sans', sans-serif !important;
}

.help-container,
.support-container {
    padding: 2em 1.5em 1.5em 1.5em;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    max-width: 420px;
    margin: 0 auto;
}

.help-header,
.support-header {
    display: flex;
    align-items: center;
    gap: 0.7em;
    margin-bottom: 1em;
}

.help-header-icon,
.support-header-icon {
    font-size: 2.2em;
    color: #1976d2;
    flex-shrink: 0;
}

.help-title,
.support-title {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.01em;
}

.support-header-icon {
    color: #43a047;
}

.support-title {
    color: #43a047;
}

.trigger-container {
    max-width: 420px;
    margin: 3em auto 2em auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 2em 2em 1.5em 2em;
}

.trigger-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #4a0e6b;
    margin-bottom: 0.7em;
    display: flex;
    align-items: center;
    gap: 0.7em;
}

.success {
    color: #43a047;
    font-weight: bold;
    margin-bottom: 1em;
}

.error {
    color: #b71c1c;
    font-weight: bold;
    margin-bottom: 1em;
}

label {
    display: block;
    margin-top: 1.2em;
    margin-bottom: 0.3em;
}

input[type="password"],
select {
    width: 100%;
    padding: 0.6em;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}



.help-container {
    padding: 2em 1.5em 1.5em 1.5em;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    max-width: 420px;
    margin: 2em auto 0 auto;
}

@media (max-width: 600px) {

    .trigger-container,
    .help-container {
        max-width: 98vw;
        padding: 1.2em 0.5em 1em 0.5em;
    }

    .trigger-title {
        font-size: 1.1em;
    }
}

.trigger-home-btn {
    margin-left: auto;
    margin-right: 0;
    background: #4a0e6b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4em 1.2em;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    transition: background 0.2s, box-shadow 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.trigger-home-btn:hover,
.trigger-home-btn:focus {
    background: #6c2a8a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    outline: none;
}