/* ========================================
   CSS Variables & Reset
======================================== */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --dark-color: #1e293b;
    --text-color: #475569;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ========================================
   Category Header
======================================== */
.category-header {
    background: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.category-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-info h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-info h1 i {
    color: var(--primary-color);
}

.category-info p {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    transition: var(--transition);
}

.toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* ========================================
   Listings Section
======================================== */
.listings-section {
    padding: 0 0 40px;
}

/* ========================================
   Listings Grid - 4 Columns Desktop
======================================== */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ========================================
   Listing Card
======================================== */
.listing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.listing-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.listing-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--warning-color);
    color: var(--dark-color);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.listing-content {
    padding: 15px;
}

.listing-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-location {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.listing-location i {
    color: var(--primary-color);
    font-size: 12px;
}

/* ========================================
   List View
======================================== */
.listings-grid.list-view {
    grid-template-columns: 1fr;
    gap: 15px;
}

.listings-grid.list-view .listing-card {
    display: flex;
    flex-direction: row;
}

.listings-grid.list-view .listing-image {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
}

.listings-grid.list-view .listing-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px 20px;
}

.listings-grid.list-view .listing-title {
    font-size: 18px;
}

.listings-grid.list-view .listing-location {
    font-size: 14px;
}

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

.page-btn {
    min-width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    color: var(--text-light);
    padding: 0 5px;
}

/* ========================================
   TABLET (1024px) - 3 Columns
======================================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .listing-image {
        height: 160px;
    }
}

/* ========================================
   MOBILE (768px) - 2 Columns
======================================== */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .container {
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
    }
    
    .category-header {
        padding: 15px 0;
        margin-bottom: 15px;
    }
    
    .category-info h1 {
        font-size: 20px;
    }
    
    .category-info p {
        font-size: 12px;
    }
    
    .toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* 2 Columns for Mobile */
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .listing-image {
        height: 140px;
    }
    
    .listing-content {
        padding: 12px;
    }
    
    .listing-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .listing-location {
        font-size: 11px;
    }
    
    .listing-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    /* List View Mobile */
    .listings-grid.list-view {
        grid-template-columns: 1fr;
    }
    
    .listings-grid.list-view .listing-card {
        flex-direction: row;
    }
    
    .listings-grid.list-view .listing-image {
        width: 120px;
        height: 100px;
    }
    
    .listings-grid.list-view .listing-content {
        padding: 10px 12px;
    }
    
    .listings-grid.list-view .listing-title {
        font-size: 14px;
    }
    
    .listings-grid.list-view .listing-location {
        font-size: 12px;
    }
    
    /* Pagination Mobile */
    .pagination {
        margin-top: 25px;
        gap: 5px;
    }
    
    .page-btn {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }
}

/* ========================================
   SMALL MOBILE (480px) - 2 Columns
======================================== */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .category-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .category-info h1 {
        font-size: 18px;
    }
    
    .view-toggle {
        align-self: flex-end;
    }
    
    .toggle-btn {
        width: 34px;
        height: 34px;
    }
    
    /* 2 Columns */
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .listing-image {
        height: 120px;
    }
    
    .listing-content {
        padding: 10px;
    }
    
    .listing-title {
        font-size: 13px;
    }
    
    .listing-location {
        font-size: 10px;
    }
    
    .listing-location i {
        font-size: 10px;
    }
    
    .listing-badge {
        top: 8px;
        left: 8px;
        padding: 2px 6px;
        font-size: 9px;
    }
    
    /* List View Small Mobile */
    .listings-grid.list-view .listing-image {
        width: 100px;
        height: 90px;
    }
    
    .listings-grid.list-view .listing-content {
        padding: 8px 10px;
    }
    
    .listings-grid.list-view .listing-title {
        font-size: 13px;
    }
    
    .listings-grid.list-view .listing-location {
        font-size: 11px;
    }
    
    /* Pagination Small */
    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ========================================
   EXTRA SMALL (360px)
======================================== */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .listings-grid {
        gap: 8px;
    }
    
    .listing-image {
        height: 100px;
    }
    
    .listing-content {
        padding: 8px;
    }
    
    .listing-title {
        font-size: 12px;
    }
    
    .listing-location {
        font-size: 9px;
    }
}



/* ============================================
   VIP & PREMIUM LISTINGS STYLES
   ============================================ */

/* Promoted Sections Container */
.promoted-section {
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 16px;
    position: relative;
}

.vip-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.05) 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.premium-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.05) 100%);
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.regular-section {
    margin-top: 30px;
}

/* Promoted Header */
.promoted-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.promoted-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.promoted-title i {
    font-size: 1.1rem;
}

.vip-title {
    color: #fbbf24;
}

.vip-title i {
    color: #f59e0b;
}

.premium-title {
    color: #60a5fa;
}

.premium-title i {
    color: #3b82f6;
}

.regular-title {
    color: #94a3b8;
}

.regular-title i {
    color: #64748b;
}

.promoted-count {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.vip-section .promoted-count {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.premium-section .promoted-count {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.regular-section .promoted-count {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

/* ============================================
   VIP LISTING CARD STYLES
   ============================================ */
.listing-card-vip {
    position: relative;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2), 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.listing-card-vip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.listing-card-vip:hover {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.35), 0 8px 25px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-8px);
}

/* VIP Badge */
.listing-badge-vip {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
    z-index: 10;
}

.listing-badge-vip i {
    font-size: 0.65rem;
}

/* ============================================
   PREMIUM LISTING CARD STYLES
   ============================================ */
.listing-card-premium {
    position: relative;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2), 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
}

.listing-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.listing-card-premium:hover {
    border-color: #60a5fa !important;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.35), 0 8px 25px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-8px);
}

/* Premium Badge */
.listing-badge-premium {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
    z-index: 10;
}

.listing-badge-premium i {
    font-size: 0.65rem;
}

/* ============================================
   ANIMATION FOR PROMOTED CARDS
   ============================================ */
@keyframes vipGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.2), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.35), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
}

@keyframes premiumGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.2), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.35), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
}

.listing-card-vip {
    animation: vipGlow 3s ease-in-out infinite;
}

.listing-card-premium {
    animation: premiumGlow 3s ease-in-out infinite;
}

/* Pause animation on hover */
.listing-card-vip:hover,
.listing-card-premium:hover {
    animation: none;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .promoted-section {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .promoted-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .promoted-title {
        font-size: 1.1rem;
    }
    
    .promoted-count {
        font-size: 0.75rem;
    }
    
    .listing-badge-vip,
    .listing-badge-premium {
        padding: 4px 8px;
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .promoted-section {
        padding: 12px;
        border-radius: 12px;
    }
    
    .promoted-title {
        font-size: 1rem;
    }
    
    .listing-card-vip::before,
    .listing-card-premium::before {
        height: 3px;
    }
}