/* ===================================================
   GLOBAL STYLES & VARIABLES
====================================================== */

/* Define reusable variables for colors, fonts, etc. */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family: 'Poppins', sans-serif;
}

/* Basic Reset & Body Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: 0;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: var(--dark-color);
}

/* ===================================================
   UTILITY & TYPOGRAPHY
====================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===================================================
   COMPONENTS (Buttons, Forms, Cards, Alerts, etc.)
====================================================== */

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
}

.btn:hover {
    background-color: var(--primary-hover);
    color: #fff;
    transform: translateY(-2px);
}

.btn-danger { background-color: var(--danger-color); }
.btn-danger:hover { background-color: #c82333; }
.btn-secondary { background-color: var(--secondary-color); }
.btn-secondary:hover { background-color: #5a6268; }


/* --- Forms --- */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="search"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
}

/* --- Alerts --- */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    color: #fff;
}
.alert-success { background-color: var(--success-color); }
.alert-danger { background-color: var(--danger-color); }
.alert-info { background-color: var(--secondary-color); }


/* --- Cards --- */
.card {
    background-color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    margin-bottom: 2rem;
}

/* --- Responsive Tables --- */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: #f8f9fa;
    font-weight: 600;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

/* ===================================================
   HEADER, NAVIGATION, LOGO & ICONS
====================================================== */

.landing-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 999;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Crucial for positioning the mobile nav */
}

/* --- Logo & Brand Name --- */
.header-content h1 a {
    display: flex;
    align-items: center;
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.6rem;
    margin: 0;
}
.header-logo {
    height: 35px; /* Minimized logo size */
    width: auto;
    margin-right: 12px;
}

/* --- Desktop Navigation --- */
.header-content nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.header-content nav a:not(.btn) {
    color: var(--dark-color);
    font-weight: 500;
}

/* --- Icons & Cart --- */
.header-content nav a i {
    margin-right: 8px;
}
.btn, .cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-content nav a:hover i {
    color: inherit;
}
.cart-button {
    position: relative;
}
.cart-button .cart-text {
    margin-left: 8px;
}
.cart-counter {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    font-weight: bold;
}

/* ===================================================
   PAGE-SPECIFIC LAYOUTS
====================================================== */

.hero {
    color: white;
    padding: 150px 0;
    text-align: center;
}
.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}
.popular-dishes, .how-it-works {
    padding: 4rem 0;
}
.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.step-item {
    flex: 1;
    min-width: 280px;
    text-align: center;
    padding: 1.5rem;
}
.landing-footer {
    background: var(--dark-color);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* ===================================================
   MENU, SEARCH & CARDS
====================================================== */
.search-form-container {
    margin-bottom: 2rem;
    display: flex;
    gap: 10px;
    align-items: center;
}
.menu-category-section {
    margin-bottom: 3rem;
}
.menu-category-title {
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}
.menu-item-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.menu-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.menu-item-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.menu-item-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.menu-item-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25rem;
}
.menu-item-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1rem;
}
.menu-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.menu-item-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}
.menu-item-action {
    display: flex;
    align-items: center;
}
.menu-item-action .quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    padding: 8px;
    height: 38px;
}
.menu-item-action .btn {
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    height: 38px;
    border-left: none;
}

/* ===================================================
   ADMIN-SPECIFIC COMPONENTS
====================================================== */
/* --- Dashboard --- */
.dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 2rem;
}
.stat-card {
    flex: 1 1 200px;
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
    border-left: 5px solid var(--primary-color);
}
.stat-card h4 { margin-top: 0; margin-bottom: 10px; font-size: 1rem; color: #555; font-weight: 500; }
.stat-card p { font-size: 2rem; font-weight: 600; color: #333; margin: 0; }
.dashboard-nav { display: flex; flex-wrap: wrap; gap: 15px; padding-top: 1rem; }
.dashboard-nav .btn { font-size: 1rem; }

/* --- Status Badges --- */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
.status-unpaid, .status-cancelled { background-color: #6c757d; }
.status-pending { background-color: #ffc107; color: #212529; }
.status-preparing { background-color: #17a2b8; }
.status-ready { background-color: #fd7e14; }
.status-serving, .status-completed { background-color: #28a745; }

/* --- Accordion for "Add New" Forms --- */
.accordion-toggle {
    background-color: #f8f9fa;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.4s ease;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.accordion-toggle:hover {
    background-color: #e2e6ea;
}
.accordion-toggle .icon::before { content: '\002B'; font-size: 1.3rem; }
.accordion-toggle.active .icon::before { content: "\2212"; }

.accordion-content {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
}
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}
.edit-modal-content img {
    max-width: 100px;
    height: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
}


/* ===================================================
   AUTHENTICATION MODAL STYLES
====================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: #fff;
    padding: 2rem 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}
.modal-overlay.is-visible .modal-content {
    transform: translateY(0);
}
.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}
.close-modal-btn:hover {
    color: #333;
}
.auth-modal {
    display: none;
}
.auth-modal.is-active {
    display: block;
}

/* ===================================================
   RESPONSIVE & MOBILE STYLES
====================================================== */

/* --- The Hamburger Button itself --- */
.hamburger-btn {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}
.hamburger-btn .line {
    width: 30px;
    height: 3px;
    background-color: var(--dark-color);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}
.hamburger-btn.is-active .line1 { transform: rotate(45deg) translate(7px, 6px); }
.hamburger-btn.is-active .line2 { opacity: 0; }
.hamburger-btn.is-active .line3 { transform: rotate(-45deg) translate(7px, -6px); }


/* --- Media Queries for screens 768px and smaller --- */
@media (max-width: 768px) {
    
    /* Responsive Header - Dropdown Style */
    .hamburger-btn {
        display: flex;
    }
    .header-content nav {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: auto;
        background-color: #fff;
        padding: 1.5rem;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
        z-index: 1000;
    }
    .header-content nav.nav-active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .header-content nav a {
        display: flex;
        align-items: center;
        font-size: 1.1rem;
        color: var(--dark-color);
        width: 100%;
        padding: 8px 0;
    }
    .header-content nav a i {
        width: 25px;
        text-align: center;
    }
    .header-content nav .btn {
        width: auto;
        display: inline-flex;
    }
    .header-content nav .cart-button {
        display: inline-flex;
        align-items: center;
        width: auto;
        padding: 10px 20px;
        background-color: var(--primary-color);
        color: #fff;
        border-radius: 5px;
    }

    /* Responsive Tables */
    table thead {
        display: none;
    }
    table, table tbody, table tr, table td {
        display: block;
        width: 100%;
    }
    table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;
    }
    table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }
    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
    }
    table td:last-child {
        border-bottom: 0;
    }
}

/* 
   FIX: The rule that hid the cart text on desktop has been REMOVED from here.
   The cart text will now be visible on all screen sizes.
*/