/* =========================================================
   BASE STYLESHEET
   This file contains the foundational, global styles for the
   entire Easy Daily Tracker application. It defines the core
   theme, layout, and universal components.
   ========================================================= */

/* --- 1. THEME & FONT SETUP --- */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
    --background-dark: #1C1C1E;
    --background-page: #000000;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --accent-green: #30D158;
    --border-color: #38383A;
    --button-bg: #2C2C2E;
    --darker-accent-green: #2AB94F;
    --darker-green: #2AB94F; /* MMO: Restored to fix calendar header gradient regression. */
    --error-red: #FF453A;
    --success-green: #29A85A;
    --mid-green-bg: #29A85A; /* Alias for success */
    --faint-green-border: rgba(48, 209, 88, 0.2);
}

/* --- 2. BASE LAYOUT & STRUCTURE --- */
body { 
    font-family: 'Lexend', sans-serif;
    background-color: var(--background-page);
    color: var(--text-primary);
    margin: 0; 
    /* MMO: Removed 'padding: 20px;' to allow the app to go edge-to-edge on mobile. */
}

.container-new-ui { 
    background-color: var(--background-dark);
    border-radius: 20px;
    padding: 0; 
    max-width: 420px; /* Default max-width */
    min-height: 800px; 
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative; /* Needed for absolutely positioned children like the toast */
}

.main-content {
    padding: 10px 20px; /* MMO: Increased horizontal padding for better mobile UX. */
    display: flex;
    flex-direction: column;
    gap: 16px; /* MMO Request: Standardized gap */
    flex-grow: 1;
}

/* --- 3. GLOBAL HEADER (TOP BAR) --- */
.top-bar-new-ui {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    /* Note: justify-content, height, and padding will often be overridden
       by page-specific stylesheets for alignment. */
}

.top-bar-new-ui h1 {
    flex-grow: 1;
    text-align: center;
    font-weight: 700;
    margin: 0;
}

.top-bar-back-arrow {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 24px;
    flex-shrink: 0;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logout-btn, .logout-btn:visited {
    background-color: var(--button-bg);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}


/* --- 4. GLOBAL NAVIGATION (FOOTER) --- */
.footer-nav {
    position: sticky;
    bottom: 0;
    width: 100%;
    background-color: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    display: flex;
    justify-content: space-around;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent-green);
}

.nav-item p {
    margin: 0;
    font-size: 12px;
}

/* --- 5. GLOBAL UI COMPONENTS --- */

/* --- TOAST NOTIFICATION --- */
.toast {
    position: absolute; /* Changed from fixed to be relative to .container-new-ui */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--mid-green-bg);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 700;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, bottom 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
}

/* --- CONFIRMATION DIALOG --- */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.dialog-content {
    background-color: var(--button-bg);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    text-align: center;
}

#dialog-message {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 27px;
    line-height: 1.5;
    color: var(--text-primary);
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dialog-button {
    flex: 1;
    padding: 12px;
    border-radius: 25px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    max-width: 120px;
}

.dialog-button.is-primary {
    background-color: var(--accent-green);
    color: var(--background-page);
}

.dialog-button.is-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* --- 6. RESPONSIVE ADJUSTMENTS --- */
/* Why: This media query restores the padding around the app container
   on larger screens (tablets, desktops) while allowing it to be
   edge-to-edge on mobile, solving the "wasted space" issue. */
@media (min-width: 500px) {
    body {
        padding: 20px;
    }
}

/* === EOF: base.css === */