/* Frontend Styles for Glasfaser Verfügbarkeit Plugin */

.gf-map-container {
    width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search Box */
.gf-search-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gf-search-box h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.gf-search-form {
    margin-bottom: 15px;
}

.gf-search-hint {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.gf-search-input-group {
    position: relative;
    width: 100%;
}

#gf-search-input {
    width: 100%;
    padding: 12px 120px 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#gf-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.gf-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, background 0.3s;
}

.gf-search-input-group:hover .gf-search-btn,
#gf-search-input:focus ~ .gf-search-btn {
    opacity: 1;
    pointer-events: auto;
}

.gf-search-btn:hover {
    background: #005a87;
}

.gf-search-btn:active {
    transform: translateY(-50%) scale(0.98);
}

/* Search Results */
.gf-search-results {
    margin-top: 20px;
}

.gf-result-count {
    padding: 8px 12px;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 10px;
}

.gf-results-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.gf-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 6px 12px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.gf-search-result-item:hover {
    background: #f0f6fc;
    border-color: #0073aa;
}

.gf-result-address {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    min-width: 140px;
}

.gf-result-location {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gf-result-availability {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.gf-result-availability.available {
    background: #d4edda;
    color: #155724;
}

.gf-result-availability.planned {
    background: #fff3cd;
    color: #856404;
}

.gf-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 6px;
}

.gf-search-error {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 6px;
}

.gf-search-info {
    padding: 15px;
    background: #fff4e5;
    border: 1px solid #ffe0b2;
    color: #8a5300;
    border-radius: 6px;
}

/* Pagination */
.gf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}

.gf-page-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.gf-page-btn:hover {
    background: #005a87;
}

.gf-page-btn:active {
    transform: scale(0.98);
}

.gf-page-info {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

/* Map */
#gf-map {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Custom Marker Popup */
.gf-popup-content {
    min-width: 200px;
}

.gf-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.gf-popup-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.gf-popup-location {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.gf-popup-availability {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.gf-popup-availability.available {
    background: #d4edda;
    color: #155724;
}

.gf-popup-availability.planned {
    background: #fff3cd;
    color: #856404;
}

.gf-popup-booking-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: #0089c8;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s;
}

.gf-popup-booking-btn:hover {
    background: #00abfa;
}

/* Legend */
.gf-legend {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gf-legend h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.gf-legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.gf-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gf-legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.gf-marker-available {
    background: #28a745;
}

.gf-marker-planned {
    background: #ffc107;
}

/* Loading State */
.gf-loading {
    position: relative;
    pointer-events: none;
}

.gf-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: gf-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .gf-search-box {
        padding: 20px 15px;
    }
    
    .gf-search-box h3 {
        font-size: 20px;
    }
    
    #gf-search-input {
        padding: 12px 16px;
    }
    
    .gf-search-btn {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        opacity: 1;
        pointer-events: auto;
    }
    
    .gf-search-btn:active {
        transform: scale(0.98);
    }
    
    .gf-legend-items {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Stack search results on mobile */
    .gf-search-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 12px;
    }
    
    .gf-result-address {
        min-width: auto;
    }
    
    .gf-result-location {
        white-space: normal;
    }
}

/* Custom Leaflet Marker Colors */
.leaflet-marker-icon.gf-marker-green {
    filter: hue-rotate(90deg);
}

.leaflet-marker-icon.gf-marker-yellow {
    filter: hue-rotate(45deg) saturate(1.5);
}
