/* =========================================
   1. RESET & VARIABLES
   ========================================= */
:root {
    /* Colors */
    --bg-night: #0f172a; /* Deep Navy */
    --bg-day: #e2e8f0;   /* Light Slate */
    
    --card-night: rgba(30, 41, 59, 0.7);
    --card-day: rgba(255, 255, 255, 0.6);
    
    --text-night: #f8fafc; /* White text */
    --text-day: #1e293b;   /* Dark text */
    
    --accent: #38bdf8; /* Sky Blue */
    --accent-glow: rgba(56, 189, 248, 0.3);
    
    --border-night: #475569;
    --border-day: #cbd5e1;

    --radius: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-night);
    color: var(--text-night);
    min-height: 100vh;
    transition: background-color 0.8s ease;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56,189,248,0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(129,140,248,0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Day Mode Override GLOBAL */
body:has(#buttonCheck:checked) {
    background-color: var(--bg-day);
    color: var(--text-day); /* Global dark text for day mode */
    --card-bg: var(--card-day);
    --border-color: var(--border-day);
}

/* Day Mode Override SPECIFIC FOR CARDS (Fix for white text readability) */
body:has(#buttonCheck:checked) .card {
    /* Force text inside cards to remain white even in day mode */
    color: var(--text-night) !important; 
    background-color: var(--card-day);
    border-color: var(--border-day);
}

/* =========================================
   2. NAVIGATION (Glassmorphism)
   ========================================= */
.glass-nav {
    position: sticky;
    top: 20px;
    margin: 0 auto 30px;
    width: 90%; /* Slightly narrower on mobile */
    max-width: 1400px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-night);
    border-radius: 100px;
    padding: 10px 20px;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 30px; /* Smaller on mobile */
    width: auto;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-display {
    font-weight: 600;
    opacity: 0.7;
    display: none; 
}
@media(min-width: 768px) { 
    .date-display { display: block; } 
    .glass-nav { width: 95%; padding: 10px 30px; }
    .nav-logo { height: 40px; }
}


/* =========================================
   3. THEME TOGGLE (User's Code - Preserved)
   ========================================= */
.theme-switch { --toggle-size: 15px; --container-width: 5.625em; --container-height: 2.5em; --container-radius: 6.25em; --container-light-bg: #3D7EAE; --container-night-bg: #1D1F2C; --circle-container-diameter: 3.375em; --sun-moon-diameter: 2.125em; --sun-bg: #ECCA2F; --moon-bg: #C4C9D1; --spot-color: #959DB1; --circle-container-offset: calc((var(--circle-container-diameter) - var(--container-height)) / 2 * -1); --stars-color: #fff; --clouds-color: #F3FDFF; --back-clouds-color: #AACADF; --transition: .5s cubic-bezier(0, -0.02, 0.4, 1.25); --circle-transition: .3s cubic-bezier(0, -0.02, 0.35, 1.17); }
.theme-switch, .theme-switch *, .theme-switch *::before, .theme-switch *::after { box-sizing: border-box; margin: 0; padding: 0; font-size: var(--toggle-size); }
.theme-switch__container { width: var(--container-width); height: var(--container-height); background-color: var(--container-night-bg); border-radius: var(--container-radius); overflow: hidden; cursor: pointer; box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25), 0em 0.062em 0.125em rgba(255, 255, 255, 0.94); transition: var(--transition); position: relative; }
.theme-switch__container::before { content: ""; position: absolute; z-index: 1; inset: 0; box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset, 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset; border-radius: var(--container-radius) }
.theme-switch__checkbox { display: none; }
.theme-switch__circle-container { width: var(--circle-container-diameter); height: var(--circle-container-diameter); background-color: rgba(255, 255, 255, 0.1); position: absolute; left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter)); top: var(--circle-container-offset); border-radius: var(--container-radius); box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), 0 0 0 0.625em rgba(255, 255, 255, 0.1), 0 0 0 1.25em rgba(255, 255, 255, 0.1); display: flex; transition: var(--circle-transition); pointer-events: none; }
.theme-switch__circle-container:hover { left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter) - 0.187em); }
.theme-switch__sun-moon-container { pointer-events: auto; position: relative; z-index: 2; width: var(--sun-moon-diameter); height: var(--sun-moon-diameter); margin: auto; border-radius: var(--container-radius); background-color: var(--sun-bg); box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #a1872a inset; filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25)) drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25)); overflow: hidden; transition: var(--transition); }
.theme-switch__moon { transform: translate(0); width: 100%; height: 100%; background-color: var(--moon-bg); border-radius: inherit; box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #969696 inset; transition: var(--transition); position: relative; }
.theme-switch__spot { position: absolute; top: 0.75em; left: 0.312em; width: 0.75em; height: 0.75em; border-radius: var(--container-radius); background-color: var(--spot-color); box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset; }
.theme-switch__spot:nth-of-type(2) { width: 0.375em; height: 0.375em; top: 0.937em; left: 1.375em; }
.theme-switch__spot:nth-last-of-type(3) { width: 0.25em; height: 0.25em; top: 0.312em; left: 0.812em; }
.theme-switch__clouds { width: 1.25em; height: 1.25em; background-color: var(--clouds-color); border-radius: var(--container-radius); position: absolute; bottom: -4.062em; left: 0.312em; box-shadow: 0.937em 0.312em var(--clouds-color), -0.312em -0.312em var(--back-clouds-color), 1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color), 2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color), 2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color), 3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color), 4.5em -0.312em var(--clouds-color), 3.375em -0.437em var(--back-clouds-color), 4.625em -1.75em 0 0.437em var(--clouds-color), 4em -0.625em var(--back-clouds-color), 4.125em -2.125em 0 0.437em var(--back-clouds-color); transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25); }
.theme-switch__stars-container { position: absolute; color: var(--stars-color); top: 50%; transform: translateY(-50%); left: 0.312em; width: 2.75em; height: auto; transition: var(--transition); }
.theme-switch__checkbox:checked + .theme-switch__container { background-color: var(--container-light-bg); }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container { left: var(--circle-container-offset); }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container:hover { left: calc(var(--circle-container-offset) + 0.187em); }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__moon { transform: translateX(100%); }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__clouds { bottom: -0.625em; }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__stars-container { top: -100%; transform: translateY(0); }


/* =========================================
   4. BENTO GRID SYSTEM
   ========================================= */
.wrapper {
    width: 90%; /* Added padding for mobile so cards don't hit edge */
    max-width: 1400px;
    margin: 0 auto 50px;
}

.bento-grid {
    display: grid;
    /* MOBILE FIRST: 1 Column stack for safety */
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(180px, auto); /* Ensure minimum height */
    gap: 20px;
}
body:has(#buttonCheck:checked) .card {
    /* Force text inside cards to remain white even in day mode */
    color: var(--text-night) !important; 
    background-color: var(--card-day);
    border-color: var(--border-day);
}

/* NEW: Force Live Card to stay BLACK in Day Mode */
body:has(#buttonCheck:checked) .card.card-live {
    background-color: #000;
    border-color: #ef4444; /* Keep the red border */
}
/* --- CARD BASE STYLES --- */
.card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden; /* CRITICAL for mobile containment */
    background-color: var(--card-night);
    border: 1px solid var(--border-night);
    background-clip: padding-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-size: cover;
    background-position: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    /* Ensure content doesn't blow out width on small screens */
    max-width: 100%; 
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    border-color: var(--accent);
    z-index: 10;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
    z-index: 1;
    pointer-events: none; /* Ensure clicks pass through */
}

.card-overlay.gradient-blue { background: linear-gradient(45deg, rgba(17,73,101,0.9), rgba(17,73,101,0.6)); }
.card-overlay.gradient-red { background: linear-gradient(45deg, rgba(70, 20, 20, 0.9), rgba(70, 20, 20, 0.6)); }

.card-content {
    position: relative;
    z-index: 2;
    padding: 20px; /* Slightly less padding on mobile */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Ensure text wraps nicely */
    word-wrap: break-word; 
}

.card-content.centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card-content.bottom {
    justify-content: flex-end;
}

/* Typography */
h2 { font-size: 1.8rem; font-weight: 800; line-height: 1.1; margin-bottom: 5px; }
h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 5px; }
h4 { font-size: 1.1rem; font-weight: 600; }
p { font-size: 0.9rem; opacity: 0.8; margin-bottom: 15px; }

/* =========================================
   5. UI COMPONENTS & SPECIFIC STYLES
   ========================================= */

/* Card Header/Footer specific for Hero */
.card-header { margin-bottom: auto; }
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap; /* Allow wrapping on tiny screens */
    gap: 15px;
}

.tag {
    background: var(--accent);
    color: var(--bg-night);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
}

.card-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

/* Hero Button */
.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition: 0.3s;
    font-weight: 600;
    white-space: nowrap; /* Keep button on one line */
}
.btn-glass:hover { background: white; color: black; }

/* Fix for Hero Icons Size */
.hero-social-icons {
    font-size: 1.8rem; /* Larger size */
    display: flex;
    gap: 15px;
}

/* Action Pills (ARP/Gestop) */
.action-row {
    display: flex;
    gap: 10px;
    margin-top: auto;
}
.btn-pill {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    background: var(--accent);
    color: #0f172a;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}
.btn-pill-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
}
.btn-pill:hover { transform: translateY(-2px); box-shadow: 0 5px 15px var(--accent-glow); }
.btn-pill-outline:hover { background: white; color: black; border-color: white; }

/* List Links (Microsoft) */
.vertical-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}
.list-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: 0.2s;
}
.list-link:hover { background: var(--accent); color: black; }

/* Live Indicator */
.live-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}
.card-live { background-color: #000; border: 2px solid #ef4444; }
.blink-dot { width: 8px; height: 8px; background: #ef4444; border-radius: 50%; animation: blink 1.5s infinite; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }
.large-icon { font-size: 3rem; margin-bottom: 10px; }

/* Dock Styling */
.dock-container {
    /* On mobile, just stack it */
    margin-top: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-night);
    border-radius: 30px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.dock-title { margin-bottom: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; }
.dock-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.dock-item {
    width: 50px; /* Smaller on mobile */
    height: 50px;
    border-radius: 14px;
    overflow: hidden;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dock-item img { width: 100%; height: 100%; object-fit: cover; }
.dock-item.bg-white { background: white; padding: 5px; }
.dock-item.bg-white img { object-fit: contain; }
.dock-item.bg-green { background: #8ECB78; }
.dock-item:hover { transform: scale(1.2) translateY(-10px); z-index: 20; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

/* Footer */
.glass-footer {
    text-align: center;
    padding: 20px;
    opacity: 0.5;
    font-size: 0.8rem;
    color: var(--text-night); /* Always light footer text */
}


/* =========================================
   6. BREAKPOINTS (GRID PLACEMENT)
   ========================================= */

/* --- TABLET (768px+) --- */
@media (min-width: 768px) {
    .wrapper { width: 95%; }
    .bento-grid {
        /* Switch to 12 column grid */
        grid-template-columns: repeat(12, 1fr);
    }

    /* Typography bumps */
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    .card-content { padding: 24px; }
    .dock-item { width: 60px; height: 60px; border-radius: 18px; }

    /* Tablet Spans */
    .card-hero { grid-column: span 12; grid-row: span 2; }
    .card-wide { grid-column: span 6; grid-row: span 2; }
    .card-live { grid-column: span 12; grid-row: span 1; }
    .card-tall { grid-column: span 6; grid-row: span 2; }
    .card-square { grid-column: span 3; grid-row: span 1; }
    .dock-container { grid-column: span 12; }
}

/* --- DESKTOP (1200px+) --- */
@media (min-width: 1200px) {
    /* Desktop Spans */
    .card-hero { grid-column: span 4; grid-row: span 2; }
    .card-wide { grid-column: span 4; grid-row: span 1; }
    .card-tall { grid-column: span 2; grid-row: span 2; }
    .card-live { grid-column: span 2; grid-row: span 1; }
    .card-square { grid-column: span 2; grid-row: span 1; }
}