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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: #ffffff;
    overflow: hidden;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-house {
    margin-bottom: 10px;
}

.loading-house .anim-part {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 0.6s ease-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.loading-text {
    margin-top: 20px;
    font-size: 1.1em;
    color: #4facfe;
    font-weight: 300;
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1em;
    color: #b0c4d4;
    font-weight: 300;
}

.controls-panel {
    position: absolute;
    top: 140px;
    left: 20px;
    width: 350px;
    background: rgba(15, 32, 39, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.controls-panel h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #4facfe;
}

.controls-panel h4 {
    font-size: 1em;
    margin-bottom: 10px;
    color: #00f2fe;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.layer-btn {
    padding: 12px 20px;
    font-size: 0.95em;
    border: 2px solid rgba(79, 172, 254, 0.3);
    background: rgba(79, 172, 254, 0.1);
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.layer-btn:hover {
    background: rgba(79, 172, 254, 0.2);
    border-color: rgba(79, 172, 254, 0.6);
    transform: translateX(5px);
}

.layer-btn:hover .btn-icon {
    opacity: 1;
}

.layer-btn.active {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    border-color: #00f2fe;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

.info-panel {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

#current-layer-title {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #00f2fe;
}

#current-layer-description {
    font-size: 0.9em;
    color: #b0c4d4;
    line-height: 1.5;
    margin-bottom: 15px;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.color-box {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-panel {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-height: 80px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-illustration {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.stats-panel.has-data .empty-illustration,
.stats-panel.has-data .empty-text {
    display: none;
}

.empty-text {
    margin-top: 10px;
    color: #b0c4d4;
    font-weight: 400;
}

.stats-panel h4 {
    color: #00f2fe;
    font-weight: 500;
    margin-bottom: 5px;
}

.country-stats {
    margin-top: 10px;
    width: 100%;
}

.country-stats p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #ffffff;
}

.country-stats strong {
    color: #00f2fe;
}

#globe-container {
    flex: 1;
    position: relative;
}

#globe-container canvas {
    outline: none;
}

/* Scrollbar styling */
.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: rgba(79, 172, 254, 0.5);
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 172, 254, 0.7);
}

.data-sources {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-top: 1px solid rgba(79, 172, 254, 0.3);
}

.data-sources h4 {
    font-size: 1em;
    margin-bottom: 10px;
    color: #00f2fe;
}

.data-sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-sources li {
    font-size: 0.85em;
    color: #b0c4d4;
    margin: 6px 0;
    padding-left: 12px;
    position: relative;
}

.data-sources li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4facfe;
}

.data-sources strong {
    color: #ffffff;
    font-weight: 600;
}

/* Footer */
.site-footer {
    position: absolute;
    bottom: 0;
    right: 20px;
    padding: 15px 20px;
    background: rgba(15, 32, 39, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 8px 8px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    text-align: center;
    z-index: 50;
}

.site-footer p {
    margin: 3px 0;
    font-size: 0.85em;
    color: #b0c4d4;
}

.site-footer strong {
    color: #00f2fe;
    font-weight: 600;
}

.footer-icon {
    opacity: 0.7;
}

.footer-date {
    font-size: 0.75em !important;
    color: #888 !important;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .container {
        height: auto;
        min-height: 100vh;
    }

    header {
        padding: 15px 10px;
    }

    header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .controls-panel {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: none;
        border-left: none;
        border-right: none;
    }

    .button-group {
        gap: 8px;
    }

    .layer-btn {
        padding: 14px 16px;
        font-size: 0.9em;
        text-align: center;
        gap: 8px;
    }

    .btn-icon {
        width: 14px;
        height: 14px;
    }

    .layer-btn:hover {
        transform: translateX(0);
    }

    .empty-illustration {
        width: 100px;
        height: 100px;
    }

    .loading-house {
        width: 70px;
        height: 70px;
    }

    .loading-text {
        font-size: 1em;
    }

    #globe-container {
        height: 60vh;
        min-height: 400px;
        order: -1;
    }

    .info-panel {
        padding: 12px;
    }

    #current-layer-title {
        font-size: 1em;
    }

    #current-layer-description {
        font-size: 0.85em;
    }

    .legend {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .legend-item {
        font-size: 0.8em;
    }

    .color-box {
        width: 25px;
        height: 18px;
    }

    .stats-panel {
        padding: 12px;
        font-size: 0.9em;
    }

    .country-stats p {
        font-size: 0.85em;
        line-height: 1.6;
    }

    .data-sources {
        padding: 12px;
    }

    .data-sources h4 {
        font-size: 0.95em;
    }

    .data-sources li {
        font-size: 0.8em;
    }

    .controls-panel h3 {
        font-size: 1.1em;
    }

    .site-footer {
        position: relative;
        right: 0;
        width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .controls-panel {
        padding: 15px;
    }

    .layer-btn {
        padding: 12px 14px;
        font-size: 0.85em;
        gap: 6px;
    }

    .btn-icon {
        width: 12px;
        height: 12px;
    }

    #globe-container {
        height: 50vh;
        min-height: 350px;
    }

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

    .country-stats p {
        font-size: 0.8em;
    }

    .empty-illustration {
        width: 80px;
        height: 80px;
    }

    .loading-house {
        width: 60px;
        height: 60px;
    }

    .loading-text {
        font-size: 0.9em;
    }

    .empty-text {
        font-size: 0.9em;
    }
}
