/* FrostMap - Hytale World Viewer Styles */
/* Styled to match Hytale's official design */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,400;0,600;0,700;1,400&family=Lexend:wght@700&display=swap');

:root {
    /* Hytale Color Palette - extracted from site */
    --hytale-bg-dark: #182636;
    --hytale-bg: #1e3044;
    --hytale-bg-light: #243a52;
    --hytale-nav-bg: #1a2d42;
    --hytale-gold: #c4a35a;
    --hytale-gold-light: #d4b76a;
    --hytale-gold-dark: #a08040;
    --hytale-gold-border: #8b7035;
    --hytale-text: #9ab;
    --hytale-text-bright: #cde;
    --hytale-cyan: #5ad;
    --hytale-border: #2a4a66;
    
    /* Button gradient colors */
    --btn-top: #6ba3c7;
    --btn-mid: #5a8fb8;
    --btn-bottom: #4a7da5;
    --btn-border: #3a6080;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--hytale-bg-dark);
    color: var(--hytale-text);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, 
        var(--hytale-bg-dark) 0%, 
        #0f1c28 100%);
}

/* Header - matches Hytale nav bar */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 56px;
    background: linear-gradient(180deg, 
        rgba(26, 45, 66, 0.98) 0%, 
        rgba(20, 36, 52, 0.98) 100%);
    border-bottom: 1px solid var(--hytale-border);
    flex-shrink: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Title styled like Hytale headings */
.header-left h1 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--hytale-text-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-right span {
    padding: 6px 12px;
    background: rgba(30, 48, 68, 0.8);
    border: 1px solid var(--hytale-border);
    border-radius: 3px;
    color: var(--hytale-text);
    font-variant-numeric: tabular-nums;
}

/* Loading Overlay */
#loading-overlay {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hytale-bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 500;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--hytale-border);
    border-top-color: var(--hytale-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Lexend', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--hytale-text);
}

/* World Select - Hytale button style */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

#world-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 8px 36px 8px 14px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 200px;
    cursor: pointer;
    
    /* Hytale blue button gradient */
    background: linear-gradient(180deg, 
        var(--btn-top) 0%, 
        var(--btn-mid) 50%, 
        var(--btn-bottom) 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    
    /* Border styling */
    border: 2px solid var(--btn-border);
    border-radius: 3px;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.3);
    
    transition: all 0.15s ease;
}

#world-select:hover {
    background: 
        linear-gradient(180deg, 
            #7bb3d7 0%, 
            #6a9fc8 50%, 
            #5a8db5 100%);
    border-color: #4a7090;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 3px 6px rgba(0, 0, 0, 0.35);
}

#world-select:focus {
    outline: none;
    border-color: var(--hytale-cyan);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 2px rgba(85, 170, 221, 0.3);
}

#world-select:active {
    background: 
        linear-gradient(180deg, 
            var(--btn-bottom) 0%, 
            var(--btn-mid) 50%, 
            var(--btn-top) 100%);
    box-shadow: 
        inset 0 2px 3px rgba(0, 0, 0, 0.2);
}

#world-select option {
    background: var(--hytale-bg);
    color: var(--hytale-text-bright);
    padding: 8px;
}

/* Map Container */
#map {
    flex: 1;
    background: radial-gradient(ellipse at center, 
        var(--hytale-bg) 0%, 
        var(--hytale-bg-dark) 100%);
}

/* Leaflet Overrides */
.leaflet-container {
    background: var(--hytale-bg-dark);
    font-family: 'Nunito Sans', sans-serif;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    border-radius: 3px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: linear-gradient(180deg, 
        var(--hytale-bg-light) 0%, 
        var(--hytale-bg) 100%) !important;
    color: var(--hytale-text-bright) !important;
    border: none !important;
    border-bottom: 1px solid var(--hytale-border) !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    transition: all 0.15s ease !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: linear-gradient(180deg, 
        #2d4a64 0%, 
        var(--hytale-bg-light) 100%) !important;
    color: #fff !important;
}

.leaflet-control-attribution {
    background: rgba(24, 38, 54, 0.95) !important;
    color: var(--hytale-text) !important;
    padding: 3px 8px !important;
    border-radius: 3px 0 0 0 !important;
    border: 1px solid var(--hytale-border) !important;
    border-right: none !important;
    border-bottom: none !important;
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.leaflet-control-attribution a {
    color: var(--hytale-cyan) !important;
}

/* Tile styling - pixelated for that blocky game feel */
.leaflet-tile {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--hytale-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--hytale-bg-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hytale-border);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive */
@media (max-width: 768px) {
    #header {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .header-right span {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    #world-select {
        min-width: 160px;
    }
}
