:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(16, 25, 43, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#map {
    flex-grow: 1;
    height: 100%;
    background: #000;
}

.sidebar {
    width: 380px;
    height: 100%;
    max-height: 100vh;
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    box-shadow: -15px 0 40px rgba(0,0,0,0.6);
    z-index: 1000;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Custom scrollbar for the sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

h1 {
    margin-top: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 14px rgba(139, 92, 246, 0.2);
}

p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.control-group {
    margin-bottom: 25px;
}

label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #cbd5e1;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bbox-info {
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-family: monospace;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    margin-top: 15px;
}

button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}

button:disabled {
    background: #475569;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.quick-travel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.qt-btn {
    padding: 8px;
    font-size: 13px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #cbd5e1;
    box-shadow: none;
    margin-top: 0;
    border-radius: 8px;
}
.qt-btn:hover {
    background: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.loading {
    display: none;
    margin-top: 15px;
    font-size: 14px;
    color: var(--accent-hover);
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Customize Area Select */
.leaflet-areaselect-shade {
    background: rgba(0, 0, 0, 0.6);
}
.leaflet-areaselect-handle {
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid white;
}

#preview-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 2000;
    flex-direction: column;
}
#preview-canvas {
    flex-grow: 1;
    width: 100%;
}
.preview-controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    background: var(--card-bg);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.preview-btn {
    width: auto;
    min-width: 150px;
    margin-top: 0;
}

.slice-panel {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    z-index: 2001;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
