/* public/css/admin-style.css (Validated Golden Copy) */

/* --- 1. General & Variables --- */
/* #admin-page { */
:root {
    --dark-green: #3D553A;
    --primary-green: #7CA46B;
    --accent-orange: #F98866;
    --headline-accent-color: #F98866;
    --font-display: 'Bungee', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --dark-text-shadow: rgba(0, 0, 0, 0.2);
}
* {
    font-family: var(--font-body), sans-serif;
    padding: 0; margin: 0; box-sizing: border-box;
    text-decoration: none; list-style: none;
}
body {
    background-color: var(--dark-green);
    color: #fff;
    overflow-x: hidden;
}
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.hidden { display: none; }

/* --- 2. Uniform Admin Header --- */
/* .admin-header-container {
    width: 100%;
    padding: 20px 5%;
    background-color: var(--dark-green);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-header-container .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header-container .logo h1 {
    font-family: var(--font-display);
    color: var(--headline-accent-color);
    text-shadow: 2px 2px 2px var(--dark-text-shadow);
    line-height: 1.1;
    font-size: clamp(1.2rem, 4vw, 2rem);
}
.admin-header-container .navbar {
    display: block;
}
.admin-header-container .navbar ul {
    display: flex;
    gap: 40px;
}
.admin-header-container .navbar ul li a {
    font-family: var(--font-display);
    color: var(--primary-green);
    text-shadow: 2px 2px 2px var(--dark-text-shadow);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    padding: 5px 0;
    transition: color 0.3s;
}
.admin-header-container .navbar ul li a:hover {
    color: #fff;
} */

/* --- 3. Uniform Admin Form Styles --- */
.form-wrapper {
    background-color: rgba(0,0,0,0.2);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}
.form-wrapper h2 {
    font-family: var(--font-display);
    color: var(--accent-orange);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}
.styled-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    max-width: 500px;
    margin: auto;
}
.styled-form .input-group {
    display: flex;
    flex-direction: column;
}
.styled-form label {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.styled-form input,
.styled-form select {
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,0.4);
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #fff;
}
.styled-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.styled-form select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 1em;
}
.styled-form select option {
    color: #333;
    background-color: #fff;
}
.styled-form .form-button {
    margin-top: 1rem;
    background-color: var(--accent-orange);
    color: #fff;
    padding: 15px 30px;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    align-self: flex-start;
}
.form-message {
    text-align: center;
    margin-top: 1rem;
    font-weight: bold;
    min-height: 1.2em;
}
.form-link {
    text-align: center;
    margin-top: 1rem;
}
.form-link a {
    color: var(--accent-orange);
    text-decoration: underline;
}

/* --- 4. Optional Light Theme for Forms --- */
.form-wrapper.form-light-theme {
    background-color: #fff;
    color: #333;
}
.form-wrapper.form-light-theme h2 {
    color: var(--dark-green);
}
.form-wrapper.form-light-theme .styled-form label {
    color: #555;
}
.form-wrapper.form-light-theme .styled-form input,
.form-wrapper.form-light-theme .styled-form select {
    color: #333;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
}
.form-wrapper.form-light-theme .styled-form input::placeholder {
    color: #999;
}
.form-wrapper.form-light-theme .styled-form select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* --- 5. QR Scanner Page Specific Styles --- */
#scanner-wrapper {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
#scanner-wrapper h1 {
    color: var(--dark-green);
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}
#scanner-wrapper p {
    color: #333;
}
#qr-reader { width: 100%; max-width: 500px; border: 1px solid #ccc; margin-bottom: 20px; }
#scan-result { margin-top: 20px; padding: 15px; border: 1px solid transparent; border-radius: 5px; min-width: 300px; max-width: 500px; text-align: left; }
#scan-result.success { border-color: green; background-color: #e6ffe6; color: green; }
#scan-result.error { border-color: red; background-color: #ffe6e6; color: red; }
#scan-result h3 { margin-top: 0; color: #333; }
button#startButton { padding: 10px 20px; font-size: 16px; cursor: pointer; margin-bottom: 20px; }
#stopButton { display: none; margin-top: 10px; padding: 8px 15px; background-color: #ffc107; border: none; border-radius: 4px; cursor: pointer; }
#confirm-attendance-btn { margin-top: 15px; padding: 12px 25px; font-size: 16px; font-weight: bold; cursor: pointer; background-color: #28a745; color: white; border: none; border-radius: 5px; transition: background-color 0.2s; }
#confirm-attendance-btn:hover { background-color: #218838; }
#confirm-attendance-btn:disabled { background-color: #ccc; cursor: not-allowed; }


/* --- Main Header Container --- */
/* =================================================================== */
/* === FINAL, DEFINITIVE ADMIN HEADER STYLES ========================= */
/* =================================================================== */

/* --- Main Header Container --- 
header.header-container.admin-header {
    padding: 20px 5%;
    background-color: var(--dark-green);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; 
}

/* --- Logo Styling --- 
.admin-header .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.admin-header .logo h1 {
    font-family: var(--font-display);
    color: var(--headline-accent-color);
    font-size: clamp(1.5rem, 4vw, 2rem);
    white-space: nowrap;
}

/* --- Desktop Navbar --- 
.admin-header nav.navbar {
    margin-left: auto; /* Pushes nav to the right 
}
.admin-header nav.navbar ul {
    display: flex;
    gap: 40px;
}
.admin-header nav.navbar ul li a {
    font-family: var(--font-display);
    color: var(--primary-green);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* --- Hamburger Menu Button --- 
.admin-header button.hamburger-menu {
    background: none;
    border: none;
    color: var(--primary-green);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
}

/* --- Mobile Navigation Flyout --- 
.mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--dark-green);
    z-index: 1000;
    padding: 20px;
}
.mobile-nav.active {
    display: block;
}
.mobile-nav ul {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.mobile-nav ul li a {
    font-family: var(--font-display);
    color: white;
    font-size: 1.5rem;
}
.mobile-nav .close-menu-btn {
    position: absolute;
    top: 20px; right: 5%;
    background: none; border: none;
    color: var(--primary-green);
    font-size: 2rem;
    cursor: pointer;
}

/* --- Responsive Breakpoints --- 

/* DESKTOP STYLES (screens wider than 800px) 
@media (min-width: 801px) {
    .admin-header .hamburger-menu {
        display: none; /* Hide hamburger on desktop 
    }
    .mobile-nav {
        display: none !important; /* Ensure mobile panel is never visible 
    }
}

/* MOBILE STYLES (screens 800px wide or less) 
@media (max-width: 800px) {
    .admin-header .navbar {
        display: none; /* Hide desktop nav on mobile 
    }
    .admin-header button.hamburger-menu {
        display: block; /* THIS IS THE CRITICAL FIX: Show hamburger on mobile 
        position: absolute;
        right: 5%;
    }
    .admin-header .header-top-row {
        justify-content: center; /* Center the logo relative to the viewport 
    }
}
*/

/* --- Base Header & Mobile Styles --- */
/* --- Base Header & Mobile Styles --- */
.admin-header {
    padding: 20px 5%;
    background-color: var(--dark-green);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-header .header-top-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the logo on mobile */
}
.admin-header .logo a {
    text-decoration: none;
}
.admin-header .logo h1 {
    font-family: var(--font-display);
    color: var(--headline-accent-color);
    font-size: clamp(1.5rem, 4vw, 2rem);
    white-space: nowrap; margin: 0;
}
.admin-header .navbar {
    display: none; /* Hide desktop nav on mobile */
}
.admin-header .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: absolute;
    right: 0;
    background: none; border: none;
    color: var(--primary-green);
    font-size: 1.8rem; cursor: pointer; z-index: 1001;
}

/* --- Mobile Flyout Panel --- */
.mobile-nav {
    display: none;
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--dark-green); z-index: 1000;
}
.mobile-nav.nav-active {
    display: block; /* This matches your main.js file */
}
.mobile-nav ul { padding-top: 80px; display: flex; flex-direction: column; align-items: center; gap: 30px; }
.mobile-nav ul a { font-family: var(--font-display); color: white; font-size: 1.5rem; text-decoration: none; }
.mobile-nav .close-menu-btn { position: absolute; top: 25px; right: 5%; background: none; border: none; color: var(--primary-green); font-size: 2rem; cursor: pointer; }

/* =================================================================== */
/* === FIX: Responsive Styling for Admin Hub Page ================== */
/* =================================================================== */

.admin-hub-container {
    text-align: center;
    padding: 4rem 1rem; /* Use 1rem padding on the sides for mobile */
}

.admin-hub-container h1 {
    font-family: var(--font-display);
    /* color: var(--accent-orange); */
    color: grey;

    /* --- THIS IS THE FIX --- */
    /* This new clamp() value starts smaller and grows more aggressively, */
    /* ensuring the word "Administration" fits on mobile screens. */
    /* Min size: 1.8rem, Ideal size: 10vw, Max size: 4rem */
    font-size: clamp(1.8rem, 10vw, 4rem);

    margin-bottom: 1rem;
}

.admin-hub-container p {
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* =================================================================== */
/* === FIX: Styling for the Admin Hub Image ======================== */
/* =================================================================== */

.admin-hub-image {
    display: block;         /* This is key for centering with margin */
    width: 100%;            /* Makes the image responsive */
    max-width: 500px;       /* Sets the maximum size to 500px (adjust as needed) */
    margin: 2rem auto;      /* Centers the image horizontally with space above/below */
    border-radius: 8px;     /* Optional: adds nice rounded corners */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Optional: adds a subtle shadow */
}


/* --- Desktop Styles (screens wider than 800px) --- */
/* --- Desktop Styles (screens wider than 801px) --- */
/* --- Desktop Styles (screens wider than 801px) --- */
@media (min-width: 801px) {
    /* Arrange header items with space between them */
    .admin-header .header-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Keep the logo on the left */
    .admin-header .logo {
        position: static;
        transform: none;
    }

    /* Show the desktop nav container */
    .admin-header .navbar {
        display: flex;
    }

    /* Make the list of links HORIZONTAL */
    .admin-header .navbar ul {
        display: flex;
        gap: 40px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* THIS IS THE FIX: Re-apply the Bungee font and color to the links */
    .admin-header .navbar a {
        font-family: var(--font-display);
        color: var(--primary-green);
        text-decoration: none;
    }
    
    /* Hide the hamburger menu */
    .admin-header .hamburger-menu {
        display: none;
    }
}