/* Visionside Wohnungen Plugin Styles */

/* Filter Container */
.vsw-filter-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.vsw-filter-top {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.vsw-filter-zimmer,
.vsw-filter-preis,
.vsw-filter-wohnflaeche {
    flex: 1;
    min-width: 200px;
}

.vsw-filter-zimmer-top,
.vsw-filter-preis-top,
.vsw-filter-wohnflaeche-top {
    margin-bottom: 10px;
}

.vsw-filter-zimmer-top label,
.vsw-filter-preis-top label,
.vsw-filter-wohnflaeche-top label {
    font-weight: 600;
    color: #495057;
    display: block;
}

.vsw-filter-zimmer-bottom,
.vsw-filter-preis-bottom,
.vsw-filter-wohnflaeche-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Range Inputs */
input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Value Display */
#vsw-zimmer-value,
#vsw-preis-value,
#vsw-wohnflaeche-value {
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Filter Bottom */
.vsw-filter-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 15px;
}

.vsw-filter-bottom-left label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

.vsw-filter-bottom-left input[type="checkbox"] {
    margin: 0;
}

.vsw-filter-bottom-right {
    display: flex;
    gap: 10px;
}

/* Buttons */
#vsw-btn-zuruecksetzen,
#vsw-btn-suchen {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

#vsw-btn-zuruecksetzen {
    background: #6c757d;
    color: white;
}

#vsw-btn-zuruecksetzen:hover {
    background: #5a6268;
}

#vsw-btn-suchen {
    background: #007cba;
    color: white;
}

#vsw-btn-suchen:hover {
    background: #005a87;
}

/* Table Styles */
.vsw-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.vsw-table th {
    background: #007cba;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.vsw-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

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

.vsw-table tbody tr:last-child td {
    border-bottom: none;
}

/* Hide filtered rows */
.vsw-wohnung-row.hidden {
    display: none;
}

/* Status indicators */
.vsw-table td:last-child {
    font-weight: 600;
}

.vsw-table tbody tr[data-status*="verfügbar"] td:last-child,
.vsw-table tbody tr[data-status*="available"] td:last-child {
    color: #28a745;
}

.vsw-table tbody tr[data-status*="reserviert"] td:last-child,
.vsw-table tbody tr[data-status*="reserved"] td:last-child {
    color: #ffc107;
}

.vsw-table tbody tr[data-status*="verkauft"] td:last-child,
.vsw-table tbody tr[data-status*="sold"] td:last-child {
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vsw-filter-top {
        flex-direction: column;
    }
    
    .vsw-filter-zimmer,
    .vsw-filter-preis,
    .vsw-filter-wohnflaeche {
        min-width: 100%;
    }
    
    .vsw-filter-bottom {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vsw-filter-bottom-right {
        justify-content: center;
    }
    
    .vsw-table {
        font-size: 12px;
    }
    
    .vsw-table th,
    .vsw-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 600px) {
    .vsw-table,
    .vsw-table thead,
    .vsw-table tbody,
    .vsw-table th,
    .vsw-table td,
    .vsw-table tr {
        display: block;
    }
    
    .vsw-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .vsw-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
    }
    
    .vsw-table td {
        border: none;
        position: relative;
        padding-left: 50%;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .vsw-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #007cba;
    }
}

/* Loading state */
.vsw-loading {
    opacity: 0.6;
    pointer-events: none;
}

.vsw-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007cba;
    border-radius: 50%;
    border-top-color: transparent;
    animation: vsw-spin 1s linear infinite;
}

@keyframes vsw-spin {
    to {
        transform: rotate(360deg);
    }
}
