/* ملف التصميم الرئيسي - Dubizzle Style */

* {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1a1a1a;
}

.main-content {
    flex: 1;
    padding-top: 0;
}

/* ========== Navbar - Dubizzle Style ========== */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e8e8e8;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar-brand {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a !important;
}

.navbar-brand .brand-icon {
    color: #e4002b;
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    color: #666666 !important;
    font-weight: 500;
    font-size: 0.95rem;
}

.navbar-nav .nav-link:hover {
    color: #e4002b !important;
}

.navbar .dropdown-menu {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========== Search Hero Section ========== */
.search-hero {
    background-color: #ffffff;
    padding: 2.5rem 0 3rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.search-box-main {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box-main input {
    width: 100%;
    padding: 1.2rem 3.5rem 1.2rem 1.2rem;
    border: 2px solid #e8e8e8;
    border-radius: 50px;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s;
}

.search-box-main input:focus {
    outline: none;
    border-color: #e4002b;
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

.search-box-main input::placeholder {
    color: #999;
}

.search-box-main .search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.3rem;
    cursor: pointer;
}

/* ========== Category Grid - Dubizzle Style ========== */
.categories-section {
    background: #ffffff;
    padding: 2rem 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Mobile 3x3 Grid */
.categories-grid-mobile {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.8rem;
    padding: 0 1rem;
}

.category-item-mobile {
    background: #ffffff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 10px !important;
    padding: 1.2rem 0.5rem !important;
    text-align: center !important;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.category-item-mobile i {
    font-size: 2rem !important;
    color: #e4002b !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.category-item-mobile h6 {
    color: #1a1a1a !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.category-item h6 {
    color: #1a1a1a;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.category-item-mobile h6 {
    color: #1a1a1a;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

/* Mobile Horizontal Slider */
@media (max-width: 768px) {
    .categories-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0 1rem;
        overflow-x: visible;
        scroll-snap-type: none;
    }
    
    .category-item {
        padding: 1.2rem 0.5rem;
        flex: none;
    }
    
    .category-item i {
        font-size: 2rem;
    }
    
    .category-item h6 {
        font-size: 0.75rem;
    }
}

/* ========== Cards ========== */
.card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    transition: all 0.3s;
    overflow: hidden;
    background: #ffffff;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #e4002b;
    transform: translateY(-3px);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.2rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.8rem;
}

/* ========== Buttons - Dubizzle Style ========== */
.btn {
    border-radius: 8px;
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: #e4002b;
    color: white;
}

.btn-primary:hover {
    background: #c50025;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.3);
}

.btn-outline-primary {
    border: 2px solid #e4002b;
    color: #e4002b;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #e4002b;
    color: white;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* ========== Ad Cards - Dubizzle Style ========== */
.ad-card {
    position: relative;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.3s;
}

.ad-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #e4002b;
}

.ad-card .card-body {
    padding: 1rem;
}

.ad-card .price-tag {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e4002b;
}

.ad-featured {
    border: 2px solid #ffc107;
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ffc107;
    color: #1a1a1a;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

/* ========== Badges ========== */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.bg-primary {
    background: #e4002b !important;
}

/* ========== Forms ========== */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid #e8e8e8;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: #e4002b;
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

.form-label {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

/* ========== Stats Cards ========== */
.stat-card {
    background: linear-gradient(135deg, #e4002b 0%, #a10020 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    opacity: 0.9;
    font-size: 1rem;
}

/* ========== Profile ========== */
.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #e8e8e8;
}

.profile-image-small {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

/* ========== Image Gallery ========== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.image-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #e8e8e8;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ========== Footer ========== */
.footer {
    background: #1a1a1a;
    color: #ffffff !important;
    margin-top: auto;
    padding: 2.5rem 0 1.5rem 0;
}

.footer h5 {
    color: #ffffff !important;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

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

.footer a:hover {
    color: #e4002b !important;
}

.footer p, .footer li {
    color: #ffffff !important;
}

.footer .text-muted {
    color: #dddddd !important;
}

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

.footer ul li {
    margin-bottom: 0.5rem;
}

/* ========== Badges - Status ========== */
.verified-badge {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.banned-badge {
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* ========== Alerts ========== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ========== Pagination ========== */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 0.25rem;
    border: 2px solid #e8e8e8;
    color: #1a1a1a;
    font-weight: 600;
}

.pagination .page-link:hover {
    background-color: #e4002b;
    color: white;
    border-color: #e4002b;
}

.pagination .page-item.active .page-link {
    background-color: #e4002b;
    border-color: #e4002b;
}

/* ========== View Counter ========== */
.view-count {
    color: #666;
    font-size: 0.9rem;
}

/* ========== Ad Details ========== */
.ad-detail-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 12px;
}

.detail-label {
    font-weight: 600;
    color: #e4002b;
    margin-right: 0.5rem;
}

/* ========== Tables ========== */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: #f5f5f5;
}

.table-hover tbody tr:hover {
    background: #fafafa;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #e4002b;
}

.breadcrumb-item.active {
    color: #1a1a1a;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .categories-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0 1rem;
    }
    
    .category-item {
        padding: 1.2rem 0.5rem;
        min-height: 100px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .category-item i {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }
    
    .category-item h6 {
        font-size: 0.75rem;
        line-height: 1.2;
        text-align: center;
    }
    
    .card-img-top {
        height: 160px;
    }
    
    .ad-card .card-body {
        padding: 0.8rem;
    }
    
    .ad-card .price-tag {
        font-size: 1.1rem;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    .stat-card h3 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .search-box-main input {
        padding: 1rem 3rem 1rem 3.5rem;
        font-size: 0.9rem;
    }
    
    .search-hero {
        padding: 1.5rem 0 2rem 0;
    }
}

@media (max-width: 576px) {
    .card-img-top {
        height: 140px;
    }
    
    .category-item {
        padding: 1rem 0.4rem;
        min-height: 90px;
    }
    
    .category-item i {
        font-size: 2rem;
    }
    
    .category-item h6 {
        font-size: 0.7rem;
    }
}

/* ========== Loading Spinner ========== */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ========== Hover Effects ========== */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* ========== CTA Card ========== */
.cta-card {
    border: 2px solid #e4002b;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff 0%, #fff5f6 100%);
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.1);
}

/* ========== Bottom Navigation (Mobile) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e8e8e8;
    display: none;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    padding: 8px 0 5px 0;
}

.bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    margin: 0;
}

.bottom-nav .nav-item {
    text-align: center;
    padding: 0.3rem;
    color: #666;
    text-decoration: none;
    flex: 1;
    transition: color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bottom-nav .nav-item:hover,
.bottom-nav .nav-item.active {
    color: #e4002b;
}

.bottom-nav .nav-item i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 0.2rem;
}

.bottom-nav .nav-item span {
    font-size: 0.65rem;
    display: block;
    font-weight: 500;
}

.bottom-nav .nav-item.post-ad {
    position: relative;
    margin-top: -35px;
    padding: 0;
}

.bottom-nav .nav-item.post-ad .post-ad-circle {
    background: #e4002b;
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.3);
}
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 56px;
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.4);
}

.bottom-nav .nav-item.post-ad i {
    font-size: 1.8rem;
    margin: 0;
}

.bottom-nav .nav-item.post-ad span {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: 70px;
    }
    
    .navbar {
        display: none !important;
    }
}

/* Fix Card Images for Mobile */
@media (max-width: 768px) {
    .card-img-top {
        height: 140px !important;
        object-fit: cover;
    }
    
    .ad-card .card-body {
        padding: 0.7rem !important;
    }
    
    .ad-card .price-tag {
        font-size: 1rem !important;
    }
    
    .card-title {
        font-size: 0.85rem !important;
    }
}
/* Force Categories to Show - Mobile Fix */
.categories-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #ffffff;
    padding: 1.5rem 0;
}

.categories-grid-mobile {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.8rem !important;
    padding: 0 1rem !important;
    visibility: visible !important;
}

.category-item-mobile {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 10px !important;
    padding: 1.2rem 0.5rem !important;
    text-align: center !important;
    text-decoration: none !important;
    min-height: 100px !important;
    visibility: visible !important;
}

.category-item-mobile i {
    display: block !important;
    font-size: 2rem !important;
    color: #e4002b !important;
    margin-bottom: 0.5rem !important;
    visibility: visible !important;
}

.category-item-mobile h6 {
    display: block !important;
    color: #1a1a1a !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    visibility: visible !important;
}

.category-item-mobile:hover {
    border-color: #e4002b !important;
    box-shadow: 0 2px 8px rgba(228, 0, 43, 0.15) !important;
}

/* Better No-Image Placeholder */
.no-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e8e8e8;
}

.no-image-placeholder i {
    font-size: 3rem;
    color: #cccccc;
}

@media (max-width: 768px) {
    .no-image-placeholder {
        height: 140px;
    }
    
    .no-image-placeholder i {
        font-size: 2rem;
    }
}
/* ========== FORCE CATEGORIES TO SHOW ========== */
.categories-section {
    display: block !important;
    visibility: visible !important;
    background: #ffffff !important;
    padding: 1.5rem 0 !important;
    width: 100% !important;
}

.categories-grid-mobile {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.8rem !important;
    padding: 0 1rem !important;
    width: 100% !important;
    visibility: visible !important;
}

.category-item-mobile {
    background: #ffffff !important;
    border: 2px solid #e8e8e8 !important;
    border-radius: 10px !important;
    padding: 1.2rem 0.5rem !important;
    text-align: center !important;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100px !important;
    width: 100% !important;
}

.category-item-mobile i {
    font-size: 2rem !important;
    color: #e4002b !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.category-item-mobile h6 {
    color: #1a1a1a !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: block !important;
}

/* ========== FIX IMAGE ASPECT RATIO ========== */
.card-img-top {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Mobile */
@media (max-width: 768px) {
    .card-img-top {
        height: 150px !important;
    }
}

/* ========== NO IMAGE PLACEHOLDER ========== */
.no-image-placeholder {
    width: 100% !important;
    height: 200px !important;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.no-image-placeholder i {
    font-size: 3rem !important;
    color: #cccccc !important;
}

@media (max-width: 768px) {
    .no-image-placeholder {
        height: 150px !important;
    }
}

/* ========== FINAL IMAGE FIX - SQUARE ASPECT RATIO ========== */
.card-img-top {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center !important;
    max-height: none !important;
}

.no-image-placeholder {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
}

/* Desktop */
@media (min-width: 769px) {
    .col-md-3 .card-img-top,
    .col-md-4 .card-img-top,
    .col-lg-3 .card-img-top {
        aspect-ratio: 1 / 1 !important;
    }
}

/* Mobile - Stay Square */
@media (max-width: 768px) {
    .col-6 .card-img-top {
        aspect-ratio: 1 / 1 !important;
    }
}
