/* -------------------------
  1. CSS VARIABLES & GLOBAL RESETS
------------------------- */
:root {
    --bg: #0d0d0d;
    --bg-soft: #1a1a1a;
    --text: #e0e0e0;
    --text-soft: #b0c4de;
    --primary: #00f0ff;
    --primary-dark: #0077ff;
    --danger: #ff6b6b;
    --shadow: 0 0 25px rgba(0, 240, 255, 0.1);
    --radius: 15px;
    --radius-sm: 8px;
    --font-body: 'Roboto', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
    --header-height: 74px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary-dark), 0 0 10px var(--primary-dark);
}

/* -------------------------
  LANDING PAGE: NAVBAR
------------------------- */
#logged-out-view {
    padding-top: var(--header-height);
}
.navbar-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    height: 100%;
}
.logo img { height: 50px; }
.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}
.nav-links a {
    font-weight: 600;
    position: relative;
    padding: 4px 0;
    transition: color .2s;
    text-transform: uppercase;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width .3s;
}
.nav-links a:hover::after { width: 100%; }

.controls { display: flex; align-items: center; gap: 12px; }
.icon-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text); padding: 6px; border-radius: 50%;
    display: grid; place-items: center; transition: background .2s, color .2s;
}
.icon-btn:hover { background: rgba(0, 240, 255, 0.1); color: var(--primary); }
.hamburger { display: none; flex-direction: column; gap: 4px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); transition: .3s; }
.nav-mobile {
    position: fixed; inset-inline-end: -280px; top: var(--header-height);
    width: 280px; height: 100vh; background: var(--bg);
    list-style: none; padding: 32px 24px; transition: inset-inline-end .3s;
    border-inline-start: 1px solid rgba(0, 240, 255, 0.2);
}
.nav-mobile.open { inset-inline-end: 0; }
.nav-mobile a { font-weight: 600; display: block; padding: 12px 0; text-transform: uppercase; }

/* -------------------------
  LANDING PAGE: SECTIONS
------------------------- */
.hero, .progress-section-landing, .cta-section {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 24px;
}
.hero { display: flex; align-items: center; gap: 40px; }
.hero-media, .hero-content { flex: 1; min-width: 0; }
.hero-content h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 16px; line-height: 1.3; }
.hero-content p { font-size: 1.2rem; color: var(--text-soft); }
.hero-media img { border-radius: var(--radius); border: 1px solid rgba(0, 240, 255, 0.2); }

.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: clamp(24px, 4vw, 36px);
    margin-bottom: 8px;
}
.progress-cards {
    display: grid;
    gap: 32px;
}
.card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(0, 240, 255, 0.1);
    box-shadow: var(--shadow);
}
.card.reverse {
    flex-direction: row-reverse;
}
.card img {
    width: 50%;
    height: 350px;
    object-fit: cover;
}
.card-body {
    padding: 32px 24px;
    flex: 1;
}
.card-body h3 { margin-bottom: 12px; }

.cta-section {
    padding: 48px 24px; background: var(--bg-soft);
    border-radius: var(--radius); text-align: center;
    box-shadow: var(--shadow); border: 1px solid rgba(0, 240, 255, 0.2);
}
.cta-section h2 { font-size: clamp(22px, 4vw, 32px); margin-bottom: 12px; }
.cta-section p { color: var(--text-soft); margin-bottom: 24px; max-width: 500px; margin-inline: auto; }
.cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.btn-primary {
    background: var(--primary); color: #000;
    padding: 12px 28px; border-radius: var(--radius-sm);
    border: 1px solid var(--primary); font-weight: 600; font-size: 16px;
    cursor: pointer; transition: all .3s; text-transform: uppercase;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(0, 240, 255, 0.5); }

footer { text-align: center; padding: 40px 24px 24px; color: var(--text-soft); font-size: 14px; border-top: 1px solid rgba(0, 240, 255, 0.1); margin-top: 60px; }

/* -------------------------
  MODAL & FORMS
------------------------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0, .7);
    backdrop-filter: blur(8px); z-index: 2000; display: flex;
    align-items: center; justify-content: center; opacity: 1;
    transition: opacity .3s, visibility .3s;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; }
.modal-content {
    background: var(--bg); padding: 40px; border-radius: var(--radius);
    position: relative; width: 90%; max-width: 420px;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
    border: 1px solid rgba(0, 240, 255, 0.3);
    transform: scale(1); transition: transform .3s;
}
.modal-overlay.hidden .modal-content { transform: scale(0.95); }
.modal-close { position: absolute; top: 12px; inset-inline-end: 12px; }
.modal-content h2 { text-align: center; margin-bottom: 24px; }
.modal-content form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-weight: 600; margin-bottom: 6px; font-size: 14px; text-align: start; }
.form-group input {
    width: 100%; padding: 12px; border-radius: var(--radius-sm);
    border: 1px solid #444; background: #1a1a1a;
    color: var(--text); font-size: 16px;
}
.form-group input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.modal-content .btn-primary { width: 100%; padding: 12px; margin-top: 8px; }
.form-switcher { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-soft); }
.form-switcher a { color: var(--primary); font-weight: 600; text-decoration: underline; }

.auth-error {
    background-color: rgba(255, 107, 107, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* -------------------------
  RESPONSIVE LANDING PAGE
------------------------- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .hero { flex-direction: column-reverse; text-align: center; }
    .card, .card.reverse { flex-direction: column; }
    .card img { width: 100%; height: auto; }
}

/*
==========================================================================
  APP-SPECIFIC STYLES (FROM FIREBASE PROJECT)
==========================================================================
*/
#logged-in-view .app-main { max-width: 1200px; margin: 0 auto; padding: 24px; }
#logged-in-view .app-header { text-align: center; padding: 25px 15px; }
#logged-in-view .app-header h1 { font-size: 3.5rem; }
#logged-in-view .header-buttons { display: flex; justify-content: center; gap: 15px; margin: 20px 0; }
#logged-in-view .header-buttons button {
    padding: 10px 20px; border-radius: var(--radius-sm); cursor: pointer;
    font-weight: bold; text-transform: uppercase; transition: all .3s ease;
    border: 1px solid; font-size: .9rem; background: transparent;
}
#logged-in-view #profileButton { border-color: var(--primary); color: var(--primary); }
#logged-in-view #profileButton:hover { background: var(--primary); color: var(--bg); box-shadow: 0 0 15px var(--primary); }
#logged-in-view #app-logoutButton { border-color: var(--danger); color: var(--danger); }
#logged-in-view #app-logoutButton:hover { background: var(--danger); color: var(--bg); box-shadow: 0 0 15px var(--danger); }

#logged-in-view #day, #logged-in-view #todayDate { color: var(--text-soft); text-transform: uppercase; }
#logged-in-view .quote-box {
    max-width: 80%; margin: 40px auto; padding: 30px;
    background: var(--bg-soft); border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius); box-shadow: var(--shadow); position: relative;
}
#logged-in-view .quote-icon { position: absolute; top: -25px; left: 20px; font-size: 5rem; color: rgba(0, 240, 255, 0.2); }

#logged-in-view .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; padding: 20px; }
.asp_box {
    flex: 1 1 250px; max-width: 400px; background-color: #111;
    border-radius: var(--radius); padding: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5); border: 1px solid #333;
    transition: transform .3s ease, border-color .3s; cursor: pointer;
}
.asp_box:hover { transform: translateY(-5px); border-color: var(--primary); }
.asp_box img { width: 100%; height: auto; border-radius: var(--radius-sm); }
.neon-text { font-family: var(--font-heading); font-size: 1.5rem; color: var(--primary); text-shadow: 0 0 8px var(--primary); margin-bottom: 10px; }

#logged-in-view .progress-section, #logged-in-view .chart-section, #logged-in-view .task-input-section, #logged-in-view .tomorrow-tasks-section {
    width: 90%; max-width: 900px; margin: 50px auto; padding: 30px 40px;
    background: var(--bg-soft); border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
#logged-in-view .progress-label { text-align: left; font-size: 1rem; color: var(--primary); margin-top: 10px; margin-bottom: 5px; font-weight: bold; text-transform: uppercase; }
#logged-in-view .progress { background-color: #333; border-radius: 20px; overflow: hidden; height: 24px; box-shadow: inset 0 0 5px #000; }
#logged-in-view .progress-bar { background: linear-gradient(90deg, var(--primary-dark), var(--primary)); height: 100%; text-align: right; padding-right: 10px; color: #000; font-weight: bold; line-height: 24px; transition: width .6s ease; width: 0; }

#logged-in-view #taskForm { display: flex; gap: 15px; align-items: center; justify-content: center; flex-wrap: wrap; }
#logged-in-view #taskForm input, #logged-in-view #taskForm select { background-color: #1a1a1a; border: 1px solid #444; color: var(--text); border-radius: var(--radius-sm); padding: 12px 15px; font-size: 1rem; flex-grow: 1; }
#logged-in-view #taskForm button { background: var(--primary); color: #000; font-weight: bold; cursor: pointer; border: none; border-radius: var(--radius-sm); padding: 12px 30px; font-size: 1rem; text-transform: uppercase; transition: all .3s ease; }
#logged-in-view #taskForm button:hover { box-shadow: 0 0 20px var(--primary); transform: translateY(-2px); }

/* --- PROFILE PAGE --- */
#profilePage { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.profile-container { width: 100%; max-width: 600px; background: #111; border: 1px solid rgba(0, 255, 255, 0.2); border-radius: var(--radius); padding: 25px; text-align: center; box-shadow: 0 0 25px rgba(0, 255, 255, 0.1); max-height: 90vh; overflow-y: auto; }
.profile-container h2 { font-family: var(--font-heading); color: var(--primary); margin-top: 0; }
.profile-emoji-container { margin-bottom: 20px; }
.emoji-display { font-size: 80px; line-height: 1; padding: 15px; background-color: rgba(0, 255, 255, 0.1); border-radius: 50%; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px auto; border: 4px solid var(--primary); box-shadow: 0 0 20px rgba(0, 255, 255, 0.3); }
.profile-emoji-container p { color: var(--text-soft); font-weight: bold; }
.emoji-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 350px; margin: 0 auto; padding-top: 10px; }
.emoji-option { font-size: 32px; cursor: pointer; padding: 5px; border-radius: 8px; transition: transform .2s ease, background-color .2s ease; }
.emoji-option:hover { transform: scale(1.2); }
.emoji-option.selected { background-color: rgba(0, 255, 255, 0.3); }
.profile-details { margin-bottom: 25px; }
.profile-details label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--text-soft); text-align: left; }
.profile-details input { width: 100%; padding: 12px; background-color: #1a1a1a; border: 1px solid #444; color: var(--text); border-radius: var(--radius-sm); box-sizing: border-box; }
#monthlyStats { background: rgba(0, 0, 0, 0.2); padding: 15px; border-radius: 10px; margin-bottom: 25px; border: 1px solid #333; }
.profile-actions button { padding: 12px 30px; border: none; border-radius: var(--radius-sm); font-weight: bold; cursor: pointer; transition: all .3s ease; text-transform: uppercase; }
#saveProfileButton { background: var(--primary); color: #000; margin-right: 10px; }
.profile-actions button.secondary { background: #333; color: #fff; }

/* --- POPUPS & FOCUS MODE --- */
.popup { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.7); backdrop-filter: blur(5px); animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.popup-content { background: var(--bg-soft); margin: 10% auto; padding: 25px 35px; border-radius: var(--radius); border: 1px solid rgba(0, 240, 255, 0.3); width: 90%; max-width: 650px; box-shadow: 0 0 30px rgba(0, 240, 255, 0.2); position: relative; text-align: center; }
.close { position: absolute; top: 15px; right: 20px; font-size: 2.5rem; color: #777; cursor: pointer; transition: color .3s; }
.close:hover { color: #fff; }
#popupTitle { font-family: var(--font-heading); color: var(--primary); font-size: 1.8rem; margin-top: 10px; margin-bottom: 10px; text-transform: uppercase; }
#taskList { text-align: left; max-height: 350px; overflow-y: auto; padding-right: 15px; }
.task-item-container { display: flex; align-items: center; justify-content: space-between; padding: 12px; margin-bottom: 8px; background: rgba(0,0,0,.2); border-radius: var(--radius-sm); border: 1px solid #333; transition: background-color .3s, border-color .3s; }
.task-item-container:hover { background-color: rgba(0, 240, 255, 0.05); border-color: rgba(0, 240, 255, 0.2); }
.task-label { display: flex; align-items: center; cursor: pointer; font-size: 1.1rem; color: #ddd; flex-grow: 1; margin-right: 15px; }
.task-label input[type="checkbox"] { margin-right: 15px; transform: scale(1.3); cursor: pointer; accent-color: var(--primary); }
.task-label input[type="checkbox"]:checked + span { text-decoration: line-through; color: #888; }
.start-task-btn { background: transparent; border: 1px solid var(--primary); color: var(--primary); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: all .2s; flex-shrink: 0; }
.start-task-btn:hover { color: #000; background: var(--primary); box-shadow: 0 0 10px var(--primary); }

#focusModePage { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; z-index: 3000; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #fff; animation: fadeIn .5s ease; }
.focus-container { text-align: center; border: 2px solid var(--primary); padding: 40px 60px; border-radius: var(--radius); background: rgba(10, 10, 10, 0.8); box-shadow: 0 0 50px rgba(0, 240, 255, 0.2); backdrop-filter: blur(10px); }
#focusStatus { font-size: 1.5rem; font-weight: bold; color: var(--primary); text-transform: uppercase; letter-spacing: 2px; margin: 0; }
#focusTaskTitle { font-size: 2.5rem; margin: 15px 0; font-family: var(--font-body); max-width: 600px; color: #fff; text-shadow: none; }
#focusSessionCount { font-size: 1.2rem; color: var(--text-soft); margin-bottom: 30px; }
#focusTimerDisplay { font-family: var(--font-heading), 'Courier New', monospace; font-size: 8rem; font-weight: 700; color: var(--primary); text-shadow: 0 0 25px var(--primary); margin-bottom: 40px; font-variant-numeric: tabular-nums; }
.focus-controls { display: flex; gap: 20px; justify-content: center; }
.focus-controls button { padding: 15px 35px; font-size: 1rem; font-weight: bold; text-transform: uppercase; border-radius: var(--radius-sm); border: 2px solid; cursor: pointer; transition: all .3s ease; }
#focusPlayPauseButton, #focusStartNextButton { background-color: var(--primary); border-color: var(--primary); color: #000; }
#focusExitButton { background-color: transparent; border-color: var(--danger); color: var(--danger); }