/* Territory Laws Map Styles */
.eu-territory-map {
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.eu-territory-map .country {
    fill: #e9ecef;
    stroke: #ffffff;
    stroke-width: 0.5;
    cursor: pointer;
    transition: fill 0.2s ease, opacity 0.2s ease;
}

.eu-territory-map .country:hover {
    opacity: 0.75;
    stroke: #333;
    stroke-width: 1;
}

.eu-territory-map .country.mandatory-yes { fill: #198754; }
.eu-territory-map .country.mandatory-depends { fill: #ffc107; }
.eu-territory-map .country.mandatory-no { fill: #dc3545; }
.eu-territory-map .country.not-covered { fill: #dee2e6; }

/* Badge colors matching map */
.badge.mandatory-yes,
.badge.bg-mandatory-yes { background-color: #198754 !important; color: white; }
.badge.mandatory-depends,
.badge.bg-mandatory-depends { background-color: #ffc107 !important; color: #212529; }
.badge.mandatory-no,
.badge.bg-mandatory-no { background-color: #dc3545 !important; color: white; }

/* Table row highlighting */
.table .mandatory-yes-row { border-left: 4px solid #198754; }
.table .mandatory-depends-row { border-left: 4px solid #ffc107; }
.table .mandatory-no-row { border-left: 4px solid #dc3545; }

/* Map container */
.map-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 2rem;
}

/* Map tooltip */
.map-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    pointer-events: none;
    z-index: 9999;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.map-tooltip .tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.map-tooltip .tooltip-status {
    font-size: 12px;
    opacity: 0.9;
}

/* Legend */
.territory-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.territory-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.territory-legend .legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.territory-legend .legend-color.yes { background-color: #198754; }
.territory-legend .legend-color.depends { background-color: #ffc107; }
.territory-legend .legend-color.no { background-color: #dc3545; }

/* Country cards on detail page */
.territory-laws-country .card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}

.territory-laws-country .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.territory-laws-country .card-header {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px 12px 0 0;
}

/* Status alert */
.status-alert {
    border-radius: 10px;
    border: none;
}

.status-alert.active {
    background: linear-gradient(135deg, #d1e7dd 0%, #badbcc 100%);
    color: #0f5132;
}

.status-alert.inactive {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #664d03;
}

/* Country table */
.country-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.country-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.country-table tbody tr {
    transition: background-color 0.15s ease;
}

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

.country-table .flag-cell {
    width: 50px;
}

.country-table .flag-cell img {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Active period indicator */
.period-active {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.period-active .pulse {
    width: 8px;
    height: 8px;
    background: #198754;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Country navigation */
.country-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.country-nav .btn {
    white-space: nowrap;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .map-container {
        padding: 10px;
        overflow-x: auto;
    }

    .eu-territory-map {
        min-width: 600px;
    }

    .territory-legend {
        justify-content: center;
    }

    .country-nav {
        flex-direction: column;
    }

    .country-nav .btn {
        width: 100%;
    }

    .country-table {
        font-size: 0.875rem;
    }

    .country-table .d-none-mobile {
        display: none !important;
    }
}

/* Info cards grid */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Tread depth visualization */
.tread-depth-viz {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    justify-content: center;
    padding: 1rem;
}

.tread-bar {
    text-align: center;
}

.tread-bar .bar {
    width: 60px;
    background: linear-gradient(180deg, #6c757d 0%, #495057 100%);
    border-radius: 4px 4px 0 0;
    margin: 0 auto 8px;
    transition: height 0.3s ease;
}

.tread-bar .label {
    font-size: 0.85rem;
    color: #6c757d;
}

.tread-bar .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}
