/* css/style.css - Sistema de Diseño Visual y Estilos para Vientos Argentinos */

:root {
    --bg-color: #0b132b;
    --card-bg: rgba(28, 37, 65, 0.45);
    --card-hover: rgba(28, 37, 65, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #48cae4;
    --primary-rgb: 72, 202, 228;
    --primary-hover: #00b4d8;
    --accent: #7209b7;
    --text-color: #f8f9fa;
    --text-muted: #a0aec0;
    --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #3b82f6;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at 50% 50%, #1c2541 0%, #0b132b 100%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
header {
    background: rgba(11, 19, 43, 0.7);
    border-bottom: 1px solid var(--card-border);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

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

.logo-symbol {
    font-size: 2rem;
    animation: rotate-logo 15s linear infinite;
    display: inline-block;
}

@keyframes rotate-logo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #00b4d8 100%);
    color: #0b132b;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.45);
    background: linear-gradient(135deg, #90e0ef 0%, var(--primary) 100%);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

/* Layout container */
.app-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 25px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}

@media (min-width: 1024px) {
    .app-container {
        grid-template-columns: 350px 1fr;
    }
}

/* Sidebar styling */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.station-search {
    width: 100%;
    padding: 12px 15px;
    background: rgba(11, 19, 43, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.station-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(72, 202, 228, 0.2);
}

.station-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.station-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.station-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateX(4px);
}

.station-item.active {
    background: rgba(72, 202, 228, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(72, 202, 228, 0.15);
}

.station-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.station-item-name {
    font-weight: 600;
    font-size: 1rem;
}

.station-item-temp {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.station-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-online { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.status-offline { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* Main Map and Dashboard area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Leaflet Map Card */
.map-container {
    height: 380px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#map {
    width: 100%;
    height: 100%;
    background: #0b132b;
}

/* Dashboard Panel */
.dashboard-panel {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

@media (min-width: 600px) {
    .dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.station-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.station-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    gap: 15px;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: #0b132b;
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(72, 202, 228, 0.25);
}

/* Tab contents */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Grid parameters */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    border-color: rgba(72, 202, 228, 0.3);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.metric-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

.metric-value-container {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.metric-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Wind Direction Compass */
.compass-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.compass-dial {
    width: 60px;
    height: 60px;
    border: 2px solid var(--card-border);
    border-radius: 50%;
    position: relative;
    background: rgba(11, 19, 43, 0.5);
}

.compass-arrow {
    width: 4px;
    height: 30px;
    background: linear-gradient(to top, transparent 50%, var(--danger) 50%);
    position: absolute;
    top: 15px;
    left: 28px;
    transform-origin: 50% 50%;
    transition: transform 1s ease-in-out;
}

.compass-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    font-size: 8px;
    color: var(--text-muted);
}

.compass-label-n { position: absolute; top: 2px; left: 26px; }
.compass-label-s { position: absolute; bottom: 2px; left: 27px; }
.compass-label-e { position: absolute; right: 4px; top: 25px; }
.compass-label-w { position: absolute; left: 4px; top: 25px; }

/* Historical Charts section controls */
.chart-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-range-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.chart-range-btn.active {
    background: var(--primary);
    color: #0b132b;
    border-color: var(--primary);
}

.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
    margin-bottom: 30px;
}

/* Agro Controls and Sliders */
.agro-slider-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.agro-slider-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.agro-slider-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.agro-slider-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.agro-slider-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    width: 45px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 150px;
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 180, 216, 0.5);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Leaflet Custom Marker popup styling */
.leaflet-popup-content-wrapper {
    background: #0b132b !important;
    border: 1px solid var(--card-border);
    color: #fff !important;
    border-radius: 12px !important;
}

.leaflet-popup-tip {
    background: #0b132b !important;
}

.leaflet-popup-content strong {
    color: var(--primary);
}

/* AQI scale colors */
.aqi-green { color: var(--success); }
.aqi-yellow { color: #facc15; }
.aqi-orange { color: #f97316; }
.aqi-red { color: var(--danger); }
.aqi-purple { color: #c084fc; }
.aqi-maroon { color: #7f1d1d; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* Install Banner for PWA */
.install-banner {
    display: none;
    background: linear-gradient(135deg, rgba(72, 202, 228, 0.15) 0%, rgba(114, 9, 183, 0.15) 100%);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 15px 20px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
}
