/* Chorebucks - Vivid Modern Design v4.6 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Vivid Fintech Colors */
    --primary-gradient: linear-gradient(135deg, #00b09b 0%, #96c93d 100%); /* Money Gradient */
    --primary-color: #00b09b;
    
    --bg-gradient: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%); /* Subtle clean base */
    --bg-blob-1: #d4fc79;
    --bg-blob-2: #96e6a1;
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --text-main: #2d3436;
    --text-secondary: #636e72;
    
    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 12px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Blobs for "Pop" */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(168, 255, 120, 0.4) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(60px);
    animation: float 20s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 255, 209, 0.3) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(60px);
    animation: float 15s infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

/* --- Layout --- */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glass Header */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    width: 100%;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
    z-index: 2;
}

.header-right { justify-content: flex-end; }

/* Hamburger Menu */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger-btn span {
    width: 28px;
    height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 76px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 76px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 99;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu .nav-link {
    display: block;
    padding: 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-menu .nav-link:hover {
    background: rgba(0, 176, 155, 0.1);
    color: var(--primary-color);
}

.mobile-menu-overlay {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 98;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
    
    .header-right .nav-link {
        display: none;
    }
    
    .app-header {
        padding: 0 1rem;
    }
}

/* Brand Styling */
.header-logo-wide {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.nav-link:hover { 
    color: var(--primary-color); 
    background: rgba(0, 176, 155, 0.05);
}

/* --- Improved Footer (Transparent) --- */
.app-footer {
    background: transparent;
    color: var(--text-secondary);
    padding: 3rem 1.5rem 2rem;
    margin-top: auto;
    font-size: 0.9rem;
    border-top: none;
    box-shadow: none;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Footer Logo */
.footer-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}

/* Install Guides - Light Mode */
.install-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
}

@media (min-width: 600px) {
    .install-row {
        grid-template-columns: 1fr 1fr;
    }
}

.install-col {
    background: rgba(255,255,255,0.5); /* Glassy card */
    border: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
    border-radius: 12px;
    text-align: left;
    backdrop-filter: blur(8px);
}

.install-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main); /* Dark text now */
    font-weight: 700;
}

.install-icon { 
    width: 20px; 
    height: 20px; 
    fill: currentColor; 
}

.install-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Focus Logo */
.built-by-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.focus-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.built-by-row a {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.built-by-row a:hover {
    opacity: 0.7;
}

.copyright {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Main Content */
.dashboard-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Components --- */

/* Modern Cards */
.card, .auth-card, .list-card, .settings-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid white;
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.settings-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

/* Vibrant Balance Card */
.balance-card {
    background: var(--primary-gradient);
    border-radius: var(--radius-l);
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px -10px rgba(0, 176, 155, 0.4);
    position: relative;
    overflow: hidden;
    border: none;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%);
    transform: rotate(30deg);
    pointer-events: none;
}

.balance-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    position: relative;
}

.balance-amount {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    position: relative;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Pill Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--text-main);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    background: black;
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.btn-danger {
    background: #fff0f0;
    color: #ff4757;
    border: 2px solid #ff4757;
}

.btn-danger:hover {
    background: #ffe0e0;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 600px) {
    .action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* List Items */
.list-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.list-item:last-child { border-bottom: none; }

.list-item:hover {
    background: rgba(0,0,0,0.02);
}

.item-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.05rem;
}

.item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.amount-pos { 
    color: #00b894; 
    font-weight: 800;
    background: rgba(0, 184, 148, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
}

.amount-neg { 
    color: var(--text-main);
    font-weight: 700;
}

/* Forms */
.form-group { margin-bottom: 1.5rem; }

label {
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid transparent;
    background: #f1f2f6;
    border-radius: var(--radius-m);
    font-size: 1.1rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    transition: all 0.2s;
    color-scheme: light;
}

input:focus, select:focus {
    outline: none;
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 176, 155, 0.15);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    text-transform: none;
}

/* Chores */
.chore-item {
    background: white;
    border-radius: var(--radius-m);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
}

.chore-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.chore-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #dfe6e9;
    flex-shrink: 0;
    transition: all 0.2s;
}

.chore-item.completed .chore-check {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='18px' height='18px'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.chore-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.kid-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
    color: #009432;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin-right: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-s);
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.alert-error { background: #ffeaa7; color: #d35400; }
.alert-success { background: #55efc4; color: #006266; }

/* Utilities */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.text-secondary { color: var(--text-secondary); }
.text-small { font-size: 0.85rem; }

/* PWA Modal */
.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.pwa-modal-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: pwaPopUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.pwa-checkbox-wrapper input {
    width: 18px;
    height: 18px;
    margin: 0;
}

@keyframes pwaPopUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
