/**
 * TopAnnonces.ch - Main Styles
 * Petites annonces suisses
 */

/* =====================================================
   VARIABLES & THEME
   ===================================================== */
:root {
    --primary: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #7DD3FC;
    --secondary: #1f2937;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #6366f1;
    
    --bg-primary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* =====================================================
   BASE STYLES
   ===================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover { 
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

.btn-primary:disabled { 
    background: #D1D5DB; 
    cursor: not-allowed; 
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #F3F4F6;
    color: var(--secondary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover { 
    background-color: #E5E7EB; 
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
}

/* Listing Card */
.listing-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.listing-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: #f2f2f2;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

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

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

.listing-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    box-shadow: var(--shadow-sm);
}

.listing-card-favorite {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s;
}

.listing-card-favorite:hover {
    transform: scale(1.1);
}

.listing-card-favorite.active {
    background: #fee2e2;
    color: #ef4444;
}

.listing-card-content {
    padding: 1rem;
}

.listing-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.listing-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
}

/* Badge styles */
.listing-badge-featured {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.listing-badge-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.badge-condition {
    background: rgba(255,255,255,0.95);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* List view card */
.listing-card-list {
    display: flex;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.listing-card-list:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.listing-card-list-image {
    width: 200px;
    aspect-ratio: 4/3;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    background: #f2f2f2;
    border-radius: 12px 0 0 12px;
}

.listing-card-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

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

.listing-card-list-content {
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    min-width: 0;
}

.listing-card-favorite-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.listing-card-favorite-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.listing-card-favorite-btn.active {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
}

/* Listings grid and list containers */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

.listings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Listings header with view toggle */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.view-toggle {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    gap: 0.25rem;
}

.view-toggle-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.view-toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Active filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.filter-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    display: flex;
}

.filter-tag button:hover {
    color: var(--danger);
}

/* Loading and empty states */
.listings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    gap: 1rem;
}

.listings-empty {
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

/* Load more button */
.btn-load-more {
    background: white;
    border: 2px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: var(--radius-xl);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-load-more:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(14, 165, 233, 0.05);
}

/* Section title */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

/* Categories section */
.categories-section {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

/* Categories grid - card style */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card.active {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.05);
}

.category-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
}

.category-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-primary);
}

.category-card-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

/* =====================================================
   HERO ENHANCED
   ===================================================== */
.hero-enhanced {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 50%, #0369A1 100%);
    padding: 3rem 1rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title-enhanced {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-title-highlight {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle-enhanced {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
}

/* Search box enhanced */
.hero-search-enhanced {
    max-width: 700px;
}

.hero-search-inner {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.hero-search-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 0;
}

.hero-search-field i {
    color: var(--text-muted);
    flex-shrink: 0;
}

.hero-search-field input,
.hero-search-field select {
    border: none;
    background: none;
    font-size: 1rem;
    width: 100%;
    outline: none;
    color: var(--text-primary);
}

.hero-search-field input::placeholder {
    color: var(--text-muted);
}

.hero-search-field select {
    cursor: pointer;
    min-width: 150px;
}

.hero-search-field select option {
    color: var(--text-primary);
}

.hero-search-divider {
    width: 1px;
    height: 2rem;
    background: var(--border-color);
}

.hero-search-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hero-search-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* Hero stats */
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.hero-stat i {
    color: rgba(255,255,255,0.7);
}

.hero-stat small {
    font-weight: 400;
    opacity: 0.8;
}

/* =====================================================
   RESPONSIVE HERO
   ===================================================== */
@media (min-width: 768px) {
    .hero-enhanced {
        padding: 4rem 2rem 5rem;
    }
    
    .hero-title-enhanced {
        font-size: 3.5rem;
    }
}

@media (max-width: 640px) {
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-search-inner {
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .hero-search-field {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem;
    }
    
    .hero-search-field:last-of-type {
        border-bottom: none;
    }
    
    .hero-search-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .listing-card-list {
        flex-direction: column;
    }
    
    .listing-card-list-image {
        width: 100%;
        aspect-ratio: 16/9;
        border-radius: 12px 12px 0 0;
    }
    
    .listing-card-list-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* =====================================================
   FORMS & INPUTS
   ===================================================== */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field-lg {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

textarea.input-field {
    min-height: 150px;
    resize: vertical;
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5rem;
    padding-right: 2.5rem;
}

/* Search bar */
.search-bar {
    position: relative;
}

.search-bar input {
    padding-left: 3rem;
    padding-right: 6rem;
}

.search-bar .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar .search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 4rem;
    gap: 1.5rem;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.navbar-link:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}

.navbar-link.active {
    background: var(--primary);
    color: white;
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleIn 0.2s ease-out;
    padding: 1.5rem;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* =====================================================
   STATUS BADGES
   ===================================================== */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-sold { background: #dbeafe; color: #1d4ed8; }
.badge-paused { background: #f3f4f6; color: #6b7280; }
.badge-expired { background: #fee2e2; color: #dc2626; }
.badge-featured { background: #fef3c7; color: #b45309; }
.badge-urgent { background: #fee2e2; color: #dc2626; }
.badge-new { background: #dcfce7; color: #15803d; }
.badge-like_new { background: #dbeafe; color: #1d4ed8; }
.badge-good { background: #e0e7ff; color: #4338ca; }
.badge-fair { background: #fef3c7; color: #d97706; }

/* =====================================================
   CATEGORY PILLS
   ===================================================== */
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.category-pill:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.05);
}

.category-pill.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.category-pill .icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   FILTERS SIDEBAR
   ===================================================== */
.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

/* =====================================================
   PRICE RANGE SLIDER
   ===================================================== */
.price-range {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.price-input {
    flex: 1;
    position: relative;
}

.price-input::before {
    content: 'CHF';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.price-input input {
    padding-left: 3rem;
}

/* =====================================================
   USER AVATAR
   ===================================================== */
.avatar, .avatar-sm, .avatar-lg, .avatar-xl {
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    overflow: hidden;
}

.avatar { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.5rem; }
.avatar-xl { width: 6rem; height: 6rem; font-size: 2rem; }

.avatar img, .avatar-sm img, .avatar-lg img, .avatar-xl img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    background: rgba(14, 165, 233, 0.1);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }
.toast-info { border-color: var(--info); }

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

/* =====================================================
   LOADING STATES
   ===================================================== */
.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

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

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease-out forwards; }
.animate-spin { animation: spin 1s linear infinite; }

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-search {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.hero-search input,
.hero-search select {
    flex: 1;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    background: transparent;
}

.hero-search input::placeholder {
    color: var(--text-muted);
}

.hero-search select option {
    color: var(--text-primary);
}

.hero-search input:focus,
.hero-search select:focus {
    outline: none;
}

.hero-search select {
    flex: none;
    cursor: pointer;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 1rem;
}

.footer a {
    color: #9ca3af;
    transition: color 0.2s;
}

.footer a:hover {
    color: white;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-search {
        flex-direction: column;
    }
    
    .hero-search input {
        padding: 0.75rem;
    }
    
    .navbar-nav {
        display: none;
    }
    
    .listing-card-content {
        padding: 0.75rem;
    }
}

/* =====================================================
   PRICE HISTOGRAM SLIDER
   ===================================================== */
.price-histogram-slider {
    width: 100%;
    padding: 0.5rem 0;
}

.histogram-bars {
    display: flex;
    align-items: flex-end;
    height: 60px;
    gap: 2px;
    margin-bottom: 0.5rem;
    padding: 0 2px;
}

.histogram-bar {
    flex: 1;
    background: var(--gray-200);
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: background-color 0.2s;
}

.histogram-bar.active {
    background: var(--primary);
}

.dual-range-slider {
    position: relative;
    height: 20px;
}

.dual-range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 50%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.dual-range-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Track background */
.dual-range-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    transform: translateY(-50%);
    z-index: 1;
}

.range-track-highlight {
    position: absolute;
    top: 50%;
    height: 6px;
    background: var(--primary);
    border-radius: 3px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =====================================================
   DRAG AND DROP IMAGES
   ===================================================== */
.cursor-grab {
    cursor: grab;
}

.cursor-grab:active {
    cursor: grabbing;
}

[draggable="true"] {
    user-select: none;
    -webkit-user-select: none;
}

[draggable="true"]:hover .drag-handle {
    opacity: 1;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.bg-primary { background-color: var(--primary); }
.bg-primary-light { background-color: rgba(14, 165, 233, 0.1); }

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