/* Sticky header styles */
.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: lightslategray;
    color: #ffffff;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.admin-navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    gap: 15px;
}

.admin-welcome-text {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    color: #f1f5f9;
}

/* Environment Toggle Container & Switch Styles */
.env-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.env-main-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f1f5f9;
}

.env-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.env-toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.env-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

    .env-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.env-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #28a745; /* Green for Prod */
    transition: background-color 0.3s ease;
    border-radius: 22px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

    .env-slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
        background-color: #ffffff;
        transition: transform 0.3s ease;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

/* Switch Active State (Test Environment) */
.env-switch input:checked + .env-slider {
    background-color: #d97706; /* Warning amber/orange for Test */
}

    .env-switch input:checked + .env-slider:before {
        transform: translateX(22px);
    }

.admin-nav-links {
    display: flex;
    gap: 15px;
}

.admin-link {
    color: floralwhite;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .admin-link:hover {
        background-color: darkgreen;
        color: yellow;
        text-decoration: underline;
    }

.admin-link-active {
    background-color: darkgreen;
    color: white;
    text-decoration: underline;
}

/* Pushes main layout down when admin bar is visible to prevent overlapping */
body.has-admin-bar {
    padding-top: 45px;
}

.admin-welcome-text{
    text-decoration: underline;
    cursor: pointer;
}

.swal2-html-container,
.swal2-content {
    text-align: left !important;
}

/* ==========================================================================
   MEDIA QUERIES (MOBILE RESPONSIVENESS)
   ========================================================================== */
@media (max-width: 600px) {
    .admin-navbar-container {
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-welcome-text {
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
    }
    /* Force environment toggle onto its own line in the middle */
    .env-toggle-container {
        width: 100%;
        justify-content: center;
        margin: 2px 0;
    }

    .env-main-label,
    .env-toggle-label {
        font-size: 0.75rem;
    }

    .env-switch {
        width: 38px;
        height: 20px;
    }

    .env-slider:before {
        height: 14px;
        width: 14px;
    }

    .env-switch input:checked + .env-slider:before {
        transform: translateX(18px);
    }

    .admin-nav-links {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .admin-link {
        font-size: 0.8rem;
        padding: 2px 6px;
    }
    /* Adjust body padding for mobile to accommodate 3-row stacked navbar */
    body.has-admin-bar {
        padding-top: 85px;
    }
}
