/* Rntup - Main Stylesheet */

:root {
    --primary: #1976D2;
    --primary-dark: #1565C0;
    --primary-light: #BBDEFB;
    --secondary: #FF6B35;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #F44336;
    --dark-bg: #121212;
    --dark-card: #1E1E1E;
    --dark-border: #2C2C2C;
    --light-bg: #F5F5F5;
    --light-card: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;

    /* RNTUP v2.0 tokens */
    --rntup-featured-glow: 0 0 0 2px #ffd76a, 0 0 18px rgba(255, 200, 60, 0.55);
    --rntup-new-bg: #16a34a;
    --rntup-rented-bg: #dc2626;
    --rntup-available-bg: #059669;
    --rntup-urgent-bg: #f97316;
    --rntup-popular-bg: linear-gradient(90deg,#f59e0b,#dc2626);
}

/* v2.0 Listing card — Premium featured glow */
.card-featured {
    box-shadow: var(--rntup-featured-glow);
    border: 1px solid #ffd76a !important;
    animation: rntupFeaturedPulse 2.6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.card-featured::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,215,106,0.08) 0%, transparent 40%, transparent 60%, rgba(255,215,106,0.08) 100%);
    z-index: 1;
}
@keyframes rntupFeaturedPulse {
    0%, 100% { box-shadow: 0 0 0 2px #ffd76a, 0 0 12px rgba(255, 200, 60, 0.30); }
    50%      { box-shadow: 0 0 0 2px #ffd76a, 0 0 24px rgba(255, 200, 60, 0.70); }
}
@media (prefers-reduced-motion: reduce) {
    .card-featured { animation: none; }
}

/* v2.0 Badges */
.badge-new            { background: var(--rntup-new-bg);       color: #fff; font-weight: 600; letter-spacing: .3px; }
.badge-rented         { background: var(--rntup-rented-bg);    color: #fff; }
.badge-available      { background: var(--rntup-available-bg); color: #fff; }
.badge-urgent         { background: var(--rntup-urgent-bg);    color: #fff; }
.badge-popular        { background: var(--rntup-popular-bg);   color: #fff; font-weight: 600; letter-spacing: .3px; padding-inline: 10px; }
.badge-verified       { background: #0ea5e9;                   color: #fff; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.badge-verified i     { font-size: .95em; }

/* Favorite button active state */
.favorite-btn.active i.bi-heart-fill,
.favorite-btn .bi-heart-fill { color: #ff4757; }

/* v2.0 Live character counter */
.char-counter         { font-size: .8rem; color: #6b7280; }
.char-counter.warn    { color: #dc2626; font-weight: 600; }

/* Auth Pages */
.auth-page {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.auth-icon {
    font-size: 4rem;
    color: var(--primary);
}

/* Profile Page */
.profile-sidebar {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.profile-avatar i {
    font-size: 3rem;
    color: var(--primary);
}

.profile-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Add Listing Page */
.add-listing-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Navbar Logo */
.navbar-brand img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

/* Logo dark/light mode support */
.navbar-brand .logo-dark {
    display: none;
}

.navbar-brand .logo-light {
    display: inline-block;
}

/* Dark mode - show dark logo */
@media (prefers-color-scheme: dark) {
    .navbar-brand .logo-dark {
        display: inline-block;
    }
    .navbar-brand .logo-light {
        display: none;
    }
}

/* Image Upload Area */
.image-upload-area {
    background: #f8f9fa;
}

/* Base Styles */
body {
    font-family: 'Cairo', sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

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

.btn-secondary-custom {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.btn-secondary-custom:hover {
    background: #e55a2b;
    border-color: #e55a2b;
    color: white;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 12px 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary) !important;
}

.navbar-brand i {
    margin-inline-start: 8px;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
    color: white;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* Search Box */
.search-box {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.search-box .form-control,
.search-box .form-select {
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
}

.search-box .form-control:focus,
.search-box .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.search-box .btn {
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 600;
}

/* Category Cards */
.category-card {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-decoration: none !important;
}

.category-card:hover {
    text-decoration: none !important;
}

.category-card:hover,
.category-card.active {
    border-color: var(--primary);
    background: rgba(25, 118, 210, 0.05);
    transform: translateY(-3px);
}

.category-card .category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(25, 118, 210, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.category-card .category-icon i,
.category-card i {
    font-size: 1.8rem;
    color: var(--primary);
}

.category-card h5,
.category-card h6 {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-primary);
}

/* Marketplace Grid Layout */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .marketplace-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1200px) {
    .marketplace-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Listing Cards - Facebook Marketplace Style */
.listing-card {
    background: white;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.listing-card .card-img-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.listing-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.listing-card:hover .card-img-top {
    transform: scale(1.03);
}

.listing-card .badge-type {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.listing-card .favorite-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.4);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 14px;
}

.listing-card .favorite-btn:hover,
.listing-card .favorite-btn.active {
    background: #F44336;
}

.listing-card .card-body {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.listing-card .listing-price {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    line-height: 1.2;
}

.listing-card .listing-price small {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.listing-card .listing-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card .listing-location {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.listing-card .listing-location i {
    font-size: 0.7rem;
}

.listing-card .listing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: auto;
}

.listing-card .listing-features span {
    display: flex;
    align-items: center;
    gap: 2px;
}

.listing-card .listing-features i {
    font-size: 0.7rem;
}

/* Legacy support for listing-image */
.listing-card .listing-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.listing-card .listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.listing-card .listing-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.listing-card .listing-badge.car-badge {
    background: var(--secondary);
}

.listing-card .listing-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.listing-card .btn {
    display: none;
}

/* Trusted Badge */
.trusted-badge {
    color: var(--success);
}

/* Section Titles */
.section-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Stats Section */
.stats-section {
    background: var(--primary);
    color: white;
    padding: 60px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    opacity: 0.9;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #e55a2b 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.cta-section h2 {
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section .btn {
    background: white;
    color: var(--secondary);
    font-weight: 600;
    padding: 12px 32px;
}

/* Footer */
.footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 60px 0 30px;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: white;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    margin-top: 40px;
    text-align: center;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin: 0 5px;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary);
    border-radius: 8px;
    margin: 0 3px;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* Filters Sidebar */
.filters-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.filters-card h5 {
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Details Page */
.details-gallery {
    border-radius: 16px;
    overflow: hidden;
}

.details-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.details-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.details-thumbnails img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.details-thumbnails img:hover,
.details-thumbnails img.active {
    opacity: 1;
}

.details-info-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.owner-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.owner-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    font-weight: 600;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Language Switcher */
.lang-switcher .dropdown-toggle {
    background: transparent;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .search-box {
        padding: 16px;
    }
    
    .category-card {
        padding: 14px 10px;
    }
    
    .category-card .category-icon {
        width: 50px;
        height: 50px;
    }
    
    .category-card .category-icon i,
    .category-card i {
        font-size: 1.5rem;
    }
    
    .category-card h5 {
        font-size: 0.8rem;
    }
}

/* Featured Listings Badges */
.featured-listing {
    border: 2px solid #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.listing-image {
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.featured-badge i {
    font-size: 10px;
}

.badge-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.badge-silver {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.badge-bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.badge-featured {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.featured-listing .listing-card {
    border-color: #FFD700;
}

.featured-listing.listing-card {
    position: relative;
    overflow: visible;
}

.featured-listing.listing-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: inherit;
    z-index: -1;
}

/* Admin Banners Section */
.admin-banners-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.admin-banners-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.admin-banners-slider::-webkit-scrollbar {
    display: none;
}

.admin-banner-card {
    flex: 0 0 350px;
    scroll-snap-align: start;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
}

.admin-banner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.admin-banner-card .banner-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.admin-banner-card .banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-banner-card .featured-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-banner-card .banner-content {
    padding: 16px;
}

.admin-banner-card .banner-content h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-banner-card .banner-location {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-banner-card .banner-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .admin-banner-card {
        flex: 0 0 280px;
    }
    
    .admin-banner-card .banner-image {
        height: 150px;
    }
}

/* Notification dropdown — full width on small screens */
@media (max-width: 576px) {
    .dropdown-menu#notifDropdown.show,
    #notifDropdown.dropdown-menu.show,
    #notifDropdown[data-bs-popper] {
        position: fixed !important;
        top: 64px !important;
        left: 8px !important;
        right: 8px !important;
        bottom: auto !important;
        inset: 64px 8px auto 8px !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        transform: none !important;
        margin: 0 !important;
        max-height: 75vh;
        overflow-y: auto;
        z-index: 1060 !important;
    }
    #notifList {
        max-height: calc(75vh - 90px) !important;
    }
}


/* V6.04 — Photo Reorder Drag/Drop */
.photo-item { cursor: grab; user-select: none; }
.photo-item.dragging { opacity: 0.4; cursor: grabbing; }
.photo-item.is-cover { box-shadow: 0 0 0 3px #16a34a; border-radius: 6px; }
.photo-item.is-cover::after { content: "\2605"; position: absolute; top: 4px; left: 4px; color: #16a34a; font-size: 1.4rem; line-height: 1; pointer-events: none; }
