/* =========================================
   WorkMart Core Stylesheet
   Premium, Modern, and Responsive foundation 
   aligned with the official brand logo.
   ========================================= */

:root {
    /* Brand Colors extracted from WorkMart Logo */
    --primary-color: #22c55e; /* Vibrant brand green */
    --primary-hover: #16a34a; /* Deeper green for hover states */
    --secondary-color: #84cc16; /* Lighter lime-green for gradients */
    
    --dark-bg: #1e293b; /* Charcoal slate matching the 'M' */
    --dark-text: #111827; /* Deepest slate for readable text */
    --light-text: #4b5563; /* Softer grey for secondary text */
    --light-bg: #f8fafc; /* Very light cool-grey background */
    
    --white: #ffffff;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* =========================================
   Base & Reset
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: var(--font-family); 
    color: var(--dark-text); 
    background-color: var(--light-bg); 
    line-height: 1.6; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    -webkit-font-smoothing: antialiased; 
}

a { 
    text-decoration: none; 
    color: var(--primary-color); 
    transition: color 0.2s ease; 
}

a:hover { 
    color: var(--primary-hover); 
}

.container { 
    width: 100%; 
    max-width: 1280px; 
    margin: 0 auto; 
    padding: 0 1.5rem; 
}

main { 
    flex-grow: 1; 
}

/* =========================================
   Buttons
   ========================================= */
.btn { 
    display: inline-block; 
    padding: 0.6rem 1.5rem; 
    border-radius: var(--border-radius); 
    font-weight: 600; 
    font-size: 0.95rem; 
    text-align: center; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: all 0.3s ease; 
}

.btn-primary { 
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--white); 
    border: none;
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.2);
}

.btn-primary:hover { 
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--white); 
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(34, 197, 94, 0.3);
}

.btn-outline { 
    background-color: transparent; 
    border-color: var(--border-color); 
    color: var(--dark-text); 
}

.btn-outline:hover { 
    border-color: var(--primary-color); 
    color: var(--primary-color); 
}

/* =========================================
   Navbar
   ========================================= */
.navbar { 
    background-color: var(--white); 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 50; 
}

.navbar .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 72px; 
}

.navbar-brand { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--primary-color); 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

.navbar-nav { 
    display: flex; 
    gap: 2.5rem; 
    list-style: none; 
}

.nav-link { 
    color: var(--light-text); 
    font-weight: 600; 
    font-size: 0.95rem; 
}

.nav-link:hover { 
    color: var(--dark-bg); 
}

.auth-buttons { 
    display: flex; 
    gap: 1rem; 
}

/* =========================================
   Hero Section
   ========================================= */
.hero { 
    background: linear-gradient(135deg, var(--dark-bg) 0%, #0f172a 100%); 
    color: var(--white); 
    padding: 6rem 0; 
    text-align: center; 
}

.hero h1 { 
    font-size: 3.5rem; 
    font-weight: 800; 
    line-height: 1.2; 
    margin-bottom: 1.5rem; 
    letter-spacing: -1px; 
}

.hero p { 
    font-size: 1.25rem; 
    color: #cbd5e1; 
    margin-bottom: 3rem; 
    max-width: 650px; 
    margin-left: auto; 
    margin-right: auto; 
}

/* =========================================
   Smart Search Bar
   ========================================= */
.search-bar { 
    display: flex; 
    max-width: 800px; 
    margin: 0 auto; 
    background: var(--white); 
    border-radius: var(--border-radius); 
    padding: 0.5rem; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2); 
}

.search-bar select, .search-bar input { 
    border: none; 
    padding: 1rem 1.5rem; 
    font-size: 1rem; 
    outline: none; 
    color: var(--dark-text); 
    background: transparent; 
}

.search-bar select { 
    border-right: 1px solid var(--border-color); 
    font-weight: 500; 
    cursor: pointer; 
    color: var(--light-text); 
}

.search-bar input { 
    flex-grow: 1; 
}

.search-bar .btn { 
    padding: 1rem 2rem; 
}

/* =========================================
   Typography & Headings
   ========================================= */
.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin: 4rem 0 2rem; 
}

.section-title { 
    font-size: 1.75rem; 
    font-weight: 800; 
    color: var(--dark-bg); 
}

/* =========================================
   Static Feature Cards
   ========================================= */
.grid-features { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2rem; 
    margin-bottom: 3rem; 
}

.card { 
    background: var(--white); 
    border-radius: var(--border-radius); 
    padding: 2.5rem 2rem; 
    border: 1px solid var(--border-color); 
    transition: all 0.3s ease; 
    display: flex; 
    flex-direction: column; 
}

.card:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--box-shadow); 
    border-color: var(--primary-color); 
}

.card-icon { 
    font-size: 2.5rem; 
    margin-bottom: 1.5rem; 
    display: block; 
}

.card h3 { 
    margin-bottom: 1rem; 
    color: var(--dark-bg); 
    font-size: 1.25rem; 
}

.card p { 
    color: var(--light-text); 
    font-size: 0.95rem; 
    flex-grow: 1; 
    margin-bottom: 1.5rem; 
}

/* =========================================
   Item Grids (Products & Jobs)
   ========================================= */
.item-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 3rem; 
}

/* Product Card */
.item-card { 
    background: var(--white); 
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius); 
    overflow: hidden; 
    transition: all 0.2s ease; 
    display: flex; 
    flex-direction: column; 
}

.item-card:hover { 
    box-shadow: var(--box-shadow); 
    border-color: var(--primary-color); 
}

.item-img { 
    width: 100%; 
    height: 200px; 
    background-color: #f1f5f9; 
    object-fit: cover; 
}

.item-details { 
    padding: 1.25rem; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.item-title { 
    font-size: 1.1rem; 
    font-weight: 600; 
    color: var(--dark-bg); 
    margin-bottom: 0.5rem; 
}

.item-price { 
    font-size: 1.25rem; 
    font-weight: 800; 
    color: var(--primary-color); 
    margin-bottom: 0.5rem; 
}

.item-meta { 
    font-size: 0.85rem; 
    color: var(--light-text); 
    display: flex; 
    justify-content: space-between; 
    margin-top: auto; 
}

/* Job Card */
.job-card { 
    padding: 1.5rem; 
}

.job-header { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    margin-bottom: 1rem; 
}

.job-logo { 
    width: 48px; 
    height: 48px; 
    border-radius: 6px; 
    background: #f1f5f9; 
    object-fit: cover; 
    border: 1px solid var(--border-color); 
}

.job-company { 
    font-size: 0.9rem; 
    color: var(--light-text); 
    font-weight: 500; 
}

.job-tags { 
    display: flex; 
    gap: 0.5rem; 
    margin-top: 1rem; 
}

.badge { 
    background: #f1f5f9; 
    color: var(--dark-bg); 
    padding: 0.35rem 0.6rem; 
    border-radius: 4px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    border: 1px solid var(--border-color); 
}

.badge-remote { 
    background: #dcfce3; 
    color: #166534; 
    border-color: #bbf7d0; 
}

/* =========================================
   Empty States
   ========================================= */
.empty-state { 
    text-align: center; 
    padding: 4rem 2rem; 
    background: var(--white); 
    border: 2px dashed var(--border-color); 
    border-radius: var(--border-radius); 
}

.empty-state h3 { 
    color: var(--dark-bg); 
    margin-bottom: 0.5rem; 
}

.empty-state p { 
    color: var(--light-text); 
    margin-bottom: 1.5rem; 
}

/* =========================================
   Alerts
   ========================================= */
.alert { 
    padding: 1rem 1.5rem; 
    border-radius: var(--border-radius); 
    margin-bottom: 1rem; 
    font-weight: 500; 
}

.alert-success { 
    background-color: #dcfce3; 
    color: #166534; 
    border: 1px solid #bbf7d0; 
}

.alert-danger { 
    background-color: #fee2e2; 
    color: #991b1b; 
    border: 1px solid #f87171; 
}

/* =========================================
   Advanced Professional Footer
   ========================================= */
.footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    color: var(--light-text);
    margin-top: auto; 
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: block;
}

.footer-col p {
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-col h4 {
    color: var(--dark-bg);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.85rem;
}

.footer-links a {
    color: var(--light-text);
    font-weight: 500;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    background-color: var(--light-bg);
    font-size: 0.9rem;
}

.footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom-flex strong {
    color: var(--dark-bg);
}

.footer-bottom-flex a {
    color: var(--light-text);
    font-weight: 600;
}

.footer-bottom-flex a:hover {
    color: var(--primary-color);
}

/* =========================================
   MARKETPLACE & CLASSIFIEDS STYLES
   ========================================= */

.mp-hero {
    background: var(--dark-bg);
    color: var(--white);
    padding: 4rem 1rem;
    text-align: center;
    border-bottom: 4px solid var(--primary-color);
}

.mp-hero h1 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 800;}
.mp-hero p { color: #cbd5e1; margin-bottom: 2rem; font-size: 1.1rem; }

.mp-search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.mp-search-bar input {
    flex-grow: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--dark-text);
}

.mp-search-bar button {
    border-radius: 0;
}

.mp-content {
    padding: 3rem 1.5rem;
}

.mp-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.mp-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.mp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.mp-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
}

.mp-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.mp-title {
    font-size: 1.05rem;
    color: var(--dark-bg);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.mp-price {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: auto;
}

.mp-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--light-text);
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

/* Detail Page specific */
.mp-detail-container { margin-top: 3rem; margin-bottom: 4rem; }
.mp-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; }

.mp-gallery { background: var(--white); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1rem; margin-bottom: 2rem;}
.mp-main-image { width: 100%; height: 400px; object-fit: contain; border-radius: 4px; margin-bottom: 1rem; background: #f8fafc; }
.mp-thumbnails { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem;}
.mp-thumb { width: 80px; height: 80px; object-fit: cover; cursor: pointer; border: 2px solid transparent; border-radius: 4px;}
.mp-thumb:hover, .mp-thumb.active { border-color: var(--primary-color); }

.mp-description-box { background: var(--white); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 2rem; line-height: 1.8;}
.mp-description-box h3 { margin-bottom: 1rem; color: var(--dark-bg); border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem;}

.mp-info-card, .mp-seller-card { background: var(--white); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 2rem; margin-bottom: 1.5rem; }
.mp-detail-title { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--dark-bg); line-height: 1.3;}
.mp-detail-price { font-size: 2rem; font-weight: 800; color: var(--primary-color); margin-bottom: 1.5rem; }

.mp-meta-list div { padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; display: flex; justify-content: space-between;}
.mp-actions { margin-top: 2rem; }

/* Search Layout */
.mp-search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; }
.mp-sidebar { background: var(--white); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1.5rem; align-self: start; position: sticky; top: 90px;}
.mp-pagination { display: flex; gap: 0.5rem; margin-top: 3rem; justify-content: center; }

/* =========================================
   GLOBAL FORM STYLES
   ========================================= */
.form-group { 
    margin-bottom: 1.5rem; 
}

.form-label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 600; 
    color: var(--dark-bg); 
    font-size: 0.95rem; 
}

.form-control { 
    width: 100%; 
    padding: 0.85rem 1rem; 
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius); 
    font-size: 1rem; 
    font-family: inherit;
    background-color: var(--light-bg);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s; 
}

.form-control:focus { 
    outline: none; 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
    background-color: var(--white);
}

textarea.form-control { 
    resize: vertical; 
    min-height: 120px; 
}

.grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1.5rem; 
}


/* =========================================
   COMPREHENSIVE MOBILE RESPONSIVENESS
   (This is the magic block for phones)
   ========================================= */
@media (max-width: 900px) {
    .mp-detail-grid, .mp-search-layout { 
        grid-template-columns: 1fr; 
    }
    .mp-sidebar { 
        position: static; 
        margin-bottom: 2rem; 
    }
}

@media (max-width: 768px) {
    /* 1. Navbar Mobile Fix (Stack and Scroll) */
    .navbar .container { 
        flex-direction: column; 
        height: auto; 
        padding: 1rem; 
        gap: 1rem; 
    }
    
    .navbar-brand { 
        margin-bottom: 0.5rem; 
        justify-content: center;
    }
    
    /* Make nav links swipeable horizontally on mobile */
    .navbar-nav { 
        display: flex; 
        width: 100%; 
        overflow-x: auto; 
        padding-bottom: 0.5rem; 
        gap: 1.5rem; 
        justify-content: flex-start;
        border-bottom: 1px solid var(--border-color);
        -webkit-overflow-scrolling: touch; 
    }
    
    /* Keep auth buttons visible, stack them side-by-side */
    .auth-buttons { 
        display: flex; 
        width: 100%; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 0.5rem; 
    }
    
    .auth-buttons .btn { 
        flex: 1; 
        text-align: center; 
        padding: 0.6rem 0.5rem; 
        font-size: 0.85rem;
    }
    
    /* 2. Form Fixes (Prevents iOS Auto-Zoom & Stacks grids) */
    .form-control { 
        font-size: 16px !important; 
    }
    
    .grid-2 { 
        grid-template-columns: 1fr; 
        gap: 1rem;
    }
    
    /* 3. Hero & Search Bar Fixes */
    .hero { 
        padding: 3rem 1rem; 
    }
    
    .hero h1 { 
        font-size: 2rem; 
    }
    
    .search-bar { 
        flex-direction: column; 
        background: transparent; 
        box-shadow: none; 
        gap: 0.5rem; 
        padding: 0; 
    }
    
    .search-bar input, .search-bar select, .search-bar .btn { 
        border-radius: var(--border-radius); 
        width: 100%; 
        background: var(--white); 
        border: 1px solid var(--border-color); 
    }
    
    /* 4. Footer Fixes */
    .footer-grid { 
        gap: 2rem; 
    }
    
    .footer-bottom-flex { 
        flex-direction: column; 
        text-align: center; 
    }
}