:root {
    --bg-color: #f0f4f8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --location-color: #8b5cf6; 
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden; 
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px; 
    overflow-y: auto; 
}

.app-header { display: flex; justify-content: space-between; align-items: center; }
.header-info { display: flex; flex-direction: column; }
.app-title { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.company-name { font-size: 0.75rem; color: var(--text-main); font-weight: 600; margin-bottom: 2px; opacity: 0.8;}

#locationStatus { 
    font-size: 0.9rem; 
    color: var(--location-color); 
    font-weight: 700;
    display: flex; 
    gap: 4px; 
}
.location-highlight { color: var(--location-color); font-weight: 700; }

/* === CSS cho Nút Gạt (Toggle Switch) === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s; border-radius: 24px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white; transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.calendar-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}
.calendar-bar .divider { color: #cbd5e1; font-size: 0.8rem; }
.solar-text { color: var(--primary); font-weight: 700; }
.lunar-text { color: #ea580c; font-weight: 700; } 

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 16px; 
}

.weather-main { display: flex; justify-content: space-between; align-items: center; }
.current-temp { font-size: 3rem; font-weight: 800; line-height: 1; color: #1e293b; }
.current-temp .unit { font-size: 1.2rem; font-weight: 600; vertical-align: super; }
.weather-desc { font-size: 1rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.weather-icon-large { font-size: 3.5rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }

.weather-summary-box {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
#weatherSummary { font-size: 0.9rem; line-height: 1.4; color: #475569; font-style: italic; }

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px;
    margin-top: 12px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.detail-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 2px; letter-spacing: 0px; }
.detail-value { font-size: 0.95rem; font-weight: 700; color: var(--text-main); transition: color 0.3s ease; }

.weather-alert {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #fca5a5;
}
.hidden { display: none !important; }

.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.chart-wrapper { position: relative; width: 100%; height: 165px; } 

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.app-content { animation: fadeIn 0.4s ease-out forwards; display: flex; flex-direction: column; gap: 12px; }

.text-green { color: #15803d !important; } 
.text-red { color: #b91c1c !important; }
:root {
    --bg-color: #f0f4f8; --text-main: #1e293b; --text-muted: #64748b;
    --primary: #3b82f6; --location-color: #8b5cf6; 
    --card-bg: rgba(255, 255, 255, 0.85); --card-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --border-radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-color); background-image: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%); color: var(--text-main); min-height: 100vh; display: flex; justify-content: center; overflow: hidden; }
.app-container { width: 100%; max-width: 480px; height: 100vh; padding: 16px 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }

.app-header { display: flex; justify-content: space-between; align-items: center; }
.header-info { display: flex; flex-direction: column; }
.app-title { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.company-name { font-size: 0.75rem; color: var(--text-main); font-weight: 600; margin-bottom: 2px; opacity: 0.8;}
#locationStatus { font-size: 0.9rem; color: var(--location-color); font-weight: 700; display: flex; gap: 4px; }
.location-highlight { color: var(--location-color); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-telegram { background: #0088cc; color: white; border: none; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: 0.3s; }
.btn-telegram:active { transform: scale(0.9); }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 24px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.calendar-bar { display: flex; justify-content: center; align-items: center; gap: 12px; background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--card-border); border-radius: 10px; padding: 8px 16px; font-size: 0.85rem; box-shadow: var(--shadow-sm); }
.calendar-bar .divider { color: #cbd5e1; font-size: 0.8rem; }
.solar-text { color: var(--primary); font-weight: 700; }
.lunar-text { color: #ea580c; font-weight: 700; } 

.glass-panel { background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--card-border); border-radius: var(--border-radius); box-shadow: var(--shadow-md); padding: 16px; }
.weather-main { display: flex; justify-content: space-between; align-items: center; }
.current-temp { font-size: 3rem; font-weight: 800; line-height: 1; color: #1e293b; }
.current-temp .unit { font-size: 1.2rem; font-weight: 600; vertical-align: super; }
.weather-desc { font-size: 1rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.weather-icon-large { font-size: 3.5rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }

.weather-summary-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.05); }
#weatherSummary { font-size: 0.9rem; line-height: 1.4; color: #475569; font-style: italic; }

.weather-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.detail-item { display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, 0.6); padding: 8px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.4); }
.detail-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 2px; }
.detail-value { font-size: 0.95rem; font-weight: 700; color: var(--text-main); transition: color 0.3s ease; }

.weather-alert { background-color: #fee2e2; color: #dc2626; padding: 8px 12px; border-radius: 8px; margin-top: 12px; font-size: 0.85rem; font-weight: 600; border: 1px solid #fca5a5; }
.hidden { display: none !important; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.chart-wrapper { position: relative; width: 100%; height: 165px; } 
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.app-content { animation: fadeIn 0.4s ease-out forwards; display: flex; flex-direction: column; gap: 12px; }
.text-green { color: #15803d !important; } 
.text-red { color: #b91c1c !important; }