:root { 
    --aqi-bg: #10b981; 
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --paper: #f1ede3;
    --neon-green: #00ff41;
    --accent-blue: #38bdf8;
    --accent-red: #dc2626;
    --dock-width: 90px;
    --gold: #fbbf24; 

    /* Cosmic Widget Vars */
    --bg-night: #010103;
    --text-dim: #a5f3fc; 
    --color-blue: #00eaff;
    --color-gold: #ffd700;
    --color-orange: #ff6b00;
    --color-danger: #ff004c;
    --current-glow: var(--color-blue);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    background-attachment: fixed;
    display: flex; flex-direction: column; align-items: center; 
    padding: 15px; min-height: 100vh; color: #f8fafc;
    padding-bottom: 50px; 
    padding-top: 20px;
}

/* WIDGET CONTAINER */
#widget-container { width: 100%; max-width: 450px; display: flex; flex-direction: column; padding-bottom: 50px; min-height: 300px; }

.card {
    width: 100%; border-radius: 28px; 
    margin-bottom: 16px; border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden; position: relative;
    background-color: #1e293b;
    touch-action: pan-y;
}

/* --- DRAG HANDLE --- */
.drag-handle {
    position: absolute; 
    top: 15px; 
    left: 15px; 
    right: auto;
    width: 32px; height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: none;
    justify-content: center; align-items: center;
    cursor: grab; z-index: 1000;
    backdrop-filter: blur(4px);
    font-size: 1.2rem; 
    color: rgba(255,255,255,0.7); 
    border: 1px solid rgba(255,255,255,0.3);
    transition: 0.3s ease;
}
.drag-handle:active { cursor: grabbing; }

body.edit-mode .drag-handle { 
    display: flex; 
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-color: #00ffff;
    color: #e0f2fe; 
    background: rgba(0, 50, 255, 0.3); 
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.6), 
        inset 0 0 5px rgba(0, 255, 255, 0.4);
    text-shadow: 0 0 5px #00ffff;
}

@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.sortable-ghost { opacity: 0.4; background: var(--accent-blue); }
.sortable-drag { cursor: grabbing; opacity: 1; transform: scale(1.02); box-shadow: 0 25px 50px rgba(0,0,0,0.5); }

/* --- SIDE DOCK STYLES --- */
#side-dock {
    position: fixed;
    top: 0;
    right: calc(var(--dock-width) * -1); 
    width: var(--dock-width);
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--glass-border);
    transition: right 0.3s ease, box-shadow 0.3s ease;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 5px;
    padding-top: 50px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}
#side-dock.open { right: 0; }

#side-dock.dock-glow-mode {
    background: rgba(0, 0, 40, 0.95);
    border-left: 2px solid #0044ff;
    box-shadow: 0 0 30px #0044ff, inset 0 0 20px rgba(0, 68, 255, 0.3);
}

#dock-toggle {
    position: absolute;
    top: 50%;
    left: -30px; 
    width: 30px;
    height: 60px;
    transform: translateY(-50%);
    background: var(--accent-blue);
    border-radius: 10px 0 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: -5px 0 10px rgba(0,0,0,0.2);
    z-index: 5002;
    transition: 0.3s;
}

#dock-toggle::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 3px solid #0f172a;
    border-bottom: 3px solid #0f172a;
    transform: rotate(45deg); 
    margin-left: 4px;
    transition: transform 0.3s ease;
}

#dock-toggle.open-state::after { transform: rotate(-135deg); margin-left: -4px; }

.dock-instructions {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    position: absolute;
    left: 2px;
    top: 50%;
    height: 80%;
    transform-origin: center;
    transform: translateY(-50%) rotate(180deg);
    font-size: 0.6rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 5001;
    pointer-events: none;
    opacity: 0.5;
}

#dock-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    flex-grow: 1; 
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 15px;
}
#dock-list::-webkit-scrollbar { display: none; }

.dock-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-shrink: 0; 
    width: 100%;
    margin-top: 10px;
}

.dock-separator {
    width: 70%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: 0.2s;
    user-select: none;
    padding: 5px;
    border-radius: 10px;
    width: 100%;
}
.dock-item:hover { background: rgba(255,255,255,0.05); }

.dock-item.static-item { cursor: pointer; }
.dock-item.static-item:active { transform: scale(0.95); }
.dock-item.static-item.active-mode .dock-icon { background: var(--accent-blue); color: #0f172a; box-shadow: 0 0 10px var(--accent-blue); }
.dock-item.static-item.active-mode .dock-label { color: var(--accent-blue); }

.dock-icon {
    font-size: 1.8rem;
    background: rgba(255,255,255,0.1);
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px;
    transition: 0.3s;
}
.dock-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: center;
}

.dock-item.shadowy { opacity: 0.3; filter: grayscale(100%); pointer-events: auto; cursor: not-allowed; }
.dock-item.shadowy .dock-icon { box-shadow: inset 0 0 5px rgba(0,0,0,0.5); }

/* --- WIDGET STYLES --- */
.live-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.beep { height: 8px; width: 8px; background-color: #00ff88; border-radius: 50%; box-shadow: 0 0 8px #00ff88; animation: blink 1.2s infinite; }
.update-text { font-size: 0.65rem; opacity: 0.7; font-weight: 600; }
@keyframes blink { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.2); } 100% { opacity: 1; transform: scale(1); } }

/* MONGOL PATTERN */
.mongol-pattern-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #ffffff 10px, #ffffff 11px),
                      repeating-linear-gradient(-45deg, transparent, transparent 10px, #ffffff 10px, #ffffff 11px);
}

/* NEWS CARD */
.news-card { background-color: var(--paper); color: #1a1a1a; padding: 20px; border: 2px solid #222; }
.newspaper-header { text-align: center; border-bottom: 3px double #1a1a1a; margin-bottom: 15px; padding-bottom: 5px; }
.newspaper-title { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: -1px; }
.newspaper-meta { display: flex; justify-content: space-between; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; border-top: 1px solid #1a1a1a; margin-top: 4px; padding-top: 2px; }
.news-item { display: block; text-decoration: none; color: #1a1a1a; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,0.1); }
.news-tag { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.6rem; font-weight: 800; background: #1a1a1a; color: var(--paper); padding: 2px 6px; text-transform: uppercase; display: inline-block; margin-bottom: 4px; }
.news-headline { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; line-height: 1.1; }

/* TRAFFIC CARD */
.traffic-card { background: #1e293b; padding: 20px; border-left: 4px solid var(--accent-red); }
.traffic-header { font-weight: 800; color: white; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 10px; position: relative; z-index: 1;}
.traffic-body { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1;}
.traffic-day { color: #94a3b8; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; font-size: 0.9rem;}
.traffic-time-badge { background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; color: var(--gold); font-weight: 700; margin-bottom: 15px; border: 1px solid rgba(251, 191, 36, 0.3); }
.plate-visual { background: white; padding: 4px; border-radius: 6px; transform: rotate(-1deg); box-shadow: 0 4px 10px rgba(0,0,0,0.3); margin-bottom: 10px; }
.plate-inner { border: 2px solid black; padding: 5px 15px; min-width: 140px; text-align: center; border-radius: 4px; }
.plate-label { display: block; color: black; font-size: 0.5rem; font-weight: 900; letter-spacing: 1px; }
.plate-numbers { color: #dc2626; font-size: 2.2rem; font-weight: 900; line-height: 1; font-family: monospace; }
.traffic-msg { font-size: 0.75rem; color: #cbd5e1; text-align: center; margin-bottom: 10px; }
.traffic-disclaimer { font-size: 0.65rem; color: #fca5a5; text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 8px; width: 100%; font-style: italic; }

/* FUEL CARD */
.fuel-card { background: #1e293b; padding: 20px; border-left: 4px solid #ff9f1c; }
.fuel-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: white; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 15px; position: relative; z-index: 2; }
.fuel-controls { display: flex; gap: 8px; }
.fuel-controls button { background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); color: white; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; transition: 0.2s; }
.fuel-controls button:hover { background: rgba(255,255,255,0.2); }
.fuel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; position: relative; z-index: 2; }
.fuel-item { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); padding: 8px 4px; border-radius: 12px; text-align: center; }
.fuel-type { display: block; font-size: 0.55rem; color: #94a3b8; font-weight: 700; }
.fuel-price { display: block; font-size: 0.85rem; font-weight: 800; color: #ff9f1c; }
.map-wrapper { position: relative; height: 200px; width: 100%; border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-border); margin-bottom: 10px; z-index: 2; }
#fuelMap { height: 100%; width: 100%; background: #111; }
.map-loading { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 10; font-size: 0.7rem; }
.spinner-orange { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.1); border-top: 2px solid #ff9f1c; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.find-btn { background: #ff9f1c; color: #0f172a; border: none; padding: 6px 12px; border-radius: 8px; font-weight: 800; font-size: 0.7rem; cursor: pointer; }
.fullscreen-mode { position: fixed !important; top: 0; left: 0; width: 100% !important; height: 100vh !important; z-index: 6000 !important; max-width: none !important; border-radius: 0 !important; margin: 0 !important; display: flex; flex-direction: column; }
.fullscreen-mode .map-wrapper { flex-grow: 1; height: auto; }

.leaflet-popup-content-wrapper { background: #1e293b; color: white; border-radius: 12px; padding: 0; }
.leaflet-popup-tip { background: #1e293b; }
.popup-go-btn { display: inline-block; margin-top: 6px; background: #ff9f1c; color: #0f172a; padding: 4px 10px; border-radius: 6px; text-decoration: none; font-weight: 800; font-size: 0.7rem; text-transform: uppercase; }

/* WEATHER CARD */
.weather-card { padding: 25px; color: white; transition: all 0.5s ease; }
.bg-dawn { background: linear-gradient(135deg, #f43f5e, #fb923c); }
.bg-day { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.bg-dusk { background: linear-gradient(135deg, #6366f1, #a855f7); }
.bg-night { background: linear-gradient(135deg, #1e293b, #334155); }

.top-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    gap: 10px; 
    margin-bottom: 15px; 
    width: 100%; 
    overflow: hidden; 
}
#citySelect {
    max-width: 45%; 
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}

.weather-main-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
select { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(8px); border: 1px solid var(--glass-border); color: white; padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; }
select option { color: black; }
.temp { font-size: 5rem; font-weight: 300; line-height: 1; letter-spacing: -2px; }
.weather-info { text-align: right; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; }
.m-item { text-align: center; } .m-val { display: block; font-weight: 700; font-size: 0.8rem; } .m-lbl { font-size: 0.55rem; opacity: 0.7; text-transform: uppercase; }

.forecast-container { display: flex; gap: 8px; margin-top: 15px; overflow-x: auto; padding-bottom: 5px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; }
.forecast-container::-webkit-scrollbar { height: 4px; }
.forecast-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
.forecast-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.forecast-day { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 12px; min-width: 65px; text-align: center; border: 1px solid rgba(255,255,255,0.05); }
.f-day { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; opacity: 0.9; }
.f-icon { font-size: 1.2rem; margin-bottom: 4px; }
.f-temp { font-size: 0.75rem; font-weight: 800; }

/* WORD OF THE DAY CARD */
.wotd-card { background: linear-gradient(135deg, #4c1d95, #7e22ce); color: white; padding: 25px; text-align: center; position: relative; overflow: hidden; }
.wotd-header { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #d8b4fe; letter-spacing: 2px; margin-bottom: 15px; position: relative; z-index: 1; }
.wotd-word { font-family: 'Playfair Display', serif; font-size: 2.8rem; font-weight: 900; margin-bottom: 5px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); position: relative; z-index: 1; }
.wotd-translation { font-size: 1.1rem; font-weight: 800; color: #f3e8ff; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; position: relative; z-index: 1; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 10px; display: inline-block; }
.wotd-meaning { font-size: 0.9rem; font-weight: 500; color: #e9d5ff; line-height: 1.5; position: relative; z-index: 1; font-style: italic; }

/* HOROSCOPE CARD - CORRECCIÓN DE ESTILOS Y LUCKY NUMBER */
.horoscope-card { background: #1e1b4b; border-left: 4px solid #a855f7; padding: 25px; color: white; position: relative; overflow: hidden; }
.horoscope-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 15px; position: relative; z-index: 2; color: #e9d5ff; }
.horoscope-body { 
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(168, 85, 247, 0.3); 
    border-radius: 12px; 
    padding: 15px; 
    position: relative; 
    z-index: 2; 
    min-height: 100px; 
    display: block; 
    box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.05);
}
.horoscope-text-wrapper { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    font-size: 0.85rem; 
    font-weight: 400; /* Asegura que el texto sea fino y limpio, no gordo */
    line-height: 1.5; 
    color: #f3e8ff; 
    text-align: left; 
    letter-spacing: normal; /* Asegura que no haya espacios antinaturales */
    border-left: 3px solid rgba(168, 85, 247, 0.5); 
    padding-left: 12px;
    margin-bottom: 10px; /* Deja espacio para el lucky number debajo */
}
.horoscope-text-wrapper p { margin: 0; }
.lucky-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: #d8b4fe;
    text-align: right;
    font-style: italic;
    border-top: 1px dashed rgba(168, 85, 247, 0.3);
    padding-top: 8px;
    margin-top: 8px;
}

/* AIR CARD */
.air-card { background: var(--aqi-bg); padding: 25px; transition: background 0.5s ease; }
.aqi-title { font-size: 0.9rem; font-weight: 800; color: #ffffff; letter-spacing: 1px; margin-bottom: 5px; }
.aqi-data-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; }
.air-value { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.aqi-status-group { text-align: right; }
.tip-box { background: rgba(0,0,0,0.15); border-radius: 18px; padding: 15px; margin-top: 0; font-size: 0.85rem; }
.source-link { display: block; margin-top: 12px; font-size: 0.7rem; color: white; text-decoration: underline; opacity: 0.7; }

/* CURRENCY CARD */
.currency-card { background: #1e293b; padding: 22px; position: relative; overflow: hidden; }
.currency-bg-graph { position: absolute; bottom: -20px; left: -10px; width: 120%; height: 100%; z-index: 0; opacity: 0.35; pointer-events: none; filter: drop-shadow(0 0 8px var(--neon-green)); }
.currency-bg-graph path { fill: url(#grad1); stroke: var(--neon-green); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.currency-content { position: relative; z-index: 1; }
.currency-grid { display: grid; grid-template-columns: 1fr; gap: 15px; margin: 15px 0; }
.input-group { display: flex; gap: 10px; align-items: center; }
.currency-select { background: rgba(0,0,0,0.6); color: var(--neon-green); border: 1px solid rgba(0,255,65,0.3); border-radius: 8px; padding: 8px; font-weight: 800; outline: none; font-size: 0.8rem; width: 110px; }
.currency-input { background: rgba(0,0,0,0.4); border: 1px solid rgba(0,255,65,0.3); border-radius: 12px; padding: 12px; color: white; font-weight: 800; font-size: 1.1rem; width: 100%; outline: none; backdrop-filter: blur(4px); }

/* UNIT CONVERTER CARD */
.converter-card { background: #1e293b; border-left: 4px solid #60a5fa; padding: 22px; color: white; position: relative; overflow: hidden; }
.converter-header { font-weight: 800; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 15px; color: white; position: relative; z-index: 2; }
.converter-body { position: relative; z-index: 2; }
.converter-card .currency-select { color: #93c5fd; border-color: rgba(96, 165, 250, 0.4); }
.converter-card .currency-input { border-color: rgba(96, 165, 250, 0.4); }

/* TAX CALCULATOR CARD */
.tax-card { background: #0f172a; border-left: 4px solid #10b981; padding: 22px; color: white; position: relative; overflow: hidden; }
.tax-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 15px; position: relative; z-index: 2; color: #10b981; }
.alpha-badge { background: #ef4444; color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.6rem; font-weight: 900; letter-spacing: 1px; }
.tax-body { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.tax-body label { font-size: 0.7rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
.tax-select, .tax-input { background: rgba(0,0,0,0.4); border: 1px solid rgba(16, 185, 129, 0.4); border-radius: 8px; padding: 10px; color: white; font-weight: 700; width: 100%; outline: none; margin-bottom: 5px; font-family: 'JetBrains Mono', monospace; }
.tax-select option { color: black; }
.tax-result-box { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 12px; padding: 15px; text-align: center; margin-top: 10px; }
.tax-res-label { font-size: 0.75rem; font-weight: 800; color: #34d399; text-transform: uppercase; margin-bottom: 5px; }
.tax-res-value { font-size: 1.8rem; font-weight: 900; color: white; font-family: 'JetBrains Mono', monospace; line-height: 1; margin-bottom: 8px; }
.tax-res-net { font-size: 0.8rem; color: #cbd5e1; font-weight: 600; }
.tax-disclaimer { font-size: 0.6rem; color: #64748b; font-style: italic; text-align: center; margin-top: 10px; }

/* EMERGENCY CARD */
.emergency-card { background: #450a0a; padding: 22px; }
.emergency-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.emergency-btn { display: flex; justify-content: space-between; align-items: center; background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 16px; padding: 15px; text-decoration: none; color: white; transition: 0.2s; }
.e-label { font-weight: 800; font-size: 0.9rem; }
.e-num { font-weight: 900; font-size: 1.1rem; color: #fca5a5; }

/* FOOTERS */
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.1); position: relative; z-index: 1;}
.weather-card .card-footer, .air-card .card-footer, .emergency-card .card-footer, .currency-card .card-footer, .converter-card .card-footer, .traffic-card .card-footer, .fuel-card .card-footer, .wotd-card .card-footer, .horoscope-card .card-footer { border-top: 1px solid rgba(255,255,255,0.1); }
.news-card .card-footer { border-top: 1px solid rgba(0,0,0,0.1); }

/* CALENDAR CARD */
.calendar-card-style { background: rgba(30, 41, 59, 0.8); backdrop-filter: blur(10px); }
.calendar-header-styled { background: var(--accent-red); color: white; text-align: center; padding: 20px; font-size: 1.3rem; font-weight: 800; text-transform: uppercase; position: relative; overflow: hidden; }
.calendar-body-styled { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
#calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.nav-btn { background: rgba(255,255,255,0.1); color: white; border: none; padding: 5px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.nav-btn:hover { background: rgba(255,255,255,0.2); }
#monthYear { font-weight: 700; color: white; }
#calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-day { text-align: center; font-weight: 800; color: var(--accent-blue); font-size: 0.7rem; text-transform: uppercase; margin-bottom: 5px; }
.calendar-date { text-align: center; padding: 8px; border-radius: 10px; cursor: default; font-weight: 500; color: #cbd5e1; }
.calendar-date:hover { background: rgba(255,255,255,0.1); }
.calendar-date.today { background: var(--accent-red); color: white; font-weight: 700; }
.countdown-list { display: flex; flex-direction: column; gap: 10px; min-height: 50px; border-top: 1px solid var(--glass-border); padding-top: 10px; margin-top: 5px; }
.countdown-item { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px; background: var(--glass); border-radius: 12px; border: 1px solid var(--glass-border); }
.countdown-left { color: var(--accent-blue); font-weight: 700; flex-shrink: 0; margin-right: 10px; font-size: 0.8rem; }
.countdown-note { font-weight: 600; color: white; flex: 1; font-size: 0.85rem; }
.delete-btn { background: transparent; border: none; cursor: pointer; font-size: 1rem; color: #ef4444; margin-left: 10px; }
.buttons-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.add-date-btn { background: var(--accent-blue); color: #0f172a; border: none; padding: 12px; border-radius: 12px; font-weight: 800; cursor: pointer; flex: 1; font-size: 0.8rem; }
.trash-btn { font-size: 1.2rem; cursor: pointer; background: #450a0a; border-radius: 12px; padding: 10px; display: flex; justify-content: center; align-items: center; width: 45px; border: 1px solid #7f1d1d; }

/* MODALS */
.modal-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: none; justify-content: center; align-items: center; z-index: 2000; backdrop-filter: blur(5px); }
.modal { background: #1e293b; padding: 25px; border-radius: 24px; width: 320px; display: flex; flex-direction: column; gap: 15px; color: white; border: 1px solid var(--glass-border); }
.modal input, .modal textarea { padding: 10px; font-size: 1rem; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.3); color: white; width: 100%; outline: none; }
.modal textarea::placeholder { color: #64748b; }
.modal button { background: var(--accent-red); color: white; border: none; padding: 12px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.modal-text { text-align: center; font-weight: 600; margin-bottom: 10px; }
.modal-buttons { display: flex; justify-content: center; gap: 15px; }
.modal-buttons button { flex: 1; }

/* ========================================= */
/* COSMIC NOMAD WIDGET STYLES */
/* ========================================= */

.mono-font { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.5px; }

/* --- MAIN WRAPPER --- */
.widget-wrapper {
    width: 100%; 
    height: auto;
    min-height: 450px;
    background-color: var(--bg-night);
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--current-glow);
    box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 15px var(--current-glow);
    transition: border-color 1.5s ease, box-shadow 1.5s ease;
    display: flex;
    flex-direction: column;
}

/* --- TABS --- */
.nav-header { padding: 15px 20px 0 20px; z-index: 20; }
.tab-container { display: flex; background: rgba(255,255,255,0.05); border-radius: 20px; padding: 4px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.tab-btn { flex: 1; background: transparent; border: none; color: var(--text-dim); padding: 8px 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; cursor: pointer; border-radius: 16px; transition: 0.3s; opacity: 0.7; }
.tab-btn.active { background: var(--current-glow); color: #000; box-shadow: 0 0 10px var(--current-glow); opacity: 1; }

/* --- VIEWS --- */
.view-section { display: none; flex-grow: 1; flex-direction: column; height: 100%; overflow-y: auto; }
.view-section.active-view { display: flex; }
.view-section::-webkit-scrollbar { width: 0; background: transparent; }

/* --- BACKGROUNDS & VFX --- */
.space-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.cosmic-dust { position: absolute; width: 100%; height: 100%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%); opacity: 0.4; mix-blend-mode: screen; }
.stars-small { position: absolute; width: 100%; height: 100%; background-image: radial-gradient(white 1px, transparent 1px); background-size: 40px 40px; opacity: 0.3; }
.stars-large { position: absolute; width: 100%; height: 100%; background-image: radial-gradient(white 1.5px, transparent 1.5px); background-size: 120px 120px; opacity: 0.4; }
.twinkle { animation: twinkle 4s infinite alternate; }
.twinkle-fast { animation: twinkle 2.5s infinite alternate-reverse; }
@keyframes twinkle { 0% { opacity: 0.2; transform: scale(0.9); } 100% { opacity: 0.6; transform: scale(1.1); } }
.nebula-glow { position: absolute; width: 350px; height: 350px; filter: blur(90px); transform: translate(-50%, -50%); opacity: 0.5; z-index: 1; pointer-events: none; transition: background 1s, left 0.1s, top 0.1s; }
.lens-flare-effect { position: absolute; width: 140px; height: 140px; background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, var(--current-glow) 40%, transparent 70%); filter: blur(5px); transform: translate(-50%, -50%); opacity: 0; z-index: 2; pointer-events: none; mix-blend-mode: screen; transition: opacity 0.5s; }
.mongolian-laser-pattern { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M10 10h20v10H10zm40 0h20v10H50zM10 60h20v10H10zm40 0h20v10H50z' fill='%23ffffff' opacity='0.1'/%3E%3C/svg%3E"); background-size: 100px 100px; opacity: 0; z-index: 1; mix-blend-mode: overlay; transition: opacity 1s; }

/* --- SOLAR VIEW STYLES --- */
.sky-container { padding: 20px 0 0 0; position: relative; z-index: 5; flex-grow: 1; display: flex; flex-direction: column; }
.header-info { padding: 0 30px; }
.phase-title-group { display: flex; align-items: center; justify-content: flex-start; }
#current-phase { font-size: 1.5rem; font-weight: 900; margin: 0; text-transform: uppercase; white-space: nowrap; text-shadow: 0 0 15px var(--current-glow); transition: text-shadow 1s; color: #fff; }
.digital-clock { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 5px 0; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
#time-remaining { font-size: 0.85rem; color: #fff; opacity: 0.9; font-weight: 500; }

.arc-container { margin: 10px 30px; flex-grow: 1; display: flex; align-items: center; }
.solar-svg { width: 100%; height: 140px; overflow: visible; filter: drop-shadow(0 0 5px var(--current-glow)); }
.sun-core { filter: drop-shadow(0 0 5px #fff); }
.rays-spin { transform-origin: center; animation: rays-rotate 20s linear infinite; }
@keyframes rays-rotate { 100% { transform: rotate(360deg); } }
.spin { transform-origin: center; animation: spin 10s linear infinite; }
@keyframes spin { 100% { transform: rotate(-360deg); } }

.action-row { display: flex; gap: 12px; padding: 0 30px 20px 30px; margin-top: auto; }
.readjust-button { flex: 0 0 auto; background: var(--current-glow); color: #000; border: none; padding: 12px 20px; border-radius: 14px; font-size: 0.75rem; font-weight: 800; cursor: pointer; text-transform: uppercase; box-shadow: 0 0 15px var(--current-glow); transition: 0.3s; }
.readjust-button:hover { transform: scale(1.05); }
.city-select { flex: 1; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 14px; padding: 0 15px; outline: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: 0.3s; }
.city-select:hover { border-color: var(--current-glow); }
.city-select option { background: #000; color: #fff; }

.slider-full-width-container { width: 100%; background: rgba(255,255,255,0.05); border-top: 1px solid rgba(255,255,255,0.1); padding: 18px 0; display: flex; align-items: center; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; background: linear-gradient(to right, rgba(255,255,255,0.1), var(--current-glow), rgba(255,255,255,0.1)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 20px; width: 40px; background: #fff; box-shadow: 0 0 15px var(--current-glow); border-radius: 10px; margin-top: -8px; transition: box-shadow 0.2s; }

.collapsible-section { background: rgba(5,5,10,0.9); backdrop-filter: blur(30px); border-top: 1px solid rgba(255,255,255,0.15); z-index: 10; position: relative; }
.toggle-bar { width: 100%; background: transparent; border: none; padding: 15px 30px; display: flex; justify-content: space-between; color: #fff; cursor: pointer; }
.toggle-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--current-glow); transition: color 1s; }
.chevron { transition: transform 0.3s ease; font-size: 0.7rem; opacity: 0.6; }
.chevron.up { transform: rotate(180deg); }
.data-grid { max-height: 0; overflow: hidden; transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1); padding: 0 30px; }
.data-grid.expanded { max-height: 400px; padding-bottom: 25px; }
.data-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.label { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.value { font-weight: 700; font-size: 1rem; color: #fff; }
.neon-label-blue { color: var(--color-blue); text-shadow: 0 0 10px rgba(0, 234, 255, 0.4); }
.neon-label-gold { color: var(--color-gold); text-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.neon-label-orange { color: var(--color-orange); text-shadow: 0 0 10px rgba(255, 107, 0, 0.4); }

/* --- CONDITIONS VIEW STYLES --- */
.essentials-container { padding: 25px; display: flex; flex-direction: column; gap: 20px; z-index: 10; position: relative; height: 100%; }
.ess-header-row { display: flex; justify-content: space-between; align-items: center; }
.ess-title { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #fff; margin: 0; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.ess-select { flex: 0 0 50%; font-size: 0.75rem; padding: 6px 12px; }

.support-module { background: rgba(255,255,255,0.03); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 15px 20px; transition: 0.3s; display: flex; flex-direction: column; gap: 10px; }
.support-module:hover { border-color: var(--current-glow); box-shadow: inset 0 0 20px rgba(255,255,255,0.02); }
.module-header-group { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 8px; margin-bottom: 5px; }
.module-label { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; color: var(--color-blue); letter-spacing: 1px; }
.module-desc { font-size: 0.7rem; color: #fff; opacity: 0.6; font-style: italic; }

.thermal-dashboard { display: flex; gap: 20px; align-items: center; }
.armor-stack { display: flex; flex-direction: column-reverse; gap: 4px; width: 40px; height: 80px; }
.armor-bar { flex: 1; background: rgba(255,255,255,0.1); border-radius: 4px; transition: 0.3s; }
.armor-bar.cold-active { background: var(--color-blue); box-shadow: 0 0 8px var(--color-blue); }
.armor-bar.warm-active { background: var(--color-orange); box-shadow: 0 0 8px var(--color-orange); }

.thermal-data { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.temp-readout { font-size: 2.2rem; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 5px; }
.advice-box { font-size: 0.9rem; color: #fff; line-height: 1.3; font-weight: 500; }

.uv-dashboard { display: flex; align-items: center; gap: 20px; }
.radar-container { position: relative; width: 80px; height: 80px; display: flex; justify-content: center; align-items: center; }
.radar-circle { width: 100%; height: 100%; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.radar-sweep { position: absolute; width: 50%; height: 50%; background: conic-gradient(from 0deg, transparent 0deg, rgba(255,255,255,0.5) 360deg); top: 0; left: 0; transform-origin: 100% 100%; animation: radar-spin 2s linear infinite; opacity: 0; transition: opacity 0.3s; }
.uv-center-value { font-size: 1.5rem; font-weight: 700; color: #fff; z-index: 2; }
@keyframes radar-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.loadout-data { flex-grow: 1; }
.loadout-label { font-size: 0.75rem; color: var(--color-blue); margin-bottom: 5px; text-transform: uppercase; font-weight: 700; }
.slot-item { display: block; background: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; color: #fff; border-left: 3px solid #fff; }

.uv-low .radar-circle { border-color: #10b981; box-shadow: 0 0 10px #10b981; }
.uv-low .slot-item { border-color: #10b981; }
.uv-mod .radar-circle { border-color: var(--color-gold); box-shadow: 0 0 10px var(--color-gold); }
.uv-mod .slot-item { border-color: var(--color-gold); }
.uv-high .radar-circle { border-color: var(--color-orange); box-shadow: 0 0 15px var(--color-orange); }
.uv-high .slot-item { border-color: var(--color-orange); }
.uv-ext .radar-circle { border-color: var(--color-danger); box-shadow: 0 0 20px var(--color-danger); }
.uv-ext .slot-item { border-color: var(--color-danger); }

.ess-footer { text-align: center; font-size: 0.7rem; color: #fff; opacity: 0.5; margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px; }
.live-dot { width: 6px; height: 6px; background: #ef4444; border-radius: 50%; animation: blink 1s infinite; }