/* =========================================================
   Ecowitt Weather Station – Pro Dashboard Stylesheet
   ========================================================= */

:root {
    --ews-bg-dark: #0f172a;
    --ews-glass-bg: rgba(30, 41, 59, 0.7);
    --ews-glass-border: rgba(255, 255, 255, 0.1);
    --ews-accent: #38bdf8;
    --ews-text: #f1f5f9;
    --ews-text-dim: #94a3b8;
    --ews-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.ews-dashboard *, .ews-dashboard *::before, .ews-dashboard *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ews-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--ews-bg-dark);
    color: var(--ews-text);
    border-radius: 16px;
    padding: 20px;
    max-width: 1000px;
    box-shadow: var(--ews-shadow);
    overflow: hidden;
    position: relative;
}

/* Glassmorphism Effect */
.ews-cell {
    background: var(--ews-glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--ews-glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ews-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Light Theme Overrides */
.ews-theme-light {
    --ews-bg-dark: #f8fafc;
    --ews-glass-bg: rgba(255, 255, 255, 0.8);
    --ews-glass-border: rgba(0, 0, 0, 0.05);
    --ews-accent: #0284c7;
    --ews-text: #1e293b;
    --ews-text-dim: #64748b;
    --ews-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Header */
.ews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--ews-glass-border);
}

.ews-station-name {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(to right, var(--ews-accent), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ews-updated {
    font-size: 12px;
    color: var(--ews-text-dim);
}

/* Grid Layout */
.ews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* Labels & Values */
.ews-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ews-text-dim);
    margin-bottom: 10px;
}

.ews-big-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--ews-text);
}

.ews-unit {
    font-size: 12px;
    color: var(--ews-text-dim);
    margin-left: 2px;
}

/* Special Cells */
.ews-thermo-cell, .ews-rain-cell {
    grid-column: span 2;
}

.ews-graph-cell {
    grid-column: span 2;
    min-height: 200px;
}

/* Thermometers */
.ews-thermo-row {
    display: flex;
    width: 100%;
    justify-content: space-around;
    margin-top: 10px;
}

.ews-thermo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ews-thermo-label {
    font-size: 10px;
    margin-top: 5px;
    color: var(--ews-text-dim);
}

.ews-thermo-val {
    font-size: 14px;
    font-weight: 700;
}

/* Moon Phase */
.ews-moon-phase {
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}

/* Refresh Button */
.ews-refresh-btn {
    background: var(--ews-glass-bg);
    border: 1px solid var(--ews-glass-border);
    color: var(--ews-text);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ews-refresh-btn:hover {
    background: var(--ews-accent);
    color: white;
}

.ews-refresh-btn.spinning {
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .ews-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ews-thermo-cell, .ews-rain-cell, .ews-graph-cell {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .ews-grid {
        grid-template-columns: 1fr;
    }
    .ews-thermo-cell, .ews-rain-cell, .ews-graph-cell {
        grid-column: span 1;
    }
}
