/* Immobilien Deal-Finder CSS */

@font-face {
    font-family: 'Segment';
    src: url('https://off-market24.app/wp-content/uploads/regular-font.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Segment';
    src: url('https://off-market24.app/wp-content/uploads/semibold-font.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Segment';
    src: url('https://off-market24.app/wp-content/uploads/bold-font.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.idf-container {
    display: flex;
    gap: 20px;
    max-width: 100%;
    height: 100vh;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segment', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    /* GPU-Beschleunigung */
    transform: translateZ(0);
    will-change: transform;
}

/* Sidebar */
.idf-sidebar {
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    height: calc(100vh - 40px);
    padding-right: 10px;
    /* GPU-Layer */
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}

.idf-logo-box {
    margin-bottom: 20px;
    text-align: center;
}

.idf-logo {
    width: 180px;
    height: auto;
}

.idf-info-box {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.idf-info-box #idf-total-count {
    font-weight: bold;
    color: #e91e63;
}

.idf-filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.idf-filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.idf-experimental-badge {
    display: inline-block;
    background: #ffc107;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.idf-input,
.idf-select,
.idf-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd !important;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.idf-input:focus,
.idf-select:focus,
.idf-textarea:focus {
    outline: none;
    border-color: #e91e63;
}

.idf-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.idf-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e91e63;
    cursor: pointer;
}

.idf-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e91e63;
    cursor: pointer;
    border: none;
}

#idf-radius-value {
    font-weight: bold;
    color: #e91e63;
}

.idf-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.idf-range-inputs input {
    flex: 1;
    border: 1px solid #ddd !important;
}

.idf-range-inputs span {
    color: #999;
    font-size: 14px;
}

.idf-btn-search,
.idf-btn-reset {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.idf-btn-search {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    color: #ffffff !important;
    margin-bottom: 10px;
}

.idf-btn-search:hover {
    background: linear-gradient(135deg, #c2185b 0%, #e91e63 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
    color: #ffffff !important;
}

.idf-btn-reset {
    background: #f5f5f5;
    color: #666;
}

.idf-btn-reset:hover {
    background: #e0e0e0;
}

/* Results */
.idf-results {
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 40px);
    padding-right: 10px;
    position: relative;
    min-width: 0;
    /* GPU-Layer + Performance */
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
    contain: layout style paint;
}

/* Map Container - Desktop only */
.idf-map-container {
    width: 40%;
    min-width: 500px;
    height: calc(100vh - 40px);
    position: relative;
    flex-shrink: 0;
    /* GPU-Layer für Map */
    transform: translateZ(0);
    backface-visibility: hidden;
}

#idf-map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    /* GPU-Beschleunigung für Google Maps */
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* Custom Info Window für Map Popup */
.idf-map-popup {
    max-width: 280px;
    padding: 0;
}

.idf-map-popup-content {
    padding: 15px;
}

.idf-map-popup-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.idf-map-popup-score-text {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.idf-map-popup-score-bar {
    width: 63px;
    height: 8px;
    background: #E8ECF5;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.idf-map-popup-score-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.5s ease;
    border-radius: 20px;
}

.idf-map-popup-price {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 8px;
}

.idf-map-popup-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.idf-map-popup-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.idf-map-popup-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.idf-map-popup-btn:hover {
    background: linear-gradient(135deg, #c2185b 0%, #e91e63 100%);
    transform: translateY(-2px);
}

.idf-map-popup-loading {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* Spotlight Glow Animation für Hover-Effekt */
@keyframes spotlightPulse {
    0%, 100% {
        opacity: 0.3;
        stroke-width: 3;
        filter: drop-shadow(0 0 20px #57FFAD);
    }
    50% {
        opacity: 0.6;
        stroke-width: 5;
        filter: drop-shadow(0 0 40px #57FFAD);
    }
}

.spotlight-circle {
    animation: spotlightPulse 1.5s ease-in-out infinite !important;
    pointer-events: none !important;
}

#idf-results-list {
    display: grid;
    gap: 20px;
}

.idf-result-item {
    display: flex;
    gap: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    /* GPU-Beschleunigung + Performance */
    transform: translateZ(0);
    will-change: transform;
    contain: layout style paint;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.idf-result-item:hover {
    transform: translateY(-3px) translateZ(0);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.idf-result-image {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}

.idf-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.idf-blurred-image {
    filter: blur(8px);
}

.idf-placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    color: #999;
    font-size: 12px;
}

.idf-new-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #57FFAD;
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.idf-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Price + Score Row (eine Zeile) */
.idf-price-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.idf-score-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.idf-immoscore-tooltip {
    cursor: help;
    position: relative;
}

.idf-score-bar {
    width: 63px;
    height: 8px;
    background: #E8ECF5;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.idf-score-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.5s ease;
    border-radius: 20px;
}

.idf-result-price {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    white-space: nowrap;
}

.idf-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.idf-result-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

.idf-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.idf-result-meta span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* Exposé Button nicht mehr benötigt - ganzer Eintrag ist klickbar */
.idf-expose-btn {
    display: none;
}

/* Modal */
.idf-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    overflow: auto;
}

.idf-modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.idf-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.idf-modal-close:hover {
    color: #333;
}

.idf-modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.idf-form-group {
    margin-bottom: 20px;
}

.idf-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.idf-form-group .idf-input,
.idf-form-group .idf-select,
.idf-form-group .idf-textarea {
    border: 1px solid #ddd !important;
}

.idf-checkbox-group {
    margin-bottom: 25px;
}

.idf-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal !important;
    font-size: 13px !important;
    line-height: 1.6;
    cursor: pointer;
}

.idf-checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
    cursor: pointer;
}

.idf-checkbox-label span {
    flex: 1;
}

.idf-checkbox-label a {
    color: #e91e63;
    text-decoration: underline;
}

.idf-checkbox-label a:hover {
    color: #c2185b;
}

.idf-btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.idf-btn-submit:hover {
    background: linear-gradient(135deg, #c2185b 0%, #e91e63 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
    color: #ffffff !important;
}

/* Messages */
.idf-loading,
.idf-loading-more {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.idf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.idf-loading::before {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e91e63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.idf-loading-more {
    padding: 20px;
}

.idf-no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.idf-success {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 6px;
    margin-top: 15px;
}

.idf-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    margin-top: 15px;
}

/* Formular 2-Spalten Layout (Desktop) */
.idf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.idf-form-row .idf-form-group {
    margin-bottom: 0;
}

/* Filter Toggle für Mobile */
.idf-filter-toggle {
    display: none;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
}

/* Responsive - Tablet (2 Spalten Karten) */
@media (max-width: 1024px) and (min-width: 769px) {
    .idf-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .idf-sidebar {
        width: 100%;
        height: auto;
        overflow: visible;
        padding-right: 0;
    }

    .idf-filter-toggle {
        display: block;
    }

    /* Filter auf Tablet standardmäßig zugeklappt */
    .idf-filters {
        display: none;
    }

    .idf-filters.collapsed {
        display: none;
    }

    .idf-filters:not(.collapsed) {
        display: block;
    }

    .idf-results {
        height: auto;
        overflow: visible;
        padding-right: 0;
    }

    /* Karte auf Tablet verstecken */
    .idf-map-container {
        display: none;
    }

    /* 2 Spalten Grid für Tablet */
    #idf-results-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Karten-Layout für Tablet */
    .idf-result-item {
        flex-direction: column;
        overflow: hidden;
    }

    .idf-result-image {
        width: 100%;
        height: 180px;
    }

    .idf-result-content {
        width: 100%;
        overflow: hidden;
    }

    .idf-result-price {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .idf-result-meta {
        flex-direction: column;
        gap: 5px;
    }

    .idf-result-meta span {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .idf-result-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .idf-price-score-row {
        flex-wrap: wrap;
    }

    .idf-score-text {
        white-space: normal;
    }
}

/* Responsive - Mobile (1 Spalte) */
@media (max-width: 768px) {
    .idf-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .idf-sidebar {
        width: 100%;
        height: auto;
        overflow: visible;
        padding-right: 0;
    }

    .idf-filter-toggle {
        display: block;
    }

    /* Filter auf Mobile standardmäßig zugeklappt */
    .idf-filters {
        display: none;
    }

    .idf-filters.collapsed {
        display: none;
    }

    .idf-filters:not(.collapsed) {
        display: block;
    }

    .idf-results {
        height: auto;
        overflow: visible;
        padding-right: 0;
    }

    /* Karte auf Mobile verstecken */
    .idf-map-container {
        display: none;
    }

    /* 1 Spalte für Mobile */
    #idf-results-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .idf-result-item {
        flex-direction: column;
        overflow: hidden;
    }

    .idf-result-image {
        width: 100%;
        height: 200px;
    }

    .idf-result-content {
        width: 100%;
        overflow: hidden;
    }

    .idf-result-price {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .idf-result-meta {
        flex-direction: column;
        gap: 5px;
    }

    .idf-result-meta span {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .idf-result-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .idf-price-score-row {
        flex-wrap: wrap;
    }

    .idf-score-text {
        white-space: normal;
    }

    .idf-form-row {
        grid-template-columns: 1fr;
    }
}
