
:root {
    --primary-color: #002f34;
    --secondary-color: #0043E6;
    --secondary-dark: #002f34;
    --accent-color: #ffce32;
    --text-color: #002f34;
    --gray-light: #f2f4f5;
    --gray-medium: #c8c8c8;
    --white: #ffffff;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --radius: 4px;
    --font-family: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--gray-light);
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: 5px solid var(--primary-color);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* --- UPDATED HEADER STYLES --- */

header {
    background-color: var(--gray-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-top {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-wrap: nowrap;
    /* Ensure single line */
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -1px;
    display: block;
    align-items: center;
    flex-shrink: 0;
    /* Prevent logo from shrinking */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

/* Style for the Sell Button matching your HTML class */
.btn-sell {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: var(--white);
    padding: 8px 24px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 4px solid var(--accent-color);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--primary-color);
    white-space: nowrap;
}

.btn-sell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 20px;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: var(--white);
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    border-radius: var(--radius);
    padding: 8px 0;
    border: 1px solid var(--gray-medium);
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-content a:hover {
    background-color: var(--gray-light);
    color: var(--primary-color);
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* --- END HEADER STYLES --- */

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-container h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius);
    font-size: 16px;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.alert {
    padding: 10px;
    color: var(--white);
    margin-bottom: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.alert-error {
    background-color: #ff4d4d;
}

.alert-success {
    background-color: #2fb380;
}

/* Subnav/Categories */
.subnav {
    background-color: var(--white);
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.footer-auth {
    font-size: 12px;
    opacity: 0.7;
    text-align: right;
}

/* Scroll Buttons & Categories */
.categories-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.categories-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
    transition: all 0.2s;
    opacity: 0.9;
}

.scroll-btn:hover {
    background: var(--gray-light);
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
}

.scroll-btn.left {
    left: -25px;
}

.scroll-btn.right {
    right: -25px;
}

/* --- MOBILE RESPONSIVE MEDIA QUERY --- */
@media (max-width: 768px) {

    /* FORCE SINGLE LINE HEADER */
    .header-top {
        flex-direction: row !important;
        /* Force Horizontal */
        flex-wrap: nowrap !important;
        /* Prevent wrapping */
        align-items: center;
        gap: 10px;
        padding: 8px 0;
    }

    .logo {
        font-size: 20px;
        /* Slightly smaller logo for space */
    }

    .nav-links {
        /* Allow nav items to scroll if screen is too small */
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar for cleaner look */
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 10px;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    /* Shrink button/text sizes for single line fit */
    .nav-item {
        font-size: 14px;
    }

    .btn-sell {
        padding: 6px 16px;
        font-size: 12px;
        border-width: 3px;
    }

    /* --- MOBILE DROPDOWN FIX --- */
    .dropdown {
        position: relative;
    }

    .dropdown-content {
        position: fixed;
        /* Break out of header */
        top: 40px;
        /* Adjusted to fit under single line header (approx height) */
        left: 15px;
        right: 15px;
        width: auto;
        z-index: 9999;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        border-radius: 8px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-auth {
        text-align: center;
        margin-top: 10px;
    }

    .container {
        padding: 0 15px;
    }

    /* General Grid Fixes */
    div[style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    div[style*="grid-template-columns: 250px 1fr"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .scroll-btn {
        display: none !important;
    }

    .categories-scroll {
        padding-bottom: 0;
    }

    /* Mobile Filter Toggle */
    #toggleFiltersBtn {
        display: block !important;
    }

    #filterSidebar {
        display: none;
        /* Hidden by default on mobile */
    }

    /* Mobile Profile Toggle */
    #toggleProfileBtn {
        display: block !important;
    }

    #profileSidebar {
        display: none;
    }
}

/* Profile Manage Ad Card */
.manage-ad-card {
    display: flex;
    gap: 15px;
    background: white;
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius);
    padding: 15px;
    align-items: flex-start;
    transition: box-shadow 0.2s;
}

.manage-ad-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.manage-ad-image {
    width: 120px;
    height: 120px;
    background: #f4f4f4;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.manage-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 480px) {
    .manage-ad-card {
        flex-direction: column;
    }

    .manage-ad-image {
        width: 100%;
        height: 200px;
    }
}
  ul li a {
  display: flex;                /* Better tap area */
  align-items: center;
  min-height: 44px;             /* WCAG minimum touch target */
  padding: 10px 14px;
  margin-bottom: 8px;           /* Space between items */
  line-height: 1.2;
  text-decoration: none;
}

/* Improve tap feedback */
ul li a:focus,
ul li a:hover {
  background-color: var(--accent-color);
  border-radius: 6px;
}
