:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(15, 23, 42, 0.85);
    --panel-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Map */
.map-container {
    flex-grow: 1;
    height: 100%;
    z-index: 1;
    background: #000;
}

/* Sidebar Glassmorphism */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 380px;
    height: 100vh;
    z-index: 1000;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--panel-border);
    border-radius: 0;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden; /* Evita scroll en el contenedor principal */
}

main {
    flex: 1;
    overflow-y: auto;
    /* Ocultar barra de scroll visualmente pero permitir scroll con rueda */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

main::-webkit-scrollbar {
    display: none;
}

header {
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo .icon {
    font-size: 24px;
}

.app-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    background: white;
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
    font-weight: 300;
}

/* Inputs */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    display: flex;
    gap: 8px;
}

input[type="text"], input[type="number"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.select-wrapper {
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-select option {
    background: var(--bg-color);
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, var(--primary) 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-logout {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--panel-border);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.helper-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.4s ease forwards;
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
}

.result-card h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.result-card .value {
    font-size: 32px;
    font-weight: 800;
}

.result-card .unit {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
}

.highlight-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.highlight-card .value {
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Quote Section */
.quote-section {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px dashed var(--panel-border);
}

.quote-section label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.total-quote {
    margin-top: 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.total-quote h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
}

.quote-value {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Utils */
.hidden {
    display: none !important;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Legend */
.legend {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
}

.legend h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-main);
    font-weight: 300;
}

.color-box {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}
