/* Green Bowl Foods - Final Stable Version */
:root {
    /* Your HTML needs this to paint "Foods" green */
    --primary-green: #10b981;
    /* Theme Variables */
    --brand-primary: #10b981;
    --brand-hover: #059669;
    --brand-glow: rgba(16, 185, 129, 0.4);
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-subtle: rgba(255, 255, 255, 0.08);
}

/* --- STABILITY FIX (The Magic) --- */
html {
    scrollbar-gutter: stable; /* Reserves scroll space so layout doesn't jump */
}

body {
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg-main) 100%);
    color: var(--text-main);
    font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    /* KEY CHANGE: We use 'dvh' for maximum stability on Edge and Mobiles */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

    /* --- Main Layout (Pushes the footer) --- */
    body > .container {
        flex: 1; /* Occupies all available space */
        width: 100%;
        display: flex;
        flex-direction: column;
        padding-bottom: 2rem; /* Breathing room before the footer */
    }

footer {
    margin-top: auto; /* Sticks gently to the bottom */
    width: 100%;
}

/* --- Navbar (Green Identity) --- */
.navbar {
    background: linear-gradient(90deg, #064e3b 0%, #065f46 100%) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar-brand {
    font-weight: 800;
    color: #ffffff; /* No !important so the green span works */
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

    .navbar-brand span {
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    }

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: 0.3s;
    font-weight: 500;
}

    .nav-link:hover {
        color: #a3e635 !important;
        transform: translateY(-1px);
        text-shadow: 0 0 10px rgba(163, 230, 53, 0.5);
    }

/* --- Cards and Login --- */
.card, .card-login {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
}

.card-header, .login-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.5rem;
}

/* --- Inputs --- */
.form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 10px;
}

    .form-control:focus {
        background: rgba(15, 23, 42, 0.8);
        border-color: var(--brand-primary);
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
        color: white;
    }

/* --- Buttons --- */
.btn-primary {
    background: var(--brand-primary);
    border: none;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px var(--brand-glow);
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        background: var(--brand-hover);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px var(--brand-glow);
    }

.btn-back-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

    .btn-back-custom:hover {
        background: rgba(16, 185, 129, 0.1);
        border-color: var(--brand-primary);
        color: white;
        transform: translateY(-2px);
    }

.btn-logout-custom {
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    background: transparent;
    border-radius: 50px;
    padding: 5px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .btn-logout-custom:hover {
        background-color: rgba(220, 38, 38, 0.8);
        border-color: transparent;
        color: white;
        box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
        transform: translateY(-1px);
    }

/* --- Glass Tables --- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 1rem;
}

    .table thead th {
        background-color: rgba(6, 78, 59, 0.4);
        color: #a3e635;
        border: none;
        text-transform: uppercase;
        font-size: 0.85rem;
        letter-spacing: 1px;
        padding: 15px;
    }

    .table tbody tr {
        background-color: rgba(30, 41, 59, 0.5);
        transition: all 0.3s ease;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

        .table tbody tr:hover {
            background-color: rgba(16, 185, 129, 0.15);
            transform: scale(1.01);
        }

    .table td {
        border: none;
        padding: 15px;
        vertical-align: middle;
        color: rgba(255, 255, 255, 0.9);
    }

    .table tbody tr td:first-child {
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
    }

    .table tbody tr td:last-child {
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    /* Action buttons in table */
    .table a {
        text-decoration: none;
        padding: 5px;
        transition: 0.2s;
    }

        .table a:hover {
            filter: brightness(1.2);
            transform: scale(1.1);
        }

/* --- Heartbeat Animation (Needed for footer) --- */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.2);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.2);
    }

    60% {
        transform: scale(1);
    }
}

/* --- Input Groups (Icons inside inputs) --- */
.input-group-text {
    background-color: rgba(15, 23, 42, 0.6); /* Same background as input */
    border: 1px solid var(--border-subtle);
    border-right: none; /* Remove right border to join with input */
    color: var(--brand-primary);
}

/* Adjustment for when input has a group */
.input-group .form-control {
    border-left: none; /* Remove left border of input */
}

.input-group:focus-within .input-group-text {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); /* Glow affects the icon too */
}

/* --- FIX PLACEHOLDERS (Make helper text visible) --- */
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important; /* 40% White */
    opacity: 1; /* Necessary so Firefox doesn't make it transparent */
}

/* For old browsers (Old Edge / IE) */
.form-control::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* --- FIX DATE PICKER ICON (Make calendar visible in dark mode) --- */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Inverts black icon to white */
    cursor: pointer; /* Shows hand cursor on hover */
    opacity: 0.8; /* Slight transparency */
    transition: 0.3s;
}

    input[type="date"]::-webkit-calendar-picker-indicator:hover {
        opacity: 1; /* Full brightness on hover */
        transform: scale(1.1); /* Slight zoom effect */
    }

/* ===========================
    🟢 NAVBAR BRAND ICON
   =========================== */
.navbar-brand-icon {
    width: 50px; /* Ideal size for navbar */
    height: 50px; /* Must be equal to width */
    border-radius: 30%; /* Makes it circular */
    object-fit: cover; /* Prevents image distortion */
    margin-right: 5px; /* Space between icon and "GreenBowl" text */
    /* Optional: A subtle border that makes it pop on dark background */
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

/* Hover effect (Optional) */
.navbar-brand:hover .navbar-brand-icon {
    border-color: #10b981; /* Turns green on hover */
    transform: rotate(5deg); /* A small elegant rotation */
}

/* ===========================
    🟢 ACTIVE NAV PILL STYLE
   =========================== */
.nav-pills-custom .nav-link.active {
    background-color: #10b981; /* The specific dark green from your branding */
    color: #ffffff !important; /* White text */
    border-radius: 30px; /* Rounded pill shape */
    font-weight: 600; /* Make text slightly bolder */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle shadow for depth */
}

/* Add some spacing between items so the pills don't touch */
.nav-pills-custom .nav-item {
    margin-right: 5px;
}

/* Hover effect for non-active items */
/*.nav-pills-custom .nav-link:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: #e2e8f0 !important;
}*/

/* Fix so the Menu is always on top of Cards */
.navbar, .dropdown-menu {
    z-index: 1060 !important; /* A very high number to prioritize stacking */
    position: relative;
}

/* Optional: Ensures main content is underneath */
main {
    z-index: 1;
    position: relative;
}

/* Make dropdown menus wider and avoid line breaks */
.dropdown-menu {
    min-width: 185px !important; /* Wider dropdown container */
}

.dropdown-item {
    white-space: nowrap; /* Forces text to stay on a single line */
}

/* =========================================
    FIX: Calendar Icon in Dark Mode
   ========================================= */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Invert color: Black -> White */
    cursor: pointer; /* Hand cursor on hover */
    opacity: 0.8; /* A bit of transparency for elegance */
}

    input[type="date"]::-webkit-calendar-picker-indicator:hover,
    input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
        opacity: 1; /* Shines brighter on hover */
    }