/* ========================================
   Satsangi Parenting - Apple-Style Design
   Clean, Minimal, Beautiful
   ======================================== */

/* CSS Variables - Apple-inspired palette */
:root {
    /* Primary - Warm Saffron */
    --primary: #FF9500;
    --primary-light: #FFAA33;
    --primary-dark: #E68600;
    --primary-subtle: rgba(255, 149, 0, 0.12);
    
    /* Secondary - Deep Indigo */
    --secondary: #5856D6;
    --secondary-light: #7A79E0;
    --secondary-subtle: rgba(88, 86, 214, 0.12);
    
    /* Success */
    --success: #34C759;
    --success-subtle: rgba(52, 199, 89, 0.12);
    
    /* Danger */
    --danger: #FF3B30;
    --danger-subtle: rgba(255, 59, 48, 0.12);
    
    /* Warning */
    --warning: #FF9500;
    
    /* Neutrals - Apple Gray Scale */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F2F2F7;
    --gray-200: #E5E5EA;
    --gray-300: #D1D1D6;
    --gray-400: #AEAEB2;
    --gray-500: #8E8E93;
    --gray-600: #636366;
    --gray-700: #48484A;
    --gray-800: #3A3A3C;
    --gray-900: #1C1C1E;
    
    /* Backgrounds */
    --bg-primary: #F2F2F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F9FAFB;
    
    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --font-rounded: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius - Apple loves rounded */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* Shadows - Subtle, layered */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.16);
    
    /* Transitions - Smooth, Apple-like */
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 180ms var(--ease-out);
    --transition-normal: 280ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --white: #1C1C1E;
    --gray-50: #2C2C2E;
    --gray-100: #3A3A3C;
    --gray-800: #E5E5EA;
    --gray-900: #F2F2F7;
    --glass-bg: rgba(28, 28, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation; /* Faster touch response */
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--gray-900);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* App Wrapper */
.app-wrapper {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

/* ========================================
   Welcome/Landing Screen
   ======================================== */

.welcome-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
}

.welcome-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: 40px;
    padding-bottom: var(--space-lg);
}

.welcome-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFD9A8 50%, #FF9500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.welcome-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 500;
    max-width: 280px;
    line-height: 1.5;
}

/* Features Horizontal Scroll */
.features-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    width: 100%;
    padding: var(--space-md) 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}

.features-scroll::-webkit-scrollbar {
    display: none;
}

.feature-card {
    flex-shrink: 0;
    width: 200px;
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    text-align: center;
    scroll-snap-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 40px;
    display: block;
    margin-bottom: var(--space-sm);
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: var(--space-xs);
}

.feature-card p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* CTA Buttons */
.welcome-cta {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 320px;
    position: relative;
    z-index: 1;
    margin-top: var(--space-lg);
}

.cta-btn {
    width: 100%;
    padding: 16px var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
}

.cta-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B35 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.3);
}

.cta-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 149, 0, 0.4);
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.offline-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    margin-top: var(--space-md);
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.offline-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.welcome-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: auto;
    padding: var(--space-lg);
}

.welcome-footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Auth Modals */
#register-modal.modal-overlay,
#login-modal.modal-overlay,
#join-family-modal.modal-overlay {
    align-items: center;
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(30px);
}

.auth-modal {
    max-width: 400px;
    width: 90%;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(255, 149, 0, 0.1);
}

.auth-modal .modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-sm);
}

.auth-modal .modal-header h2 {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.auth-modal .back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.2s;
    justify-self: start;
}

.auth-modal .back-btn:hover {
    color: #FFB84D;
}

.auth-modal .close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    justify-self: end;
}

.auth-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.auth-modal form {
    padding: var(--space-lg);
}

.auth-modal .form-group {
    margin-bottom: var(--space-md);
}

.auth-modal .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-modal .form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #FFFFFF;
    font-size: 16px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.auth-modal .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-modal .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.2);
}

.auth-modal .form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.auth-modal .cancel-btn {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-modal .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.auth-modal .primary-btn {
    flex: 2;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B35 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-modal .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.3);
}

.auth-modal .secondary-btn {
    width: calc(100% - 48px);
    margin: 0 var(--space-lg) var(--space-md);
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-modal .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auth-switch {
    text-align: center;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-md) var(--space-lg);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    text-transform: uppercase;
}

/* Family Header */
.family-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: 40px;
    margin-bottom: var(--space-lg);
}

.family-name {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: var(--space-sm);
}

.family-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
}

.family-code span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.family-code code {
    color: var(--primary);
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 2px;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: transform 0.2s;
}

.copy-btn:hover {
    transform: scale(1.2);
}

.account-options {
    position: relative;
    z-index: 1;
    margin-top: var(--space-lg);
}

.text-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.text-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.text-btn.danger {
    color: rgba(255, 100, 100, 0.6);
}

.text-btn.danger:hover {
    color: rgba(255, 100, 100, 0.9);
}

/* ========================================
   Login Screen - Premium Immersive Design
   ======================================== */

.login-container.premium {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
}

/* Animated Background */
.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #FF9500 0%, #FF6B35 100%);
    top: -100px;
    right: -80px;
    animation-delay: 0s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #5856D6 0%, #7C3AED 100%);
    bottom: 20%;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #34C759 0%, #10B981 100%);
    bottom: -50px;
    right: 20%;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.05); }
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 149, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(88, 86, 214, 0.03) 0%, transparent 50%);
    background-size: 100% 100%;
}

/* Hero Section */
.login-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: 50px;
    padding-bottom: var(--space-xl);
}

.logo-glow {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.logo-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 149, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 3s ease-in-out infinite;
}

.logo-icon-premium {
    font-size: 80px;
    display: block;
    position: relative;
    z-index: 1;
    animation: floatBounce 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(255, 149, 0, 0.4));
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
}

.app-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFD9A8 50%, #FF9500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
    text-shadow: 0 0 60px rgba(255, 149, 0, 0.3);
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

/* Profile Selection */
.profiles-section {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-bottom: var(--space-lg);
}

.profiles-section .section-label {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
}

/* Premium Profile Cards */
.family-profiles.premium {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    width: 100%;
}

/* Staggered entrance animation for profile cards */
.family-profiles.premium .profile-card {
    animation: cardEntrance 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

.family-profiles.premium .profile-card:nth-child(1) { animation-delay: 0.1s; }
.family-profiles.premium .profile-card:nth-child(2) { animation-delay: 0.2s; }
.family-profiles.premium .profile-card:nth-child(3) { animation-delay: 0.3s; }
.family-profiles.premium .profile-card:nth-child(4) { animation-delay: 0.4s; }
.family-profiles.premium .profile-card:nth-child(5) { animation-delay: 0.5s; }
.family-profiles.premium .profile-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* No members state - premium */
.family-profiles.premium .no-members {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: rgba(255, 255, 255, 0.6);
}

.family-profiles.premium .no-members p {
    margin-bottom: var(--space-sm);
}

.family-profiles.premium .no-members p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.profile-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #FF6B35 50%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card:hover, .profile-card:active {
    transform: translateY(-8px) scale(1.03);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 149, 0, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 149, 0, 0.15);
}

.profile-card:hover::before {
    opacity: 1;
}

.profile-card:hover::after {
    opacity: 1;
}

.profile-avatar {
    font-size: 44px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.profile-card:hover .profile-avatar {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.3) 0%, rgba(255, 149, 0, 0.1) 100%);
    border-color: rgba(255, 149, 0, 0.5);
}

.profile-name {
    font-weight: 700;
    font-size: 18px;
    color: #FFFFFF;
    margin-bottom: var(--space-xs);
    position: relative;
    z-index: 1;
}

.profile-role {
    font-size: 11px;
    font-weight: 700;
    color: var(--white);
    background: var(--secondary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    z-index: 1;
}

.profile-role.parent {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B35 100%);
}

.profile-points {
    margin-top: var(--space-sm);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

.profile-points span {
    color: var(--primary-light);
    font-weight: 700;
}

/* Premium Add Member Button */
.add-member-btn.premium {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: var(--space-xl);
}

.add-member-btn.premium .plus-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s ease;
}

.add-member-btn.premium:hover {
    background: rgba(255, 149, 0, 0.15);
    border-color: var(--primary);
    color: var(--white);
    transform: scale(1.02);
}

.add-member-btn.premium:hover .plus-icon {
    background: var(--primary);
    transform: rotate(90deg);
}

/* Login Footer - Optional */
.login-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-lg);
    margin-top: auto;
}

.daily-wisdom {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: var(--space-xs);
}

.wisdom-source {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

/* Premium Avatar Picker */
#add-member-modal .avatar-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

#add-member-modal .avatar-option {
    width: 100%;
    aspect-ratio: 1;
    max-width: 60px;
    height: auto;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    font-size: 28px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#add-member-modal .avatar-option:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--primary-light);
    background: rgba(255, 149, 0, 0.15);
}

#add-member-modal .avatar-option.selected {
    border-color: var(--primary);
    background: rgba(255, 149, 0, 0.25);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.3);
}

/* Fallback for non-premium login */
.login-container:not(.premium) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-primary) 100%);
}

.app-logo {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-top: 60px;
}

.logo-icon {
    font-size: 72px;
    display: block;
    margin-bottom: var(--space-lg);
    filter: drop-shadow(0 8px 24px rgba(255, 149, 0, 0.3));
    animation: floatGentle 4s ease-in-out infinite;
}

@keyframes floatGentle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

.tagline {
    color: var(--gray-500);
    font-size: 15px;
    font-weight: 500;
}

/* Non-premium family profiles */
.family-profiles:not(.premium) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    width: 100%;
    margin-bottom: var(--space-lg);
}

/* Non-premium Add Member Button */
.add-member-btn:not(.premium) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    color: var(--gray-500);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.add-member-btn:not(.premium):hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.02);
}

/* ========================================
   Modal Styles - Apple Sheet Style
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    padding: 0;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 430px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s var(--ease-spring);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.modal-header.negative h2 {
    color: var(--danger);
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--gray-200);
    transform: scale(1.1);
}

/* PIN Modal - Premium Dark Style */
.pin-modal {
    padding: var(--space-xl);
    text-align: center;
    border-radius: var(--radius-xl);
    margin: var(--space-md);
    max-width: 340px;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(255, 149, 0, 0.1);
}

.pin-modal h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: #FFFFFF;
}

/* Avatar in PIN modal */
.pin-avatar-display {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.3) 0%, rgba(255, 107, 53, 0.3) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 48px;
    border: 3px solid rgba(255, 149, 0, 0.5);
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.2);
}

.pin-member-name-text {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFD9A8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 20px;
    font-weight: 600;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.pin-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-bottom: var(--space-lg);
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s var(--ease-spring);
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.5);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    max-width: 280px;
    margin: 0 auto;
}

.pin-key {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    font-size: 28px;
    font-weight: 500;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-rounded);
}

.pin-key:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 149, 0, 0.4);
}

.pin-key:active {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(0.95);
    box-shadow: 0 0 30px rgba(255, 149, 0, 0.4);
}

.pin-key.cancel {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.pin-key.cancel:hover {
    color: var(--primary-light);
}

.pin-error {
    color: #FF6B6B;
    font-size: 14px;
    margin-top: var(--space-md);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.pin-error.hidden {
    display: none;
}

/* Update modal overlay for premium feel */
#pin-modal.modal-overlay {
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(30px);
}

/* Form Styles */
form {
    padding: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 17px;
    font-family: inherit;
    background: var(--gray-50);
    transition: all var(--transition-fast);
    color: var(--gray-900);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--primary-subtle);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* Avatar Picker */
.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.avatar-option {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
    background: var(--white);
    font-size: 28px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.avatar-option:hover {
    border-color: var(--primary-light);
    transform: scale(1.08);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
    transform: scale(1.08);
}

/* Premium Add Member Modal - Dark Theme */
#add-member-modal.modal-overlay {
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(30px);
}

#add-member-modal .modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(255, 149, 0, 0.1);
}

#add-member-modal .modal-header {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

#add-member-modal .modal-header h2 {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFD9A8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#add-member-modal .close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

#add-member-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

#add-member-modal .form-group label {
    color: rgba(255, 255, 255, 0.7);
}

#add-member-modal .form-group input,
#add-member-modal .form-group select {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

#add-member-modal .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#add-member-modal .form-group input:focus,
#add-member-modal .form-group select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.2);
}

#add-member-modal .form-group select option {
    background: #1a1a2e;
    color: #FFFFFF;
}

#add-member-modal .avatar-option {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

#add-member-modal .avatar-option:hover {
    border-color: var(--primary-light);
    background: rgba(255, 149, 0, 0.15);
}

#add-member-modal .avatar-option.selected {
    border-color: var(--primary);
    background: rgba(255, 149, 0, 0.2);
}

#add-member-modal .primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B35 100%);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.3);
}

#add-member-modal .primary-btn:hover {
    box-shadow: 0 12px 32px rgba(255, 149, 0, 0.4);
    transform: translateY(-2px);
}

/* Buttons - Apple Style */
.primary-btn {
    width: 100%;
    padding: 16px var(--space-lg);
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    width: 100%;
    padding: 16px var(--space-lg);
    background: var(--primary-subtle);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.secondary-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.danger-btn {
    width: 100%;
    padding: 16px var(--space-lg);
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.danger-btn:hover {
    filter: brightness(1.1);
}

/* ========================================
   Main App Container
   ======================================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

.app-container.hidden {
    display: none;
}

/* Header - Apple Navigation Bar Style */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.back-to-profiles {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gray-100);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-profiles:hover {
    background: var(--gray-200);
    transform: scale(1.05);
}

.current-user {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    font-weight: 600;
    font-size: 17px;
    color: var(--gray-900);
}

.user-role-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--secondary);
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-role-badge.parent {
    background: var(--primary);
}

.header-right {
    display: flex;
    gap: var(--space-sm);
}

.points-display, .streak-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 14px;
}

.points-value, .streak-value {
    font-weight: 700;
    color: var(--gray-900);
}

/* Main Content */
.main-content {
    flex: 1;
    padding-bottom: 100px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Smooth page transitions */
.main-content > .screen {
    animation: pageEnter 0.4s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Screens */
.screen {
    display: none;
    padding: var(--space-md);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active {
    display: block;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.screen-header h2 {
    font-size: 34px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

/* ========================================
   Dashboard Screen - Elegant & Swipeable
   ======================================== */

/* Hero Card */
.hero-card {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    color: var(--white);
    animation: fadeSlideUp 0.6s ease-out;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.greeting {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.greeting-emoji {
    font-size: 32px;
}

.greeting-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.greeting-date {
    font-size: 13px;
    opacity: 0.85;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.streak-fire {
    font-size: 18px;
}

.streak-num {
    font-size: 18px;
    font-weight: 800;
}

.hero-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.hero-stat-item {
    flex: 1;
    text-align: center;
}

.stat-num {
    font-size: 24px;
    font-weight: 800;
    display: block;
    line-height: 1.1;
}

.stat-desc {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
}

/* Insights Card */
.insights-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    animation: fadeSlideUp 0.6s 0.1s ease-out backwards;
}

.insights-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.insights-icon {
    font-size: 18px;
}

.insights-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.insights-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: 2px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.insights-scroll::-webkit-scrollbar {
    display: none;
}

.insight-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: all 0.3s ease;
}

.insight-chip:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.insight-emoji {
    font-size: 16px;
}

.insight-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

/* Section Block */
.section-block {
    margin-bottom: var(--space-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.progress-mini {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.progress-mini span {
    color: var(--success);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.link-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

/* Swipeable Habits */
.swipe-container {
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
}

.habits-swipe {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: var(--space-xs) 0 var(--space-md);
    -webkit-overflow-scrolling: touch;
}

.habits-swipe::-webkit-scrollbar {
    display: none;
}

.habit-card-new {
    flex-shrink: 0;
    width: 90px;
    padding: var(--space-md) var(--space-sm);
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scroll-snap-align: start;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.habit-card-new:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.15);
}

.habit-card-new:active {
    transform: scale(0.95);
}

.habit-card-new.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: var(--success);
}

.habit-card-new.completed .habit-done-check {
    opacity: 1;
    transform: scale(1);
}

.habit-icon-wrap {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.habit-card-new:hover .habit-icon-wrap {
    transform: scale(1.1);
}

.habit-card-new.completed .habit-icon-wrap {
    background: linear-gradient(135deg, #c3e6cb 0%, #a8d5b1 100%);
}

.habit-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
    line-height: 1.2;
}

.habit-pts {
    font-size: 12px;
    font-weight: 700;
    color: var(--success);
}

.habit-done-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.habit-done-check::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: 700;
}

.habit-card-new.add-more {
    background: var(--gray-50);
    border-style: dashed;
    border-color: var(--gray-200);
}

.habit-card-new.add-more .habit-icon-wrap {
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 28px;
    font-weight: 300;
}

/* Weekly Chart */
.chart-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.week-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 80px;
    padding-top: var(--space-sm);
}

.day-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.day-bar .bar-fill {
    width: 20px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--radius-sm);
    min-height: 4px;
    max-height: 60px;
    transition: height 0.5s ease-out;
}

.day-bar.today .bar-fill {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.day-bar span {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
}

.day-bar.today span {
    color: var(--primary);
    font-weight: 700;
}

/* Tip Card */
.tip-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-bottom: var(--space-lg);
    transition: all 0.3s ease;
}

.tip-card:active {
    transform: scale(0.98);
}

.tip-card .tip-icon {
    font-size: 24px;
}

.tip-card .tip-text {
    flex: 1;
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
    margin: 0;
}

.tip-card .tip-next {
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

/* Legacy habits styles - hidden */
.habits-section {
    display: none;
}

.habits-grid, .habit-card, .more-habits-btn {
    display: none;
}

/* ========================================
   To-Do Section
   ======================================== */

.todo-section {
    margin-bottom: var(--space-lg);
}

.todo-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.add-todo-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-todo-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.no-todos {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-lg);
    font-size: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-200);
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-100);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s ease-out;
}

.todo-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.todo-item.completed {
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
    border-color: var(--success);
    opacity: 0.8;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: var(--gray-500);
}

.todo-item.overdue {
    border-color: var(--danger);
    background: #FFF5F5;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    margin-top: 2px;
}

.todo-checkbox:hover {
    border-color: var(--success);
    transform: scale(1.1);
}

.todo-item.completed .todo-checkbox {
    background: var(--success);
    border-color: var(--success);
}

.todo-item.completed .todo-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    display: block;
}

.todo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.todo-due {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.todo-due.soon {
    color: var(--warning);
}

.todo-due.overdue {
    color: var(--danger);
}

.todo-notes {
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
    margin-top: 4px;
}

.todo-points {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
    background: var(--success-subtle);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.todo-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-500);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.todo-delete:hover {
    background: var(--danger);
    color: white;
}

.completed-todos-divider {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-sm) 0;
    margin-top: var(--space-sm);
    border-top: 1px solid var(--gray-100);
}

/* To-Do Modal */
.todo-modal {
    max-width: 400px;
}

.todo-modal textarea {
    width: 100%;
    padding: 12px var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    background: var(--gray-50);
    resize: none;
    transition: all var(--transition-fast);
}

.todo-modal textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--primary-subtle);
}

/* Premium dark theme for todo modal */
#add-todo-modal.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* Legacy Progress Section - keeping for compatibility */
.progress-section {
    display: none;
}

/* Recent Section */
.recent-section {
    margin-bottom: var(--space-lg);
}

/* Tip Section - Minimal */
.tip-section {
    margin-bottom: var(--space-lg);
}

.tip-card-mini {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tip-card-mini:active {
    transform: scale(0.98);
}

.tip-card-mini .tip-icon {
    font-size: 24px;
}

.tip-card-mini .tip-text {
    flex: 1;
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
    margin: 0;
}

/* Section Row */
.section-row {
    margin-bottom: var(--space-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    padding-left: var(--space-xs);
}

.see-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

/* Horizontal Scroll Container */
.horizontal-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: var(--space-xs) 0;
    margin: 0 calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.cards-scroll {
    gap: var(--space-md);
}

/* Action Chips */
.action-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.action-chip:hover, .action-chip:active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.action-chip span {
    font-size: 16px;
}

/* Task Cards - Horizontal */
.task-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.task-card:hover, .task-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.task-card.special {
    background: linear-gradient(135deg, #FFF9E6 0%, var(--white) 100%);
    border-color: rgba(255, 149, 0, 0.3);
}

.task-card.completed {
    background: var(--success-subtle);
    border-color: var(--success);
}

.task-icon {
    font-size: 32px;
    margin-bottom: var(--space-xs);
}

.task-info {
    text-align: center;
}

.task-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
    display: block;
    margin-bottom: 2px;
}

.task-points {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
}

.task-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-300);
    transition: all var(--transition-fast);
}

.task-card.completed .task-check {
    background: var(--success);
    border-color: var(--success);
}

.task-card.completed .task-check::after {
    content: '✓';
    color: var(--white);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Pillar Cards - Horizontal */
.pillar-card {
    min-width: 120px;
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    border: 2px solid transparent;
}

.pillar-card:hover, .pillar-card:active {
    transform: translateY(-4px) scale(1.02);
}

.pillar-card.pillar-1 {
    background: linear-gradient(135deg, #FFE5CC 0%, #FFF5EB 100%);
}

.pillar-card.pillar-2 {
    background: linear-gradient(135deg, #E5E4FF 0%, #F5F5FF 100%);
}

.pillar-card.pillar-3 {
    background: linear-gradient(135deg, #CCF5F3 0%, #E5FFFD 100%);
}

.pillar-card.completed {
    border-color: var(--success);
}

.pillar-card-icon {
    font-size: 36px;
    margin-bottom: var(--space-xs);
}

.pillar-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.pillar-card-desc {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: var(--space-xs);
}

.pillar-card-status {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
}

.pillar-card.completed .pillar-card-status {
    color: var(--success);
}

.three-pillars-bonus {
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CD 100%);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    margin-top: var(--space-sm);
}

/* Mantra Banner - Compact */
.mantra-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, #F0EDFF 0%, #E8E6FF 100%);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mantra-banner:active {
    transform: scale(0.98);
}

.mantra-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.mantra-emoji {
    font-size: 32px;
}

.mantra-content {
    display: flex;
    flex-direction: column;
}

.mantra-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary);
}

.mantra-sanskrit {
    font-size: 12px;
    color: var(--gray-600);
}

.mantra-right {
    display: flex;
    align-items: center;
}

.mantra-tap {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary);
}

/* Tip Card - Parent Reminder */
.tip-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFBF0 100%);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tip-card:active {
    transform: scale(0.98);
}

.tip-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.tip-text {
    flex: 1;
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
    margin: 0;
}

.tip-next {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

/* Activity List - Compact */
.activity-list.compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.activity-list.compact .activity-item {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.activity-list.compact .activity-icon {
    font-size: 20px;
}

.activity-list.compact .activity-name {
    font-size: 13px;
}

.activity-list.compact .activity-points {
    font-size: 14px;
}

.no-activity {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-lg);
    font-size: 14px;
}

.combo-bonus.hidden, .hidden {
    display: none !important;
}

/* Recent Activity */
.recent-activity h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-100);
}

.activity-item .activity-icon {
    font-size: 28px;
}

.activity-item .activity-info {
    flex: 1;
}

.activity-item .activity-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
}

.activity-item .activity-time {
    font-size: 12px;
    color: var(--gray-500);
}

.activity-item .activity-points {
    font-weight: 700;
    font-size: 17px;
    color: var(--success);
}

.activity-item .activity-points.negative {
    color: var(--danger);
}

.activity-item .self-badge {
    font-size: 10px;
    font-weight: 600;
    background: var(--primary-subtle);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    margin-left: 4px;
}

.no-activity {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-xl);
    font-size: 15px;
}

/* ========================================
   Log Points Screen
   ======================================== */

/* Pillars Banner */
.pillars-banner {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    padding: var(--space-xs) 0;
    -webkit-overflow-scrolling: touch;
}

.pillars-banner::-webkit-scrollbar {
    display: none;
}

.pillar-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.pillar-badge.pillar-1 {
    background: linear-gradient(135deg, #FFE5CC 0%, #FFD4A8 100%);
}

.pillar-badge.pillar-2 {
    background: linear-gradient(135deg, #E5E4FF 0%, #D4D3FF 100%);
}

.pillar-badge.pillar-3 {
    background: linear-gradient(135deg, #CCF5F3 0%, #A8EFEB 100%);
}

.pillar-badge:hover, .pillar-badge:active {
    transform: scale(1.05);
}

.pillar-num {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--gray-800);
}

.pillar-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
}

/* Category Pills - Clean Design */
.category-pills {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-md);
    -webkit-overflow-scrolling: touch;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

.category-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B35 100%);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

/* Legacy category tabs - keep for compatibility */
.category-tabs {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-tab:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.category-tab.active {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: var(--white);
}

/* Activities List - Clean Design */
.activities-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.activity-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-100);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.activity-card:hover {
    border-color: var(--primary);
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.12);
}

.activity-card:active {
    transform: translateX(4px) scale(0.98);
}

.activity-card.negative {
    border-color: var(--danger-subtle);
    background: #FFFAFA;
}

.activity-card.negative:hover {
    background: var(--danger-subtle);
    border-color: var(--danger);
    transform: translateX(8px);
}

.activity-card .activity-icon {
    font-size: 36px;
    transition: transform 0.3s ease;
}

.activity-card:hover .activity-icon {
    transform: scale(1.15);
}

.activity-card .activity-details {
    flex: 1;
}

.activity-card .activity-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-900);
}

.activity-card .activity-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.activity-card .activity-points {
    font-weight: 800;
    font-size: 18px;
    color: var(--success);
    padding: var(--space-xs) var(--space-sm);
    background: var(--success-subtle);
    border-radius: var(--radius-full);
}

.activity-card.negative .activity-points {
    color: var(--danger);
    background: var(--danger-subtle);
}

/* Staggered animation for activity cards */
.activities-list .activity-card {
    animation: slideInRight 0.4s ease-out backwards;
}

.activities-list .activity-card:nth-child(1) { animation-delay: 0.05s; }
.activities-list .activity-card:nth-child(2) { animation-delay: 0.1s; }
.activities-list .activity-card:nth-child(3) { animation-delay: 0.15s; }
.activities-list .activity-card:nth-child(4) { animation-delay: 0.2s; }
.activities-list .activity-card:nth-child(5) { animation-delay: 0.25s; }
.activities-list .activity-card:nth-child(6) { animation-delay: 0.3s; }
.activities-list .activity-card:nth-child(7) { animation-delay: 0.35s; }
.activities-list .activity-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Log Modal */
.log-modal {
    max-width: 400px;
}

.log-details {
    padding: var(--space-lg);
}

.points-preview {
    text-align: center;
    padding: var(--space-lg);
    background: var(--success-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.points-preview.negative {
    background: var(--danger-subtle);
}

.preview-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.preview-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--success);
    display: block;
    letter-spacing: -1px;
}

.points-preview.negative .preview-value {
    color: var(--danger);
}

/* Self-Initiated Toggle */
.self-initiated-section {
    margin-bottom: var(--space-lg);
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.toggle-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-md);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-option:hover {
    border-color: var(--primary-light);
}

.toggle-option.active {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.toggle-icon {
    font-size: 28px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.toggle-points {
    font-size: 15px;
    font-weight: 700;
    color: var(--success);
}

.log-btn {
    margin: 0 var(--space-lg) var(--space-lg);
    width: calc(100% - var(--space-lg) * 2);
}

/* Negative Warning */
.negative-warning {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--danger-subtle);
    margin: var(--space-md);
    border-radius: var(--radius-md);
}

.warning-icon {
    font-size: 24px;
}

.negative-warning p {
    font-size: 14px;
    color: var(--danger);
    font-weight: 500;
}

/* Parent Only Elements */
.parent-only {
    display: none;
}

body.is-parent .parent-only {
    display: block;
}

body.is-parent .parent-only.hidden {
    display: none;
}

/* ========================================
   Checklists Screen
   ======================================== */

.checklist-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.checklist-card.bedtime {
    background: linear-gradient(135deg, #F0EDFF 0%, var(--white) 100%);
    border-color: rgba(88, 86, 214, 0.15);
}

.checklist-card.weekly {
    background: linear-gradient(135deg, #FFF0F0 0%, var(--white) 100%);
    border-color: rgba(255, 59, 48, 0.15);
}

.checklist-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.checklist-icon {
    font-size: 24px;
}

.checklist-header h3 {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
}

.checklist-card.weekly .checklist-header h3 {
    color: var(--danger);
}

.checklist-progress {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.checklist-item:hover {
    background: var(--gray-50);
}

.checklist-item .check-box {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 14px;
    color: transparent;
}

.checklist-item.completed .check-box {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.checklist-item .item-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
}

.checklist-item.completed .item-text {
    text-decoration: line-through;
    color: var(--gray-500);
}

.checklist-item .item-points {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.checklist-note {
    font-size: 13px;
    color: var(--danger);
    font-weight: 600;
    margin-top: var(--space-md);
    text-align: center;
}

.combo-indicator {
    text-align: center;
    padding: var(--space-sm);
    background: var(--primary-subtle);
    border-radius: var(--radius-sm);
    margin-top: var(--space-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* ========================================
   Perks Shop Screen
   ======================================== */

.balance-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    color: var(--gray-600);
}

.balance-value {
    font-weight: 700;
    font-size: 17px;
    color: var(--primary);
}

.perks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.perk-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid var(--gray-100);
}

.perk-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.perk-card.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.perk-card.unavailable:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--gray-100);
}

.perk-icon {
    font-size: 40px;
    margin-bottom: var(--space-sm);
}

.perk-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.perk-cost {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
}

/* Pending Redemptions */
.pending-redemptions h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pending-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
}

.pending-item .pending-info {
    flex: 1;
}

.pending-item .pending-member {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
}

.pending-item .pending-perk {
    font-size: 13px;
    color: var(--gray-600);
}

.pending-actions {
    display: flex;
    gap: var(--space-xs);
}

.approve-btn, .deny-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.approve-btn {
    background: var(--success);
    color: var(--white);
}

.deny-btn {
    background: var(--danger);
    color: var(--white);
}

.approve-btn:hover, .deny-btn:hover {
    transform: scale(1.1);
}

/* Redeem Modal */
.redeem-details {
    text-align: center;
    padding: var(--space-xl);
}

.perk-icon-large {
    font-size: 72px;
    display: block;
    margin-bottom: var(--space-md);
}

.redeem-details h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.redeem-details .perk-cost {
    font-size: 17px;
    margin-bottom: var(--space-xs);
}

.balance-after {
    color: var(--gray-500);
    font-size: 14px;
}

.balance-after span {
    font-weight: 700;
    color: var(--gray-700);
}

.redeem-actions {
    display: flex;
    gap: var(--space-md);
    padding: 0 var(--space-lg) var(--space-lg);
}

.redeem-actions button {
    flex: 1;
}

/* ========================================
   Leaderboard Screen
   ======================================== */

.period-toggle {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-lg);
    background: var(--gray-100);
    padding: 3px;
    border-radius: var(--radius-md);
}

.period-btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.period-btn.active {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-100);
}

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, #FFF9E6 0%, var(--white) 100%);
    border-color: #FFD700;
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, #F5F5F5 0%, var(--white) 100%);
    border-color: #C0C0C0;
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, #FFF0E6 0%, var(--white) 100%);
    border-color: #CD7F32;
}

.leaderboard-item.is-me {
    border: 2px solid var(--primary);
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.lb-avatar {
    font-size: 28px;
}

.lb-info {
    flex: 1;
}

.lb-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-900);
}

.lb-streak {
    font-size: 12px;
    color: var(--gray-500);
}

.lb-points {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

/* Family Goal Card */
.family-goal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.goal-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.goal-icon {
    font-size: 24px;
}

.goal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
}

.goal-progress {
    margin-bottom: var(--space-sm);
}

.goal-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.goal-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s var(--ease-out);
}

.goal-text {
    font-size: 13px;
    color: var(--gray-500);
}

.goal-reward {
    text-align: center;
    font-size: 15px;
    color: var(--primary);
    font-weight: 600;
    margin-top: var(--space-sm);
}

/* ========================================
   Admin Screen
   ======================================== */

.admin-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-tab.active {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: var(--white);
}

.admin-content {
    display: none;
}

.admin-content:not(.hidden) {
    display: block;
}

.admin-section {
    margin-bottom: var(--space-xl);
}

.admin-section h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--gray-900);
}

.admin-hint {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: var(--space-md);
}

/* Account Info */
.account-info {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.account-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.account-info-item .label {
    font-size: 14px;
    color: var(--gray-500);
}

.account-info-item .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.account-info-item .value.invite-code {
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--primary);
}

.copy-btn-small {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.copy-btn-small:hover {
    background: var(--gray-200);
}

/* Danger Zone */
.danger-zone {
    background: #FEF2F2;
    border: 1px solid #FEE2E2;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
}

.danger-zone h3 {
    color: #DC2626;
}

.danger-btn {
    width: 100%;
    padding: 14px var(--space-lg);
    background: #DC2626;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.danger-note {
    font-size: 12px;
    color: #991B1B;
    margin-top: var(--space-sm);
    text-align: center;
}

/* Delete Warning Modal */
.delete-warning {
    padding: var(--space-lg);
    background: rgba(220, 38, 38, 0.1);
    border-radius: var(--radius-lg);
    margin: var(--space-lg);
}

.delete-warning p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-sm);
}

.delete-warning ul {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.delete-warning li {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-xs);
}

.delete-warning .recovery-note {
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-top: var(--space-md);
}

.members-list, .custom-activities-list, .perks-manage-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.member-item, .custom-activity-item, .perk-manage-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xs);
}

.member-item .member-avatar {
    font-size: 32px;
}

.member-item .member-details {
    flex: 1;
}

.member-item .member-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
}

.member-item .member-stats {
    font-size: 13px;
    color: var(--gray-500);
}

.edit-btn, .delete-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.edit-btn {
    background: var(--gray-100);
    color: var(--gray-600);
}

.delete-btn {
    background: var(--danger-subtle);
    color: var(--danger);
}

.delete-btn:hover {
    background: var(--danger);
    color: var(--white);
}

/* History Filters */
.history-filters {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.history-filters select {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--white);
}

.full-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 400px;
    overflow-y: auto;
}

/* ========================================
   Bottom Navigation - Apple Tab Bar
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm) var(--space-xs) calc(var(--space-sm) + env(safe-area-inset-bottom));
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 50px;
}

.nav-item .nav-icon {
    font-size: 24px;
    transition: transform var(--transition-fast);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* ========================================
   Toast Notification
   ======================================== */

.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gray-900);
    color: var(--white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: toastIn 0.4s var(--ease-spring);
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    font-weight: 600;
    font-size: 15px;
}

/* ========================================
   Celebration Animation
   ======================================== */

.celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1002;
    animation: fadeIn 0.3s ease;
}

.celebration.hidden {
    display: none;
}

.celebration-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    animation: bounceIn 0.6s var(--ease-spring);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

.confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ========================================
   Responsive - Desktop Enhancement
   ======================================== */

@media (min-width: 768px) {
    body {
        background: linear-gradient(135deg, #F8F8F8 0%, #E8E8E8 100%);
    }
    
    .app-wrapper {
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-xl);
        overflow: hidden;
    }
    
    .modal-content {
        border-radius: var(--radius-xl);
        margin: auto;
    }
    
    .modal-overlay {
        align-items: center;
        padding: var(--space-lg);
    }
}

/* Mobile First - All Mobile Devices */
@media (max-width: 767px) {
    /* Welcome screen mobile */
    .welcome-container {
        padding: var(--space-md);
    }
    
    .welcome-title {
        font-size: 28px;
    }
    
    .welcome-tagline {
        font-size: 14px;
    }
    
    .features-scroll {
        padding: var(--space-sm) 0;
    }
    
    .feature-card {
        width: 160px;
        padding: var(--space-md);
    }
    
    .feature-icon {
        font-size: 32px;
    }
    
    .feature-card h3 {
        font-size: 14px;
    }
    
    .feature-card p {
        font-size: 12px;
    }
    
    .welcome-cta {
        max-width: 100%;
    }
    
    .cta-btn {
        padding: 14px var(--space-lg);
        font-size: 16px;
    }
    
    /* Auth modals mobile */
    .auth-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .auth-modal .modal-header h2 {
        font-size: 16px;
    }
    
    .auth-modal .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .auth-modal .form-actions {
        flex-direction: column;
    }
    
    .auth-modal .cancel-btn,
    .auth-modal .primary-btn {
        flex: none;
        width: 100%;
    }
    
    /* Profile cards mobile */
    .family-profiles {
        gap: var(--space-sm);
    }
    
    .profile-card {
        padding: var(--space-md);
    }
    
    .profile-avatar {
        font-size: 44px;
    }
    
    /* PIN modal mobile - 6 digits */
    .pin-display {
        gap: 8px;
    }
    
    .pin-dot {
        width: 14px;
        height: 14px;
    }
    
    .pin-pad {
        gap: var(--space-sm);
    }
    
    .pin-key {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
    
    /* Dashboard mobile */
    .stat-card {
        padding: var(--space-sm);
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    /* Bottom nav safe area */
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 8px);
    }
}

/* Small phones */
@media (max-width: 375px) {
    .stats-cards {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
    
    .quick-action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .perks-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .pillars-grid {
        gap: var(--space-xs);
    }
    
    .mantra-status {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .pin-key {
        width: 54px;
        height: 54px;
        font-size: 20px;
    }
    
    .pin-dot {
        width: 12px;
        height: 12px;
    }
    
    .profile-avatar {
        font-size: 38px;
    }
}

/* ========================================
   Animations - Shake for wrong PIN
   ======================================== */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}