/* Trigonum NIS-2 Map Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

#map-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    position: relative;
}

#map {
    width: 100%;
    position: relative;
    padding-bottom: 66.67%;
}

#map svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.country {
    stroke: #ffffff;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.country.no-data {
    cursor: default;
}

.country:hover {
    opacity: 0.8;
}

.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: top 0.1s, left 0.1s;
}

/* Lightbox with gray overlay */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    overflow-y: auto;
    margin: 0;
    position: relative;
}

.lightbox-content h2 {
    margin-top: 0;
    color: #333;
}

.lightbox-content button {
    background-color: #0066cc;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
}

.lightbox-content button:hover {
    background-color: #0052a3;
}

/* Status with color box */
.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.status-color {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

/* CSS class for the supervisory authority */
.authority {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.authority-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

/* View Toggle Button - Only visible within map container */
.view-toggle {
    position: absolute;
    bottom: 80px;
    right: 20px;
    z-index: 100;
    background: #ffffff;
    border: 1px solid #0066cc;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #0066cc;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-toggle:hover {
    background: #0066cc;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 102, 204, 0.2);
}

.view-toggle:active {
    transform: scale(0.98);
}

/* List View Container */
#list-view {
    display: none;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px; /* Extra space for toggle button */
    background: #f8f9fa;
}

#list-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* List Header */
.list-header {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.list-header h2 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 24px;
}

.list-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.list-controls label {
    font-weight: 600;
    color: #555;
}

.list-controls select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.list-controls select:hover {
    border-color: #0066cc;
}

.list-controls select:focus {
    outline: none;
    border-color: #0066cc;
}

/* Country Cards Grid */
.country-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Individual Country Card */
.country-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.country-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.country-card.status-green {
    border-left-color: #32CD32;
}

.country-card.status-yellow {
    border-left-color: #FFD700;
}

.country-card.status-red {
    border-left-color: #FF4500;
}

.country-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.country-card-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.country-card-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.country-card-status.green {
    background: #32CD32;
}

.country-card-status.yellow {
    background: #FFD700;
    color: #333;
}

.country-card-status.red {
    background: #FF4500;
}

.country-card-summary {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.country-card-action {
    display: inline-block;
    padding: 8px 16px;
    background: #0066cc;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.country-card-action:hover {
    background: #0052a3;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .country-cards {
        grid-template-columns: 1fr;
    }
    
    .list-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .list-controls select {
        width: 100%;
    }
    
    .view-toggle {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .list-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    /* On mobile, show list view by default, hide map */
    #map-container {
        display: none;
    }
    
    #list-view {
        display: block;
    }
    
    .view-toggle {
        display: none; /* Hide toggle button on very small screens */
    }
}