/* public/css/style.css */

/* --- 1. Design System & Global Styles --- */
:root {
    --color-primary: #00529B; /* Deep, trustworthy blue */
    --color-primary-dark: #003d73;
    --color-accent: #1E8A53; /* Vibrant green */
    --color-background: #F8F9FA;
    --color-surface: #FFFFFF;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    
    --font-family-base: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    line-height: 1.7;
    background-color: var(--color-background);
    color: var(--color-text);
}

.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

h1, h2, h3 { line-height: 1.3; font-weight: 600; }
h2 { font-size: 2.25rem; margin-bottom: 40px; text-align: center; color: var(--color-primary); }
a { text-decoration: none; color: var(--color-primary); transition: color var(--transition-speed) ease; }
a:hover { color: var(--color-primary-dark); }


/* --- 2. Reusable Components --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}
.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
}
.btn-primary:hover {
    background-color: #146c40; /* Darker Green */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- 3. Header --- */
.main-header {
    background-color: var(--color-surface);
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.75rem; font-weight: 700; color: var(--color-primary); }
.main-nav { display: flex; align-items: center; gap: 25px; }
.main-nav a { font-weight: 500; color: var(--color-text-muted); }
.main-nav a.btn { color: #fff; }
.icon-plus { font-size: 1.2rem; }


/* --- 4. Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, rgba(230, 240, 255, 1) 0%, rgba(255, 255, 255, 1) 100%);
    text-align: center;
    padding: 80px 20px;
}
.hero-content h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 15px; color: var(--color-primary); }
.hero-content p { font-size: 1.25rem; color: var(--color-text-muted); margin-bottom: 30px; max-width: 600px; margin-left: auto; margin-right: auto; }
.search-form { display: flex; max-width: 700px; margin: 0 auto; box-shadow: var(--shadow-md); border-radius: var(--border-radius); }
.search-form input {
    flex-grow: 1; border: 1px solid var(--color-border); padding: 18px 20px; font-size: 1.1rem; border-radius: var(--border-radius) 0 0 var(--border-radius); border-right: none;
}
.search-form input:focus { outline: 2px solid var(--color-primary); }
.search-form button {
    border: none; background-color: var(--color-primary); color: white; padding: 0 25px; cursor: pointer; border-radius: 0 var(--border-radius) var(--border-radius) 0; transition: background-color var(--transition-speed) ease;
}
.search-form button:hover { background-color: var(--color-primary-dark); }
.search-form button svg { stroke-width: 2.5; }

/* --- 5. Categories Section --- */
.categories-section { padding: 80px 0; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 20px; }
.category-card {
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--border-radius); padding: 25px; text-align: center; transition: all var(--transition-speed) ease; color: var(--color-text); font-weight: 600;
}
.category-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.category-icon-wrapper {
    width: 60px; height: 60px; margin: 0 auto 15px; border-radius: 50%; background: var(--color-background); display: flex; align-items: center; justify-content: center;
}
.category-card .icon { color: var(--color-primary); stroke-width: 1.5; width: 32px; height: 32px; }

/* --- 6. Listings Section --- */
.listings-section { padding: 40px 0 80px; background-color: var(--color-background); }
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.listing-card {
    background: var(--color-surface); border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: all var(--transition-speed) ease; display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.listing-image-wrapper { width: 100%; padding-top: 66.66%; /* 3:2 aspect ratio */ position: relative; }
.listing-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.listing-details { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.listing-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 10px 0; flex-grow: 1; }
.listing-meta { color: var(--color-text-muted); margin-bottom: 15px; font-size: 0.9rem; }
.listing-price { font-size: 1.25rem; font-weight: 700; color: var(--color-accent); }

/* --- 7. Footer --- */
.main-footer {
    background-color: #212529; color: #fff; text-align: center; padding: 40px 0;
}/* --- 8. Header & Navigation Refinements --- */
.main-nav { 
    display: none; /* Hide for mobile first */
    gap: 30px; 
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.login-link {
    font-weight: 600;
    color: var(--color-text);
}
.login-link:hover {
    color: var(--color-primary);
}

/* Show nav on larger screens */
@media (min-width: 768px) {
    .main-nav {
        display: flex;
        margin: 0 auto; /* This centers the nav links */
    }
    .header-content {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 20px;
        width: 100%;
    }
}

/* --- 9. Service Page & Form UI/UX Overhaul --- */

/* A. Page Layout & Header */
.service-page-container {
    max-width: 800px;
    margin: 40px auto 80px; /* More space at the bottom */
    padding: 0 15px;
}

.service-header {
    text-align: center;
    margin-bottom: 50px;
}

.service-header h1 {
    font-size: clamp(2.2rem, 5vw, 3rem); /* Responsive font size */
    color: var(--color-primary);
    line-height: 1.2;
}

.service-header p {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 15px auto 0;
}

/* B. Main Form Styling */
.service-form {
    background: var(--color-surface);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.service-form h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 40px;
}

/* C. Form Groups & Layout */
.form-group {
    margin-bottom: 25px;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first: single column */
    gap: 25px;
    margin-bottom: 25px;
}

/* Two columns on tablets and larger */
@media (min-width: 768px) {
    .form-group-row {
        grid-template-columns: 1fr 1fr;
    }
    .service-form {
        padding: 50px;
    }
}

/* D. Labels and Input Fields */
.service-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--color-text);
}

.service-form input[type="text"],
.service-form input[type="tel"],
.service-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px; /* Slightly smaller radius for inputs */
    font-size: 1rem;
    font-family: var(--font-family-base);
    background-color: var(--color-background);
    transition: all var(--transition-speed) ease;
}

.service-form input::placeholder,
.service-form textarea::placeholder {
    color: #999;
}

.service-form input:focus,
.service-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-surface);
    box-shadow: 0 0 0 4px rgba(0, 82, 155, 0.1);
}

.service-form textarea {
    resize: vertical;
    min-height: 140px;
}

/* E. Visual Separators */
.form-divider {
    border: 0;
    height: 1px;
    background-color: var(--color-border);
    margin: 30px 0;
}

/* F. Submit Button */
.btn-full-width {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 15px; /* Add space above the button */
}
/* --- 10. Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--color-surface);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top: 1px solid var(--color-border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-width: 50px;
    padding: 10px 0;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.nav-item:hover {
    color: var(--color-primary);
    background-color: var(--color-background);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* Add padding to the bottom of the page content on mobile to prevent overlap */
.page-container {
    padding-bottom: 80px;
}


/* --- 11. Responsive Header Adjustments --- */
@media (max-width: 767px) {
    /* On Mobile: Hide the main desktop navigation links */
    .main-nav {
        display: none;
    }
    
    /* On Mobile: Ensure the header actions (Login/Register) ARE visible */
    .header-actions {
        display: flex; /* This makes it visible again */
    }

    /* On Mobile: Make the Register button a bit smaller */
    .header-actions .btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* Ensure the header content justifies correctly on mobile */
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Show the mobile bottom navigation */
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
    }
}
/* --- 12. Form UI/UX Enhancements --- */

/* Style for the error and success message boxes */
.form-message {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 500;
}

.form-error-message {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.form-success-message {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* Style for the "Fields are required" text */
.form-info-text {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Style for the red asterisk */
.required-asterisk,
label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}/* --- 12. Dashboard --- */

/* === NEW DASHBOARD LAYOUT === */

/* --- Main Layout --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr; /* Sidebar width and main content */
    min-height: 100vh;
}

.dashboard-sidebar {
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 20px;
}

.dashboard-main-content {
    background-color: var(--color-background);
    padding: 20px 40px;
}

/* --- Sidebar --- */
.sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-nav .nav-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 10px;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
    color: var(--color-text);
}
.sidebar-nav ul li a:hover {
    background-color: var(--color-background);
}
.sidebar-nav ul li a.active {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* --- Main Content Header --- */
.main-content-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}
.welcome-message {
    color: var(--color-text-muted);
    margin-right: auto; /* Pushes welcome message to the left */
}
.btn-logout {
    background-color: #dc3545;
    color: #fff;
    padding: 8px 16px;
}

/* --- Main Dashboard Area --- */
.dashboard-content-area h1 { font-size: 2rem; }
.dashboard-content-area h2 { text-align: left; font-size: 1.5rem; color: var(--color-text); }
.subtitle { margin-top: -15px; color: var(--color-text-muted); }

/* Stat Cards */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.stat-card {
    background-color: var(--color-surface);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}
.stat-label { margin: 0; color: var(--color-text-muted); }
.stat-value { font-size: 1.75rem; font-weight: 600; margin: 5px 0 0; }

/* --- Main Panel Grid --- */
.main-panel-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 for orders, 1/3 for right sidebar */
    gap: 30px;
}
.panel {
    background-color: var(--color-surface);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h3 { margin: 0; font-size: 1.1rem; }

/* Orders List */
.order-item { display: grid; grid-template-columns: 0.5fr 1fr 1fr 1fr 1fr; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--color-border); }
.order-item:last-child { border-bottom: none; }
.order-id { font-weight: 600; }

/* Status Badges */
.order-status { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-align: center; }
.status-delivered { background-color: #d1e7dd; color: #0f5132; }
.status-pending { background-color: #fff3cd; color: #664d03; }
.status-cancelled { background-color: #f8d7da; color: #842029; }
.status-picked-up { background-color: #cff4fc; color: #055160; }


/* Right Sidebar Panels */
.btn-action { display: block; width: 100%; text-align: center; margin-bottom: 10px; padding: 12px; font-weight: 600; }
.btn-green { background-color: var(--color-accent); color: #fff; }
.btn-blue { background-color: var(--color-primary); color: #fff; }
.btn-edit { background-color: var(--color-background); color: var(--color-text); border: 1px solid var(--color-border); }

.account-info-panel p { margin: 0 0 15px; }
.account-info-panel span { color: var(--color-text-muted); font-size: 0.85rem; }

/* --- Dashboard Responsive & Mobile Menu --- */

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
}

.sidebar-close-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-text-muted);
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}

.sidebar-overlay {
    display: none; /* Hidden on desktop */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

/* Tablet view adjustments */
@media (max-width: 1024px) {
    .main-panel-grid { grid-template-columns: 1fr; }
    .dashboard-layout { grid-template-columns: 220px 1fr; }
    .dashboard-main-content { padding: 20px; }
}

/* Mobile view adjustments */
@media (max-width: 767px) {
    .dashboard-layout { 
        grid-template-columns: 1fr; /* Single column layout */
    }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        z-index: 1002;
        transform: translateX(-100%); /* Hide off-screen */
        transition: transform var(--transition-speed) ease;
        overflow-y: auto;
    }
    
    .sidebar-close-btn, .mobile-menu-toggle {
        display: block; /* Show the buttons on mobile */
    }
    
    .sidebar-overlay {
        display: block; /* Allow overlay to be shown */
    }

    .main-content-header .welcome-message {
        display: none; /* Hide welcome message on small screens for more space */
    }

    /* --- The "Open" State --- */
    body.sidebar-open .dashboard-sidebar {
        transform: translateX(0); /* Slide sidebar in */
    }
    body.sidebar-open .sidebar-overlay {
        opacity: 1; /* Show overlay */
        pointer-events: auto;
    }
}