/* Dark Mode Core Colors */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #0f172a; /* Deep slate background */
    color: #cbd5e1; /* Soft white text */
    margin: 0;
    padding: 30px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Header Adjustments */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

#date-today {
    margin: 0;
    font-size: 1.8rem;
    color: #f8fafc;
}

#weather-widget {
    font-size: 1.2rem;
    font-weight: 600;
    color: #38bdf8; /* Cyber blue text */
    background: #1e293b;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #334155;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weather-block {
    text-align: right;
}

#weather-updated {
    display: block;
    margin-top: 5px;
}

#theme-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid #334155;
    border-radius: 50%;
    background: #1e293b;
    color: #f8fafc;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Two-Column Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr; /* Calendar is wider than the news sidebar */
    gap: 25px;
    align-items: start;
}

/* Sidebar Stack for News */
.news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Dark Mode Panels */
.card {
    background-color: #1e293b; /* Dark charcoal panel background */
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Dark Mode Inversion for Google Calendar Iframes */
iframe {
    filter: invert(0.9) hue-rotate(180deg);
    border-radius: 8px;
    opacity: 0.85;
}


h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: #38bdf8; 
    border-bottom: 1px solid #334155;
    padding-bottom: 12px;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-heading h2 {
    flex: 1;
}

select {
    padding: 7px 9px;
    border: 1px solid #475569;
    border-radius: 7px;
    background: #0f172a;
    color: #cbd5e1;
    font: inherit;
}

.last-updated {
    color: #7890a9;
    font-size: 0.75rem;
}

/* Lists and Links Styling */
ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

li {
    margin-bottom: 16px;
    line-height: 1.5;
    border-bottom: 1px solid #273549;
    padding-bottom: 12px;
}

li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #38bdf8;
}

/* Responsive breakpoint for smaller tablets or windows */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Stacks vertically on narrow viewports */
    }
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#clock-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 14px 18px;
    background: linear-gradient(145deg, #111c31, #080f20);
    border: 1px solid #263b58;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.45), inset 0 1px rgba(255, 255, 255, 0.06);
}

.clock-segment {
    display: flex;
    min-width: 76px;
    padding: 5px 12px 7px;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid rgba(71, 94, 122, 0.45);
}

.clock-segment > span {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1;
    color: #6ee7b7;
    letter-spacing: 2px;
    text-shadow: 0 0 14px rgba(52, 211, 153, 0.28);
}

.clock-segment small {
    margin-top: 7px;
    color: #7890a9;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.clock-seconds-accent > span {
    color: #a7f3d0;
}

.clock-seconds-accent small {
    color: #5eead4;
}

.clock-colon {
    margin-top: -12px;
    color: #34d399;
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    font-weight: 700;
    opacity: 0.75;
}

@media (max-width: 520px) {
    #clock-container {
        gap: 4px;
        padding: 10px 8px;
    }

    .clock-segment {
        min-width: 58px;
        padding: 5px 6px 7px;
    }

    .clock-segment > span {
        font-size: 1.8rem;
    }

    .clock-segment small {
        font-size: 0.45rem;
        letter-spacing: 0.8px;
    }

    .clock-colon {
        font-size: 1.5rem;
    }
}


#live-clock {
    font-size: 1.4rem;
    font-family: monospace;
    color: #a7f3d0; /* Soft emerald green for readability */
    font-weight: bold;
    letter-spacing: 1px;
}

body.light-theme {
    background-color: #eef3f8;
    color: #334155;
}

body.light-theme header {
    border-color: #cbd5e1;
}

body.light-theme #date-today {
    color: #172033;
}

body.light-theme #weather-widget,
body.light-theme #theme-toggle,
body.light-theme .card,
body.light-theme #clock-container {
    background: #ffffff;
    border-color: #cbd5e1;
}

body.light-theme #weather-widget {
    color: #0369a1;
}

body.light-theme .clock-segment {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

body.light-theme select {
    background: #ffffff;
    color: #334155;
}

body.light-theme a {
    color: #1e3a5f;
}

@media (max-width: 600px) {
    body {
        padding: 16px;
    }

    header {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .header-actions {
        justify-content: space-between;
    }

    .weather-block {
        flex: 1;
        text-align: left;
    }

    #weather-widget {
        font-size: 1rem;
    }

    .calendar-card {
        padding: 14px;
    }

    .calendar-card iframe {
        height: 480px;
    }

    .card {
        padding: 18px;
    }
}
