/* Huurwoningen Aggregator - Frontend Styles */

/* ========================================
   🎯 SEARCH CTA BANNER
   ======================================== */
.search-cta-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}
.search-cta-banner .cta-content h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}
.search-cta-banner .cta-content p {
    color: rgba(255,255,255,0.95);
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
}
.search-cta-banner .cta-content strong {
    color: #fbbf24;
}

@media (max-width: 768px) {
    .search-cta-banner {
        padding: 20px;
        margin-bottom: 20px;
    }
    .search-cta-banner .cta-content h3 {
        font-size: 1.2rem;
    }
    .search-cta-banner .cta-content p {
        font-size: 0.95rem;
    }
}

/* ========================================
   🎨 SEARCH HERO BOX (Blue Box on Photo)
   ======================================== */
.search-hero-box {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 16px;
    padding: 40px 50px;
    margin: -80px auto 40px;
    max-width: 900px;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.search-hero-box h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.search-stats {
    color: #e67e22;
    font-size: 1.1rem;
    margin: 0 0 20px 0;
}

.search-stats strong {
    font-weight: 700;
}

.new-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-left: 10px;
    display: inline-block;
}

.extension-promo-inline {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.promo-badge-new {
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.promo-text {
    color: rgba(255,255,255,0.95);
    font-size: 0.95rem;
    flex: 1;
}

.promo-link-btn {
    background: white;
    color: #4a90e2;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.promo-link-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .search-hero-box {
        padding: 25px 20px;
        margin: -40px 15px 25px;
        border-radius: 12px;
    }
    
    .search-hero-box h1 {
        font-size: 1.6rem;
    }
    
    .search-stats {
        font-size: 0.95rem;
    }
    
    .extension-promo-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .promo-link-btn {
        width: 100%;
        text-align: center;
    }
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #dc2626;
    font-size: 18px;
}

/* ========================================
   🎯 ADVERTENTIE CARD STYLING
   Voor alle posities: home-hero, top, bottom
   ======================================== */

/* Verberg de overlay caption */
.ad-image-caption {
    display: none !important;
}

/* Ad Banner Container */
.ad-banner {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 20px auto;
    position: relative;
}

/* Horizontal Card Layout */
.ad-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.ad-with-image {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    gap: 0;
}

/* Afbeelding links - compact */
.ad-banner .ad-image {
    width: 180px;
    height: 140px;
    object-fit: contain;
    object-position: center;
    background: #f8fafc;
    padding: 15px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
}

/* Content rechts */
.ad-content-text {
    flex: 1;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ad-content-text h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
    line-height: 1.3;
}

.ad-content-text .ad-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #3c90c0;
    margin: 0;
}

.ad-content-text .ad-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3c90c0;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    width: fit-content;
    transition: background 0.2s;
}

.ad-content-text .ad-cta-btn:hover {
    background: #2d7a9f;
}

/* Banner-only style (als er geen titel/content is) */
.banner-only {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #f8fafc;
}

.banner-only .ad-image {
    width: auto;
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    background: transparent;
    border: none;
    padding: 10px;
}

/* Ad Label (Advertentie badge) */
.ad-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(100, 116, 139, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive - Mobiel (Portrait/Staand) */
@media (max-width: 768px) {
    /* Verberg ALLEEN Chrome extensie promo op mobiel (niet alle ads!) */
    .extension-promo,
    .extension-preview,
    .extension-hero,
    .extension-features,
    .extension-page,
    .inline-ad.promo-extension {
        display: none !important;
    }
    
    /* Advertenties verticaal layout voor mobiel */
    .ad-with-image {
        flex-direction: column !important;
    }
    
    .ad-banner {
        margin: 12px 0 !important;
        max-width: 100% !important;
        border-radius: 8px !important;
    }
    
    /* Afbeelding bovenaan - vierkant formaat */
    .ad-banner .ad-image {
        width: 100% !important;
        height: 140px !important;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding: 10px !important;
        object-fit: contain !important;
        background: #ffffff !important;
    }
    
    /* Content onder afbeelding */
    .ad-content-text {
        text-align: left !important;
        align-items: flex-start !important;
        padding: 10px 12px !important;
    }
    
    .ad-content-text h3 {
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
        margin: 0 0 5px 0 !important;
        font-weight: 600 !important;
    }
    
    .ad-content-text .ad-price {
        font-size: 1.3rem !important;
        margin: 5px 0 !important;
        font-weight: 700 !important;
    }
    
    .ad-content-text .ad-cta-btn {
        font-size: 0.75rem !important;
        padding: 6px 10px !important;
        margin-top: 5px !important;
    }
    
    /* Ad label kleiner op mobiel */
    .ad-label {
        font-size: 8px !important;
        padding: 2px 5px !important;
        top: 5px !important;
        right: 5px !important;
    }
    
    /* Homepage ad container padding */
    .homepage-ad-section .container {
        padding: 8px 12px !important;
    }
    
    /* Banner-only op mobiel compacter */
    .banner-only {
        padding: 10px !important;
    }
    
    .banner-only .ad-image {
        max-height: 110px !important;
    }
    
    /* Ad link geen extra styling */
    .ad-link {
        display: block !important;
    }
}

/* ============================================
   🏠 SCROLLENDE HUIZEN LOADING ANIMATIE
   ============================================ */

/* Desktop: Horizontaal scrollende huizen */
@media (min-width: 769px) {
    .house-loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
    }
    
    .house-scroll-container {
        width: 100%;
        height: 200px;
        overflow: hidden;
        position: relative;
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    }
    
    .house-scroll-track {
        display: flex;
        gap: 20px;
        animation: scrollHouses 20s linear infinite;
        will-change: transform;
    }
    
    .house-item {
        flex-shrink: 0;
        width: 280px;
        height: 180px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        position: relative;
    }
    
    .house-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .house-item-placeholder {
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 64px;
    }
    
    @keyframes scrollHouses {
        0% { transform: translateX(0); }
        100% { transform: translateX(-50%); }
    }
    
    .loading-stats {
        text-align: center;
        color: white;
    }
    
    .loading-stats h2 {
        font-size: 32px;
        font-weight: 700;
        margin: 0 0 15px;
        text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .loading-stats p {
        font-size: 18px;
        opacity: 0.9;
        margin: 0;
    }
    
    .loading-progress {
        width: 400px;
        height: 6px;
        background: rgba(255,255,255,0.2);
        border-radius: 10px;
        overflow: hidden;
        margin-top: 20px;
    }
    
    .loading-progress-bar {
        height: 100%;
        background: linear-gradient(90deg, #10b981, #3b82f6);
        border-radius: 10px;
        animation: progressBar 3s ease-in-out infinite;
    }
    
    @keyframes progressBar {
        0% { width: 0%; }
        50% { width: 70%; }
        100% { width: 100%; }
    }
}

/* Mobiel: Simpele spinner */
@media (max-width: 768px) {
    .house-loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        padding: 20px;
    }
    
    .house-scroll-container {
        display: none; /* Geen scrollende huizen op mobiel */
    }
    
    .mobile-spinner {
        width: 80px;
        height: 80px;
        border: 6px solid rgba(255,255,255,0.2);
        border-top-color: #10b981;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
    
    .loading-stats {
        text-align: center;
        color: white;
    }
    
    .loading-stats h2 {
        font-size: 24px;
        font-weight: 700;
        margin: 0 0 10px;
    }
    
    .loading-stats p {
        font-size: 16px;
        opacity: 0.9;
        margin: 0;
    }
}

/* Legacy fallback styles */
.huurwoningen-ad {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    text-align: center;
    transition: all 0.3s;
}

.huurwoningen-ad:hover {
    border-color: #667eea;
    background: #f1f5f9;
}

.ad-cta {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: transform 0.2s;
}

.ad-cta:hover {
    transform: translateY(-2px);
}

/* 🎯 Match Quality Badges */
.match-badge {
    position: absolute;
    top: 50px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

/* Perfect match - groene badge */
.match-badge.match-perfect {
    background: rgba(16, 185, 129, 0.95);
    color: white;
}

/* Possible match - oranje badge */
.match-badge.match-possible {
    background: rgba(251, 146, 60, 0.95);
    color: white;
}

/* Hover effect */
.woning-card:hover .match-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 🤖 AI Loading Animatie - Horizontaal */
.ai-loading-container {
    padding: 50px 60px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 16px !important;
    color: white !important;
    margin: 0 !important;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3) !important;
    width: 100% !important;
    display: block !important;
    grid-column: 1 / -1 !important; /* Span alle kolommen als in grid */
}

.ai-loading-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 40px !important;
    margin-bottom: 30px !important;
}

.ai-loading-spinner {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.ai-loading-text-wrapper {
    flex: 1;
    text-align: left;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: rgba(255, 255, 255, 0.6);
    animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: rgba(255, 255, 255, 0.4);
    animation-delay: -1s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-loading-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.ai-loading-text {
    font-size: 15px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
}

.ai-loading-steps {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.ai-loading-steps .step {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.5s ease;
    opacity: 0.5;
}

.ai-loading-steps .step.active {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Compactere versie voor "Meer laden" */
.load-more-loading {
    padding: 30px 40px !important;
    margin: 20px 0 !important;
}

.load-more-loading .ai-loading-title {
    font-size: 20px !important;
}

.load-more-loading .ai-loading-text {
    font-size: 14px !important;
}

.load-more-loading .ai-loading-spinner {
    width: 80px !important;
    height: 80px !important;
}

/* 📱 Responsive: Verticaal op mobiel */
@media (max-width: 768px) {
    .ai-loading-container {
        padding: 30px 20px;
    }
    
    .ai-loading-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .ai-loading-text-wrapper {
        text-align: center;
    }
    
    .ai-loading-spinner {
        margin: 0 auto;
        width: 80px;
        height: 80px;
    }
    
    .ai-loading-title {
        font-size: 20px;
    }
    
    .ai-loading-text {
        font-size: 14px;
    }
    
    .ai-loading-steps {
        gap: 10px;
    }
    
    .ai-loading-steps .step {
        font-size: 12px;
        padding: 10px 15px;
    }
}
