/* =========================================
   1. VARIABLES & CORE RESET
   ========================================= */
:root {
    --primary: #0f172a;
    --accent: #d4af37;
    --accent-hover: #b8962e;
    --white: #ffffff;
    --bg-light: #f8fafc;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-wide: 1600px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 40px;
    flex: 1;
}

section {
    padding: 40px 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   2. NAVIGATION & SHARED COMPONENTS
   ========================================= */
.navbar {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1.5px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 35px;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* Unified Button Style */
.btn-cta, 
.btn-primary, 
button[type="submit"], 
.main-search button,
.auth-btn {
    background: var(--accent);
    color: var(--white) !important;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    font-size: 0.95rem;
    text-align: center;
}

.btn-cta:hover, 
.btn-primary:hover, 
button[type="submit"]:hover,
.auth-btn:hover {
    background: var(--accent-hover);
}

/* =========================================
   3. HERO & SEARCH
   ========================================= */
.hero {
    background: linear-gradient(rgba(15,23,42,0.8), rgba(15,23,42,0.8)), url('../img/hero.png');
    background-size: cover;
    background-position: center;
    padding: 140px 0;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.main-search {
    display: flex;
    background: var(--white);
    padding: 8px;
    border-radius: 12px;
    max-width: 900px;
    margin: 40px auto 0;
}

.search-input {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.search-input input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1.1rem;
    color: var(--primary);
    padding: 10px;
}

/* =========================================
   4. BROWSE & LISTINGS GRID
   ========================================= */
.browse-filter-bar {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 40px 0;
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    font-family: inherit;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    outline: none;
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.listing-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.listing-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-img-wrapper {
    height: 240px;
    position: relative;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.premium-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
}

.card-body {
    padding: 25px;
}

.category-label {
    color: var(--accent);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.price {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   5. SINGLE LISTING PAGE
   ========================================= */
.photo-hero { background: var(--primary); padding: 40px 0; }
.carousel-main img { width: 100%; max-height: 600px; object-fit: cover; border-radius: var(--radius); }
.carousel-thumbs { display: flex; justify-content: center; gap: 10px; margin-top: 15px; }
.carousel-thumbs img { width: 80px; height: 60px; object-fit: cover; cursor: pointer; border-radius: 8px; opacity: 0.6; border: 2px solid transparent; }
.carousel-thumbs img:hover { opacity: 1; border-color: var(--accent); }

.listing-grid-layout { display: grid; grid-template-columns: 1fr 380px; gap: 60px; margin-top: 60px; }
.listing-header h1 { font-size: 3rem; font-weight: 800; color: var(--primary); }
.price-tag { font-size: 2.5rem; font-weight: 800; color: var(--accent); margin: 20px 0; }

.purchase-box { 
    background: var(--primary); 
    padding: 40px; 
    border-radius: var(--radius); 
    color: white; 
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.2); 
    height: fit-content;
}

.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 30px; }
.meta-item { padding: 20px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; }
.meta-item .label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.meta-item .value { font-weight: 700; color: var(--primary); display: block; margin-top: 5px; }

/* Breadcrumb & Action Bar */
.breadcrumb-nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; margin-bottom: 20px; }
.nav-left { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; font-weight: 600; }
.nav-left a { color: var(--text-muted); padding: 6px 12px; border-radius: 6px; background: var(--white); border: 1px solid var(--border); }
.action-link { 
    display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--border); 
    padding: 10px 20px; border-radius: 50px; font-size: 0.9rem; font-weight: 700; color: var(--primary); cursor: pointer; 
}
.action-link:hover { border-color: #f43f5e; background: #fff1f2; color: #e11d48; }

/* =========================================
   6. AUTHENTICATION (LOGIN/REGISTER)
   ========================================= */
.auth-wrapper { display: flex; min-height: 100vh; width: 100%; }
.auth-side-image { 
    flex: 1.2; background-size: cover; background-position: center; position: relative; 
    display: flex; align-items: flex-end; padding: 60px; color: white; margin: 30px; border-radius: 20px; overflow: hidden; 
}
.auth-side-image::after { 
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.9)); 
}
.auth-side-form { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--white); padding: 40px 20px; }
.auth-container { width: 100%; max-width: 480px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.form-group input, .form-group select, .form-control { 
    width: 100%; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; font-size: 1rem; box-sizing: border-box; background: var(--bg-light); 
}
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }
.auth-error-msg { background: #fee2e2; color: #dc2626; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; border: 1px solid #fecaca; text-align: center; }

/* =========================================
   7. DASHBOARD & MANAGEMENT
   ========================================= */
.dashboard-grid { display: grid; grid-template-columns: 280px 1fr; gap: 40px; margin: 40px; }
.dash-sidebar { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 30px; height: fit-content; }
.user-info { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.avatar { width: 60px; height: 60px; background: var(--accent); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; margin: 0 auto 15px; overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

.dash-nav { display: flex; flex-direction: column; gap: 5px; }
.dash-nav a { padding: 12px 15px; border-radius: 8px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.dash-nav a:hover, .dash-nav a.active { background: var(--bg-light); color: var(--accent); }
.nav-label { font-size: 0.7rem; text-transform: uppercase; font-weight: 800; color: var(--text-muted); margin: 15px 0 5px 15px; letter-spacing: 1px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--white); padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); text-align: center; }
.stat-card h3 { font-size: 2rem; font-weight: 800; color: var(--primary); }

.widgets-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-widget { background: var(--white); padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; }

/* Table Styling */
.manage-table-wrapper { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.dash-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 600px; }
.dash-table th, .dash-table td { padding: 18px 25px; border-bottom: 1px solid var(--border); }
.dash-table thead { background: var(--bg-light); }

/* =========================================
   8. ABOUT & PROFILE PAGES
   ========================================= */
.about-wrap { padding: 60px 40px; max-width: 1100px; margin: 0 auto; }
.hero-container { position: relative; margin-bottom: 50px; border-radius: var(--radius); overflow: hidden; height: 400px; border: 1px solid var(--border); }
.verticals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin: 50px 0; }
.vertical-card { background: var(--white); padding: 40px 30px; border-radius: var(--radius); border: 1px solid var(--border); transition: var(--transition); }

/* Profile Header */
.profile-header-card { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 40px; }
.cover-photo-container { height: 400px; position: relative; background: #1e293b; }
.profile-meta-bar { display: flex; align-items: center; padding: 30px 50px; gap: 35px; background: white; }
.profile-avatar-container { width: 180px; height: 180px; border-radius: 50%; border: 6px solid white; margin-top: -120px; position: relative; overflow: hidden; background: var(--bg-light); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

/* =========================================
   9. FOOTER
   ========================================= */
.main-footer { background: var(--primary); color: #94a3b8; padding: 80px 0 40px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 60px; }
.newsletter-flex { display: flex; }
.newsletter-flex input { flex: 1; padding: 12px 15px; border-radius: 8px 0 0 8px; border: 1px solid #1e293b; background: #1e293b; color: #ffffff; outline: none; }
.newsletter-flex button { border-radius: 0 8px 8px 0; }

/* =========================================
   10. MODALS & FORMS
   ========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8); z-index: 2000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-content { background: var(--white); padding: 40px; border-radius: var(--radius); width: 100%; max-width: 750px; max-height: 90vh; overflow-y: auto; position: relative; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* =========================================
   11. RESPONSIVE MEDIA QUERIES
   ========================================= */

/* Large Screens (Desktop - 1400px) */
@media (max-width: 1400px) {
    .listing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Medium Screens (Tablets/Small Laptops - 1100px) */
@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dash-sidebar { width: 100%; margin-bottom: 30px; }
    .dash-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
    .nav-label, .dash-sidebar hr { display: none; }
    .listing-grid-layout { grid-template-columns: 1fr; }
    .purchase-box { position: static; width: 100%; }
}

/* Tablets (992px) */
@media (max-width: 992px) {
    .menu-toggle { display: block; z-index: 1001; }
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 80%; max-width: 300px; height: 100vh;
        background: var(--white); flex-direction: column; align-items: flex-start;
        padding: 100px 40px; gap: 25px; box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        transition: var(--transition); z-index: 1000;
    }
    .nav-links.active { right: 0; }
    .listing-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2.5rem; }
    .auth-wrapper { flex-direction: column; min-height: auto; }
    .auth-side-image { height: 250px; flex: none; margin: 15px; }
    .profile-meta-bar { flex-direction: column; text-align: center; padding: 20px; }
    .profile-avatar-container { margin-top: -90px; width: 140px; height: 140px; }
    .verticals-grid { grid-template-columns: 1fr; }
}

/* Mobile Phones (768px and below) */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    section { padding: 40px 0; }
    .stats-grid, .widgets-container, .form-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .listing-header h1 { font-size: 2rem; }
    .dash-header { flex-direction: column; text-align: center; }
    .dash-nav { grid-template-columns: 1fr 1fr; }
}

/* Small Mobile (600px and below) */
@media (max-width: 600px) {
    .listing-grid { grid-template-columns: 1fr; }
    .main-search { flex-direction: column; border-radius: var(--radius); }
    .main-search button { width: 100%; border-radius: 8px; }
    .footer-grid { grid-template-columns: 1fr !important; text-align: center; }
    .newsletter-flex { flex-direction: column; gap: 10px; }
    .newsletter-flex input, .newsletter-flex button { border-radius: 8px !important; }
    .form-row { flex-direction: column; gap: 0; }
    .dash-nav { grid-template-columns: 1fr; }
    .logo { font-size: 1.4rem; }
    .breadcrumb-nav { flex-direction: column; gap: 15px; align-items: flex-start; }
}