/* ====================================
   BELHOCKAZ - Search Page Styles
   ==================================== */

/* Ad Card Styles */
.ad-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

/* Premium Badge on Cards */
.ad-card.premium-card {
    border: 2px solid #fbbf24;
    box-shadow: 
        0 4px 12px rgba(251, 191, 36, 0.25),
        0 0 20px rgba(251, 191, 36, 0.15);
}

.ad-card.premium-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 20px rgba(251, 191, 36, 0.35),
        0 0 30px rgba(251, 191, 36, 0.25);
    border-color: #fbbf24;
}

.premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
    animation: pulse-gentle 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulse-gentle {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.9;
        transform: scale(1.05);
    }
}

/* Ad Card Image */
.ad-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    transition: transform 0.3s ease;
}

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

/* Ad Card Content */
.ad-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.ad-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 12px;
    flex-wrap: wrap;
    min-height: 28px;
}

.ad-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1f2937;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.ad-card-seller {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ad-card-price-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ad-card-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ea580c;
}

.ad-card-original-price {
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.ad-card-discount {
    font-size: 0.875rem;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 4px 8px;
    border-radius: 6px;
}

.ad-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.75rem;
    color: #6b7280;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-condition {
    background: #dbeafe;
    color: #1e40af;
}

.badge-location {
    background: #fef3c7;
    color: #92400e;
}

.badge-distance {
    background: #e0e7ff;
    color: #3730a3;
}

/* Filter Tag */
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.filter-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag button:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Mobile Filters Sidebar */
@media (max-width: 1023px) {
    #filtersSidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        z-index: 100;
        overflow-y: auto;
        padding: 1rem;
    }
    
    #filtersSidebar.show {
        left: 0;
        display: block !important;
    }
    
    /* Overlay */
    .filters-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .filters-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

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

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Grid */
@media (min-width: 640px) {
    #resultsGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #resultsGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Smooth Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Focus Styles */
input:focus,
select:focus,
button:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
