/* Main map container styles */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
}

#map_a50579ea0c01426b15ce2ac53c4f579f {
    position: relative;
    width: 100.0%;
    height: 100.0%;
    left: 0.0%;
    top: 0.0%;
}

.leaflet-container {
    font-size: 1rem;
}

/* School marker icon styles */
.school-marker-icon {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-marker-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    transition: transform 0.2s ease;
}

.school-marker-icon:hover svg {
    transform: scale(1.2);
}

/* Barnaskole specific styles (primary school) */
.barnaskole-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Ungdomskole specific styles (secondary school) - for future use */
.ungdomskole-icon svg {
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

/* Info button styles */
.info-button {
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-button:hover {
    background-color: #357ae8;
    transform: scale(1.1);
}

/* Search container styles */
/* Toolbar: sits next to zoom controls, vertically centres children */
.map-toolbar {
    position: fixed;
    top: 16px;
    left: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
}

.search-container {
    position: relative;
    width: 320px;
}

/* Legend box */
.legend-box {
    flex-shrink: 0;
    position: relative;
}

#legendExpanded {
    position: absolute;
    top: calc(100% + 8px);
    right: 140%;
    width: 250px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background-color: white;
    border: 2px solid #aaa;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    font-size: 14px;
    z-index: 10001;
}


.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#schoolSearch {
    width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 16px;
    border: 2px solid #357ae8;
    border-radius: 25px;
    outline: none;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#schoolSearch:focus {
    border-color: #4285f4;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-search:hover {
    background-color: #f0f0f0;
    color: #333;
}

.clear-search.visible {
    display: flex;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 10px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    z-index: 10000;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.search-result-kommune {
    font-size: 13px;
    color: #666;
}

.search-result-highlight {
    background-color: #fff59d;
    font-weight: bold;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}


/* Modal styles */
.info-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.info-modal.is-open {
    display: flex;
}

.info-modal-content {
    background-color: white;
    padding: 30px;
    border: 1px solid #888;
    width: 100%;
    max-width: 680px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
}

.info-modal-content h2 {
    margin-top: 0;
    color: #333;
}

.info-modal-content h3 {
    color: #4285f4;
    margin-top: 20px;
}

.info-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.info-modal-close:hover {
    color: #000;
}

.color-explanation {
    margin: 10px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.color-row {
    display: flex;
    align-items: center;
    margin: 8px 0;
}

.color-dot {
    font-size: 20px;
    margin-right: 10px;
    width: 30px;
}

.stats-box {
    background-color: #e8f0fe;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.official-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.official-link:hover {
    background-color: #357ae8;
}

/* ── School popup styles ──────────────────────────────────────────────── */
.popup-school {
    font-size: 13px;
    line-height: 1.5;
    min-width: 220px;
}

.popup-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.popup-name {
    font-weight: bold;
    font-size: 14px;
}

.popup-year {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    flex-shrink: 0;
}

.popup-kommune {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.popup-current {
    margin-bottom: 8px;
}

.popup-history {
    margin-top: 8px;
    border-top: 1px solid #ddd;
    padding-top: 6px;
}

.popup-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 4px;
}

.popup-history-table th,
.popup-history-table td {
    text-align: center;
    padding: 2px 5px;
    border-bottom: 1px solid #eee;
}

.popup-history-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #444;
}

.popup-history-table td:first-child {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.popup-history-table tbody tr:last-child td {
    border-bottom: none;
}

.popup-history-table tbody tr:hover {
    background: #f9f9f9;
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .search-container {
        width: calc(100vw - 120px);
    }

    .info-modal-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .search-container {
        width: calc(100vw - 120px);
    }
}

