/**
 * WP Display EU - Styles
 * Stiluri pentru afișarea hărții Europei pe zone
 */

/* Container principal */
.wp-display-eu-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header */
.wp-display-eu-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.wp-display-eu-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #003399;
}

.wp-display-eu-header .zone-description {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Map wrapper */
.wp-display-eu-map-wrapper {
    position: relative;
    margin-bottom: 30px;
    overflow: visible;
}

.wp-display-eu-map {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 0;
    box-sizing: border-box;
}

.wp-display-eu-map svg {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

/* Asigură că toate elementele SVG interne respectă dimensiunile */
.wp-display-eu-map svg * {
    vector-effect: non-scaling-stroke;
}

/* SVG Elements - Țări din alte zone (estompate) */
.wp-display-eu-map svg path.other-country,
.wp-display-eu-map svg polygon.other-country {
    fill: #e0e0e0 !important;
    stroke: #cccccc !important;
    stroke-width: 0.5 !important;
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* SVG Elements - Elemente fără țară (background, linii, etc) */
.wp-display-eu-map svg path.non-country,
.wp-display-eu-map svg polygon.non-country {
    pointer-events: none;
}

/* SVG Elements - Țări din zona selectată */
.wp-display-eu-map svg path.zone-country,
.wp-display-eu-map svg polygon.zone-country {
    fill: #66b3ff !important;
    stroke: #003399 !important;
    stroke-width: 1.5 !important;
    opacity: 1;
    cursor: default;
    transition: all 0.3s ease;
}

/* Țări cu link clickable */
.wp-display-eu-map svg path.zone-country.has-link,
.wp-display-eu-map svg polygon.zone-country.has-link {
    cursor: pointer;
}

/* Hover pe țări din zonă */
.wp-display-eu-map svg path.zone-country:hover,
.wp-display-eu-map svg polygon.zone-country:hover,
.wp-display-eu-map svg path.zone-country.hovered,
.wp-display-eu-map svg polygon.zone-country.hovered {
    fill: #ffcc00 !important;
    stroke: #ff9900 !important;
    stroke-width: 2.5 !important;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 204, 0, 0.8));
}

/* Efect flash când se dă click pe listă */
@keyframes flash {
    0%, 100% {
        fill: #66b3ff !important;
        opacity: 1;
    }
    50% {
        fill: #ff6600 !important;
        opacity: 1;
        filter: drop-shadow(0 0 12px rgba(255, 102, 0, 1));
    }
}

.wp-display-eu-map svg path.zone-country.flash,
.wp-display-eu-map svg polygon.zone-country.flash {
    animation: flash 0.6s ease-in-out;
}

/* Tooltip pentru țări */
.wp-display-eu-map svg .zone-country[title] {
    cursor: pointer;
    position: relative;
}

/* Legendă - grid de țări jos */
.wp-display-eu-legend {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.wp-display-eu-legend h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Listă țări - grid layout */
.countries-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.countries-list li {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.countries-list li:hover,
.countries-list li.highlighted {
    background: #ffcc00;
    border-color: #ff9900;
    transform: translateX(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.countries-list li .country-code {
    display: inline-block;
    width: 30px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: #003399;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    margin-right: 10px;
}

.countries-list li:hover .country-code,
.countries-list li.highlighted .country-code {
    background: #ff6600;
}

.countries-list li .country-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-display-eu-container {
        padding: 15px;
    }

    .wp-display-eu-header h3 {
        font-size: 22px;
    }

    .wp-display-eu-header .zone-description {
        font-size: 14px;
    }

    .wp-display-eu-map-wrapper {
        max-height: 400px !important;
    }

    .countries-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }

    .countries-list li {
        padding: 8px 12px;
    }

    .countries-list li .country-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wp-display-eu-map-wrapper {
        max-height: 300px !important;
    }

    .wp-display-eu-map {
        padding: 10px;
    }

    .countries-list {
        grid-template-columns: 1fr;
    }
}

/* Zone colors - opțional, pentru diferențiere */
.wp-display-eu-container[data-zone="nord"] .zone-country {
    fill: #4da6ff !important;
}

.wp-display-eu-container[data-zone="sud"] .zone-country {
    fill: #ff9966 !important;
}

.wp-display-eu-container[data-zone="est"] .zone-country {
    fill: #9966ff !important;
}

.wp-display-eu-container[data-zone="vest"] .zone-country {
    fill: #66cc99 !important;
}

/* Loading state */
.wp-display-eu-map.loading {
    opacity: 0.5;
    pointer-events: none;
}

.wp-display-eu-map.loading::after {
    content: 'Se încarcă...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 16px;
}
