/* css/styles.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.controls {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-button {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.file-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.filter-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 1em;
    padding-bottom: 1em;
}

select {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: border 0.2s;
}

select:hover {
    border-color: #667eea;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

#map {
    height: 700px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
}

.stats {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    display: none;
}

.stats h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    padding: 15px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

.legend {
    background: white;
    padding: 15px;
    border-radius: 10px;
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 250px;
}

.legend h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    font-size: 14px;
    line-height: 1.6;
}

.popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.popup-row {
    margin: 5px 0;
}

.popup-label {
    font-weight: 600;
    color: #666;
}

.copyleft {
    text-align: center;
    padding: 40px 20px 20px 20px;
    margin-top: 20px;
    color: white;
    font-size: 14px;
    width: 100%;
    position: relative;
    bottom: 0;
}

.copyleft span {
    display: inline-block;
    transform: rotate(180deg);
}

/* Mobile Responsive and smaller screen space */
@media screen and (max-width: 768px) {
    .legend {
        display: none;
    }

    .qr-button {
        display: inline-flex;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 24px;
    }

    #map {
        height: 500px;
    }
}

/* Locate control styling (Leaflet control button) */
.locate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(102,126,234,0.25);
    font-size: 18px;
}

.locate-btn:hover {
    transform: translateY(-2px);
}

/* Keep control compact on very small screens */
@media screen and (max-width: 480px) {
    .locate-btn { width: 34px; height: 34px; font-size: 16px; margin: 4px; }
}
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 20px;
}

.error-code {
    font-size: 120px;
    font-weight: 900;
    color: white;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.error-message {
    font-size: 32px;
    color: white;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.error-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    max-width: 500px;
}

.home-button {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.home-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.decoration-1 {
    top: 10%;
    left: 10%;
    animation: pulse 4s ease-in-out infinite;
}

.decoration-2 {
    bottom: 15%;
    right: 15%;
    animation: pulse 5s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

@media screen and (max-width: 768px) {
    .error-code {
        font-size: 80px;
    }

    .error-message {
        font-size: 24px;
    }

    .error-description {
        font-size: 16px;
    }

    .decoration {
        width: 100px;
        height: 100px;
    }
}

/* QR panel and button */
.qr-button {
    display: inline-flex;
    right: 20px;
    top: 20px;
    bottom: auto;
    left: auto;
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.qr-button:hover { transform: translateY(-3px); }

.qr-panel {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.5);
    z-index: 1300;
    padding: 20px;
}

.qr-panel.open { display: flex; }

.qr-panel-inner {
    background: white;
    border-radius: 14px;
    padding: 22px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    position: relative;
}

.qr-panel h2 { margin-bottom: 12px; color: #333; }
.qr-placeholder { display: flex; align-items: center; justify-content: center; margin: 8px 0 14px; }
.qr-placeholder img { width: 260px; height: 260px; max-width: 100%; border-radius: 8px; background: #fff; }
.qr-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #667eea;
}
