/**
 * Animated Route Map Styles
 */

.record-route-map-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.record-route-map,
.record-static-points-map {
    width: 100%;
    height: 500px;
}

/* Route Marker Styles */
.route-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4ecdc4;
    border: 4px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.route-marker:hover {
    transform: scale(1.15);
    z-index: 10;
}

.route-marker .marker-number {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Animated Point Pulse Effect */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Animation Controls */
.animation-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Mapbox Popup Customization */
.mapboxgl-popup-content {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

.mapboxgl-popup-content strong {
    color: #333;
    font-size: 14px;
}

.mapboxgl-popup-content .ws-popup-title {
	font-family: Gloock, Arial, sans-serif;
	display:block;
	font-size: 18px;
	font-weight: 500;
	color: #222;
	margin-bottom: 6px;
}

.mapboxgl-popup-content a {
	text-decoration: underline;
	color: #c04732;
}

.mapboxgl-popup-close-button {
    font-size: 20px;
    padding: 8px;
    color: #3b3b3b;
}

.mapboxgl-popup-close-button:hover {
    background-color: transparent;
    color: #c04732;
}

/* Route Line Animation */
@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Loading State */
.record-route-map-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-route-map-container.loading::before {
    content: 'Loading route map...';
    font-size: 16px;
    color: #666;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .record-route-map-container {
        min-height: 400px;
    }

    .record-route-map,
    .record-static-points-map {
        height: 400px;
    }

    .route-marker {
        width: 32px;
        height: 32px;
        border: 3px solid white;
    }

    .route-marker .marker-number {
        font-size: 14px;
    }

    .animation-controls {
        bottom: 15px;
        right: 15px;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .record-route-map-container {
        min-height: 300px;
    }

    .record-route-map,
    .record-static-points-map {
        height: 300px;
    }

    .route-marker {
        width: 28px;
        height: 28px;
        border: 2px solid white;
    }

    .route-marker .marker-number {
        font-size: 12px;
    }

    .animation-controls {
        bottom: 10px;
        right: 10px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ── Year Picker ─────────────────────────────────────────────────────────── */

.year-picker {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1100;
    font-family: inherit;
}

.year-picker-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    font-size: 15px;
    color: #333;
    transition: border-color 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.year-picker-trigger:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.year-picker-trigger.active {
    border-color: #c0392b;
}

.year-picker-label {
    color: #555;
    font-weight: 400;
}

.year-picker-value {
    font-weight: 700;
    color: #222;
    font-size: 16px;
    min-width: 38px;
}

.year-picker-icon {
    font-size: 17px;
    margin-left: 4px;
    color: #777;
}

.year-picker-dropdown {
    display: none;
    margin-top: 6px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    padding: 12px;
    min-width: 260px;
}

.year-picker-dropdown.open {
    display: block;
}

.year-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.year-header-label {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.year-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #888;
    padding: 0 8px;
    line-height: 1;
    transition: color 0.15s ease;
}

.year-nav-btn:hover {
    color: #c0392b;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.year-item {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 8px 4px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.year-item:hover {
    background: #f5f0ea;
    color: #c0392b;
}

.year-item.selected {
    background: #f0e8e6;
    color: #c0392b;
    font-weight: 600;
}

.year-item.range-start,
.year-item.range-end {
    background: #c0392b;
    color: #fff;
    font-weight: 700;
}

.year-item.in-range {
    background: #f0e8e6;
    color: #c0392b;
}

.year-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid #f0e8e6;
    margin-top: 4px;
}

.year-picker-hint {
    font-size: 11px;
    color: #999;
}

.year-clear-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.year-clear-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
}

@media (max-width: 480px) {
    .year-picker-trigger {
        font-size: 13px;
        padding: 8px 10px;
    }

    .year-picker-dropdown {
        min-width: 220px;
    }
}

/* ── Entry Filters ───────────────────────────────────────────────────────── */

.entry-filters {
    position: absolute;
    top: 10px;
    left: 217px;
    z-index: 1100;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.entry-filter-group {
    position: relative;
}

.entry-filter-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #e0d5cf;
    border-radius: 8px;
    padding: 13px 14px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    user-select: none;
    white-space: nowrap;
}

.entry-filter-trigger:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.entry-filter-trigger.active {
    border-color: #c0392b;
}

.entry-filter-label {
    font-weight: 600;
    color: #222;
}

.entry-filter-arrow {
    font-size: 14px;
    color: #999;
}

.entry-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1.5px solid #e0d5cf;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1200;
}

.entry-filter-dropdown.open {
    display: block;
}

.entry-filter-list {
    padding: 8px 4px 4px;
}

.entry-filter-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
}

.entry-filter-item:hover {
    background: #f5f0ea;
}

.entry-filter-item input[type="checkbox"] {
    margin: 0;
    accent-color: #c0392b;
    flex-shrink: 0;
}

.entry-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid #f0e8e6;
    margin-top: 4px;
    gap: 8px;
}

.entry-filter-clear {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.entry-filter-clear:hover {
    border-color: #c0392b;
    color: #c0392b;
}

.entry-filter-apply {
    background: #c0392b;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.entry-filter-apply:hover {
    background: #a93226;
}

/* Print Styles */
@media print {
    .mapboxgl-ctrl-group,
    .animation-controls {
        display: none;
    }

    .record-route-map-container {
        box-shadow: none;
    }
}
