/**
 * ==============================================================================
 * HOUSEHOLD COMMAND CENTER - MASTER STYLESHEET (`style.css`)
 * Trademarks: #94b2b5, #333333, #99cc66, #fbb03b
 * ==============================================================================
 */

:root {
    --brand-teal: #94b2b5;
    --brand-charcoal: #333333;
    --brand-green: #99cc66;
    --brand-amber: #fbb03b;
    --brand-red: #d9534f;
    --bg-dark: #181818;
    /* Unified shell breakpoints (keep in sync with chrome below) */
    --bp-mobile: 600px;
    --bp-tablet-max: 1024px;
}

/* Global Reset to Prevent Horizontal Scrolling */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body { 
    background: var(--bg-dark); 
    color: #333; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; 
    padding: 25px; 
}

.hub-container { 
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%;
}

/* Header Section */
.hub-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid var(--brand-teal); 
    padding-bottom: 15px; 
    margin-bottom: 25px; 
}

.hub-title { 
    font-size: 1.8em; 
    color: var(--brand-teal); 
    margin: 0; 
    font-weight: bold; 
    letter-spacing: 0.5px; 
}

.hub-subtitle { 
    font-size: 0.9em; 
    color: #aaa; 
    margin: 4px 0 0 0; 
}

/* Dashboard Grid Layout (Desktop Default: Min 380px per tile) */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
    width: 100%;
}

/* Base Dashboard Tile */
.dash-tile { 
    border: 1px solid #444; 
    border-radius: 8px; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    min-height: 240px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    transition: transform 0.2s, box-shadow 0.2s; 
    color: #222;
    width: 100%;
}

.dash-tile:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.4); 
}

/* Special sizing for multi-column tiles like Weather */
.dash-tile.weather-tile { 
    grid-column: span 2; 
}

/* Chrome: desktop vs mobile header (aligned to 600px with grid) */
.mobile-top-slim,
.mobile-footer-section {
    display: none;
}

/* ==========================================================================
     TABLET BREAKPOINT (601px - 1024px) - Forces 2 Columns
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 601px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-tile.weather-tile { 
        grid-column: span 2; 
    } 
}

/* ==========================================================================
     MOBILE PHONE BREAKPOINT (600px & Below) - Single Column + Slim Chrome
   ========================================================================== */
@media (max-width: 600px) {
    body {
        padding: 16px 12px 30px;
    }

    .desktop-header {
        display: none !important;
    }
    .mobile-top-slim {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 10px;
    }
    .mobile-footer-section {
        display: block !important;
        margin-top: 40px;
        padding: 20px 15px;
        background: rgba(0,0,0,0.2);
        border-top: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        text-align: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dash-tile {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 16px;
        min-height: 210px;
    }

    .dash-tile.weather-tile { 
        grid-column: span 1; 
    }

    .blocked-section {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 14px;
    }
}

@media (min-width: 601px) {
    .desktop-header {
        display: flex !important;
    }
    .mobile-top-slim,
    .mobile-footer-section {
        display: none !important;
    }
}

/* Tile Internal Structure */
.tile-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid rgba(0,0,0,0.15); 
    padding-bottom: 10px; 
    margin-bottom: 15px; 
}

.tile-title { 
    font-size: 1.15em; 
    font-weight: bold; 
    color: #111; 
    margin: 0; 
    font-family: monospace; 
    letter-spacing: -0.5px; 
}

.tile-action-btn { 
    background: var(--brand-charcoal); 
    color: #fff; 
    border: none; 
    padding: 5px 12px; 
    border-radius: 4px; 
    font-size: 0.8em; 
    text-decoration: none; 
    cursor: pointer; 
    font-weight: bold; 
}

.tile-action-btn:hover { 
    background: #111; 
}

.tile-action-btn.disabled { 
    background: rgba(0,0,0,0.15); 
    color: #666; 
    cursor: not-allowed; 
}

.tile-body { 
    font-size: 0.9em; 
    color: #333; 
    flex: 1; 
    line-height: 1.5; 
}

/* Weather Subgrid */
.weather-subgrid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
    margin-top: 10px; 
}

@media (max-width: 600px) { 
    .weather-subgrid { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}

/* Shared modal / status helpers (trademark accents) */
.hub-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.hub-modal-panel {
    background: #fff;
    color: #111;
    width: 92%;
    max-width: 550px;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.hub-btn-brand {
    background: var(--brand-teal);
    color: #111;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}
.hub-btn-ok {
    background: var(--brand-green);
    color: #111;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}
.hub-btn-muted {
    background: var(--brand-charcoal);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}
.hub-status {
    display: none;
    font-size: 0.85em;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 4px;
}
.hub-status.is-ok {
    display: block;
    border: 1px solid var(--brand-green);
    background: rgba(153, 204, 102, 0.18);
}
.hub-status.is-skip {
    display: block;
    border: 1px solid var(--brand-amber);
    background: rgba(251, 176, 59, 0.15);
}
.hub-status.is-err {
    display: block;
    border: 1px solid var(--brand-red);
    background: rgba(217, 83, 79, 0.12);
}
.tile-count-badge {
    font-size: 0.75em;
    color: #111;
    font-weight: bold;
    background: rgba(255,255,255,0.65);
    padding: 2px 6px;
    border-radius: 10px;
}
.tile-footer-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.15);
    padding-top: 8px;
    margin-top: 12px;
}
.tile-footer-note a {
    font-size: 0.75em;
    color: #111;
    font-weight: bold;
    text-decoration: underline;
}

.weather-loc { 
    background: rgba(255,255,255,0.6); 
    padding: 8px; 
    border-radius: 6px; 
    border: 1px solid rgba(0,0,0,0.1); 
    text-align: center; 
}

.weather-temp { 
    font-size: 1.2em; 
    font-weight: bold; 
    color: #111; 
    margin: 2px 0 0 0; 
}

/* Blocked Items Alert Section */
.blocked-section {
    background: linear-gradient(135deg, rgba(217, 83, 79, 0.2) 0%, rgba(24, 24, 24, 0.95) 75%);
    border: 1px solid #553333;
    border-top: 4px solid var(--brand-red);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    width: 100%;
}

.blocked-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding-bottom: 10px; 
    margin-bottom: 15px; 
}

.blocked-title { 
    font-size: 1.2em; 
    font-weight: bold; 
    color: #ff6b6b; 
    margin: 0; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.blocked-list { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 12px; 
    width: 100%;
}

.blocked-card { 
    background: rgba(0,0,0,0.4); 
    border: 1px solid rgba(255,107,107,0.3); 
    border-radius: 6px; 
    padding: 12px 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: #e0e0e0; 
}

.blocked-card:hover { 
    border-color: var(--brand-red); 
    background: rgba(0,0,0,0.6); 
}

.blocked-link { 
    background: var(--brand-red); 
    color: #fff; 
    padding: 6px 12px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.8em; 
    font-weight: bold; 
    white-space: nowrap; 
}

.blocked-link:hover { 
    background: #c9302c; 
}
