/* Slovakia Map Component Styles */

/* Odstránenie focus outline z Leaflet interaktívnych elementov */
.leaflet-interactive:focus {
    outline: none !important;
}

.leaflet-container path:focus,
.leaflet-container svg:focus {
    outline: none !important;
}

.slovakia-map-container {
    position: relative;
    width: 100%;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* Legend */
.slovakia-map-legend {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
    min-width: 140px;
}

.legend-gradient {
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.legend-range {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #666;
}

.legend-no-data {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #e5e5e5;
    font-size: 0.7rem;
    color: #888;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Layer Control */
.slovakia-map-layer-control {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.slovakia-map-layer-control .btn-group-vertical {
    display: flex;
    flex-direction: column;
}

.slovakia-map-layer-control .btn {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    background: transparent;
    color: #666;
    transition: all 0.15s ease;
}

.slovakia-map-layer-control .btn:last-child {
    border-bottom: none;
}

.slovakia-map-layer-control .btn:hover {
    background: #f0f0f0;
    color: #333;
}

.slovakia-map-layer-control .btn.active {
    background: #206bc4;
    color: #fff;
}

.slovakia-map-layer-control .btn.active:hover {
    background: #1a5aa8;
}

/* Tooltip - Redesigned for better hierarchy */
.slovakia-map-tooltip {
    background: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    min-width: 180px;
    max-width: 280px;
}

.slovakia-map-tooltip::before {
    display: none;
}

/* Tooltip structure */
.tooltip-header {
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 14px 8px;
    margin: 0;
}

.tooltip-primary {
    text-align: center;
    padding: 12px 14px;
}

.tooltip-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937;
}

/* Smaller font for longer values (agency names, dual percentages) */
.tooltip-value.competition,
.tooltip-value.ratio {
    font-size: 1.25rem;
}

/* Handle long agency names */
.tooltip-value.competition {
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Color variants for different metric types */
.tooltip-value.yield { color: #059669; }       /* Green - rental yield */
.tooltip-value.price { color: #2563eb; }       /* Blue - price */
.tooltip-value.ratio { color: #7c3aed; }       /* Purple - ratio */
.tooltip-value.count { color: #ea580c; }       /* Orange - count */
.tooltip-value.competition { color: #dc2626; } /* Red - competition */

.tooltip-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

.tooltip-details {
    font-size: 0.8125rem;
    padding: 0 14px 10px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px dotted #e5e7eb;
}

.tooltip-row:last-child {
    border-bottom: none;
}

.tooltip-detail-label {
    color: #6b7280;
    flex-shrink: 0;
}

.tooltip-detail-value {
    font-weight: 600;
    color: #374151;
    text-align: right;
    margin-left: 12px;
}

.tooltip-footer {
    font-size: 0.6875rem;
    color: #9ca3af;
    text-align: right;
    padding: 8px 14px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
}

/* Mini progress bar for ratio tooltips */
.tooltip-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
}

.tooltip-progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.tooltip-progress-fill {
    height: 100%;
    background: #7c3aed;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tooltip-progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

/* Empty state in tooltip */
.tooltip-empty {
    padding: 16px 14px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}

/* Legacy support - keep for backwards compatibility */
.slovakia-map-tooltip strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 4px;
    color: #333;
}

.slovakia-map-tooltip small {
    color: #888;
}

.slovakia-map-tooltip em {
    color: #999;
    font-style: italic;
}

/* View Type Selector */
.map-view-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.map-view-selector .btn-check:checked + .btn {
    background-color: #206bc4;
    border-color: #206bc4;
    color: #fff;
}

/* Loading State */
.slovakia-map-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #206bc4;
    border-radius: 50%;
    animation: slovakia-map-spin 0.8s linear infinite;
}

@keyframes slovakia-map-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Empty State */
.slovakia-map-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #999;
    text-align: center;
    padding: 2rem;
}

.slovakia-map-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.slovakia-map-empty p {
    margin: 0;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .slovakia-map-legend {
        padding: 6px 8px;
        min-width: 100px;
    }

    .legend-gradient {
        height: 10px;
    }

    .legend-range {
        font-size: 0.65rem;
    }

    .legend-no-data {
        font-size: 0.65rem;
    }

    .legend-color {
        width: 14px;
        height: 8px;
    }

    .slovakia-map-layer-control .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .slovakia-map-tooltip {
        font-size: 0.8125rem;
        padding: 8px 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .slovakia-map-legend,
    .slovakia-map-layer-control {
        background: rgba(30, 30, 30, 0.95);
    }

    .legend-range {
        color: #aaa;
    }

    .legend-no-data {
        border-top-color: #444;
        color: #888;
    }

    .slovakia-map-layer-control .btn {
        border-bottom-color: #444;
        color: #aaa;
    }

    .slovakia-map-layer-control .btn:hover {
        background: #333;
        color: #e0e0e0;
    }

    .slovakia-map-tooltip {
        background: rgba(30, 30, 30, 0.98);
        color: #e0e0e0;
    }

    .slovakia-map-tooltip strong {
        color: #fff;
    }

    .tooltip-header {
        color: #e5e7eb;
        border-bottom-color: #4b5563;
    }

    .tooltip-value {
        color: #f3f4f6;
    }

    /* Lighter color variants for dark mode */
    .tooltip-value.yield { color: #34d399; }       /* Light green */
    .tooltip-value.price { color: #60a5fa; }       /* Light blue */
    .tooltip-value.ratio { color: #c4b5fd; }       /* Light purple/violet */
    .tooltip-value.count { color: #fb923c; }       /* Light orange */
    .tooltip-value.competition { color: #f87171; } /* Light red */

    .tooltip-label {
        color: #9ca3af;
    }

    .tooltip-row {
        border-bottom-color: #4b5563;
    }

    .tooltip-detail-label {
        color: #9ca3af;
    }

    .tooltip-detail-value {
        color: #e5e7eb;
    }

    .tooltip-footer {
        color: #6b7280;
        border-top-color: #4b5563;
        background: rgba(20, 20, 20, 0.5);
    }

    .tooltip-progress-bar {
        background: #4b5563;
    }

    .tooltip-progress-label {
        color: #e5e7eb;
    }

    .tooltip-empty {
        color: #6b7280;
    }
}
