/* style.css - Main Stylesheet for MotorTrader Uganda */

/* ===== SINGLE FONT: ATVFabriga ===== */
@font-face {
    font-family: 'Fabriga';
    src: url('/fonts/ATVFabriga.woff2') format('woff2'),
         url('/fonts/Fabriga.woff') format('woff'),
         url('/fonts/Fabriga.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fabriga';
    src: url('/fonts/Fabriga-Bold.woff2') format('woff2'),
         url('/fonts/Fabriga-Bold.woff') format('woff'),
         url('/fonts/Fabriga-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #3e48dd;
    --primary-dark: #000000;
    --secondary-color: #FFD700;
    --accent-color: #198754;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 5px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Apply Fabriga to EVERYTHING */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Fabriga', sans-serif !important;
}

body {
    font-family: 'Fabriga', sans-serif !important;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-color);
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 800;
}

.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.logo span {
    color: var(--secondary-color);
}

.stats {
    font-size: 14px;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 20px;
    margin-left: 15px;
}

/* User Menu */
.user-menu {
    margin-right: 15px;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-name {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: var(--transition);
}

.user-name:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-name i {
    margin-right: 8px;
    font-size: 18px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: var(--shadow);
    border-radius: 6px;
    z-index: 1001;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

/* Buttons */
.sell-btn, .login-btn {
    background-color: var(--secondary-color);
    color: var(--dark-color);
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sell-btn:hover, .login-btn:hover {
    background-color: #e6c200;
    transform: translateY(-2px);
}

.sell-btn i, .login-btn i {
    margin-right: 8px;
}

.primary-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn:hover {
    background-color: #2a32b8;
    transform: translateY(-2px);
}

/* Navigation */
nav {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav {
    display: flex;
    list-style: none;
}

.main-nav > li {
    position: relative;
}

.main-nav > li > a {
    display: block;
    padding: 18px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.main-nav > li > a:hover,
.main-nav > li > a.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background-color: var(--light-color);
}

.main-nav > li > a i {
    margin-left: 5px;
    font-size: 12px;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: var(--shadow);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Content */
main {
    min-height: 60vh;
    padding: 40px 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('/assets/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    max-width: 800px;
    margin: 30px auto;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.search-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Fabriga', sans-serif !important;
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: #2a32b8;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.filter-btn {
    background-color: var(--light-color);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 28px;
    color: var(--primary-dark);
    margin-bottom: 0;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.view-all:hover {
    color: #000000;
}

/* Featured Listings */
.featured-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.listing-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.listing-img {
    height: 180px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 14px;
}

.listing-content {
    padding: 20px;
}

.listing-badge {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.sponsored-badge {
    background-color: var(--primary-color);
    color: white;
}

.listing-price {
    font-size: 22px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 10px;
}

.listing-title {
    font-size: 18px;
    margin-bottom: 8px;
}

.listing-details {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.listing-location {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.listing-location i {
    margin-right: 5px;
}

/* Map Container */
.map-container {
    margin: 40px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#map {
    width: 100%;
    height: 400px;
}

/* Footer */
footer {
    background-color: #000000;
    color: white;
    padding: 60px 0 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer-column ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.brands-grid, .locations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.brand-tag, .location-tag {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    transition: var(--transition);
}

.brand-tag:hover, .location-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--secondary-color);
}

.locations-section {
    margin: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
}

.locations-section h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.app-promo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.app-promo-content {
    flex: 1;
}

.app-promo h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 18px;
}

.app-promo p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    max-width: 400px;
}

.app-download {
    display: flex;
    gap: 15px;
}

.app-btn {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.app-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.app-btn i {
    font-size: 24px;
    margin-right: 10px;
}

.app-btn div {
    display: flex;
    flex-direction: column;
}

.app-btn div span:first-child {
    font-size: 11px;
}

.app-btn div span:last-child {
    font-weight: 600;
    font-size: 16px;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.copyright {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Breadcrumbs */
.breadcrumbs {
    background-color: #f1f3f4;
    padding: 15px 0;
    margin-bottom: 30px;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs .separator {
    margin: 0 10px;
    color: #adb5bd;
}

.breadcrumbs .current {
    color: #000000;
    font-weight: 600;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    z-index: 999;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

#backToTop:hover {
    background-color: #000000;
    transform: translateY(-3px);
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 2000;
    display: none;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-content {
    background-color: white;
    width: 300px;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.close-menu {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-nav-list {
    list-style: none;
}

.mobile-nav-list li {
    margin-bottom: 10px;
}

.mobile-nav-list a {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition);
}

.mobile-nav-list a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.mobile-nav-list a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .footer-columns {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

@media (max-width: 992px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .app-promo {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .app-promo p {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .app-download {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .footer-columns {
        grid-template-columns: 1fr;
    }
    
    .brands-grid, .locations-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Container for sidebar layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.main-content {
    flex: 1;
}

.main-content.with-sidebar {
    flex: 1;
    min-width: 0; /* Prevent overflow */
}

.main-content.full-width {
    width: 100%;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    color: #000000;
    margin-bottom: 10px;
}

.page-header .subtitle {
    color: #6c757d;
    font-size: 16px;
}

/* Active Filters Bar */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.filter-badge {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dee2e6;
}

.filter-badge i {
    cursor: pointer;
    color: #6c757d;
    font-size: 12px;
}

.filter-badge i:hover {
    color: #dc3545;
}

.clear-all {
    margin-left: auto;
    color: #3e48dd;
    text-decoration: none;
    font-weight: 600;
    align-self: center;
}

.clear-all:hover {
    text-decoration: underline;
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.page-link:hover {
    background: #3e48dd;
    color: white;
}

.page-link.active {
    background: #3e48dd;
    color: white;
}

.page-dots {
    padding: 0 10px;
    color: #6c757d;
}

.page-link.next {
    width: auto;
    padding: 0 20px;
    gap: 8px;
}

/* Responsive */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .active-filters {
        flex-direction: column;
    }
    
    .clear-all {
        margin-left: 0;
        margin-top: 10px;
    }
}