/**
 * Family Dashboard Styles
 * Main stylesheet for the calendar display application.
 */

/* ==========================================================================
   CSS Variables (Theme)
   ========================================================================== */
:root {
    /* Light Theme Palette */
    --bg-body: #f4f6f9;
    --bg-panel: #ffffff;
    --bg-header: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-accent: #2c3e50;
    --text-dim: #888888;
    --border-color: #e1e4e8;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    margin: 0;
    padding: 20px;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: var(--bg-header);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#clock-display {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-accent);
}

#date-display {
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 400;
}

#weather-display {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    gap: 10px;
    padding-left: 15px;
    border-left: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.weather-day {
    display: flex;
    align-items: center;
    gap: 4px;
}

#status-indicator {
    font-size: 0.85rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.03);
    padding: 6px 12px;
    border-radius: 20px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* ==========================================================================
   Main Container
   ========================================================================== */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex-grow: 1;
    overflow: hidden;
}

/* ==========================================================================
   Glass Panel
   ========================================================================== */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Agenda Split Layout
   ========================================================================== */
.agenda-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    overflow: hidden;
}

.agenda-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

.agenda-col:last-child {
    border-right: none;
}

.panel-header {
    padding: 14px 20px;
    background: var(--bg-body);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-accent);
    border-bottom: 1px solid var(--border-color);
}

.event-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

/* ==========================================================================
   Event Items
   ========================================================================== */
.event-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    border-left: 5px solid #888;
    margin: 0 10px 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.01);
}

.event-time {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-accent);
    text-align: right;
    padding-right: 12px;
    white-space: pre-line;
    line-height: 1.2;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.event-title {
    font-size: 1.4em;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-meta {
    display: flex;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.calendar-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-dim);
    font-size: 0.85em;
}

.no-events {
    padding: 30px;
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
}

/* ==========================================================================
   Infographic Area
   ========================================================================== */
#infographic-container {
    width: 100%;
    flex-grow: 1;
    background: var(--bg-panel);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

#weekly-infographic {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

#infographic-loading {
    color: #aaa;
    font-size: 1rem;
}

#infographic-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#infographic-container:hover #infographic-overlay {
    opacity: 1;
}

.save-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.save-btn:hover {
    background: #fff;
}

/* ==========================================================================
   Sidebar Footer (Legend)
   ========================================================================== */


.legend-tag {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    padding: 4px 8px;
    border-radius: 4px;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ==========================================================================
   Auth Overlay
   ========================================================================== */
#auth-btn-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999;
    /* Visible by default - JS hides after successful auth */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

button.auth-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 18px 36px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Display State Overlay
   ========================================================================== */
#display-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    transition: background-color 1s ease;
}

#display-overlay.state-on {
    background-color: transparent;
    pointer-events: none;
}

#display-overlay.state-dim {
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

#display-overlay.state-off {
    background-color: #000;
    pointer-events: auto;
    cursor: none;
}