/* ComeCome Custom Styles - ADHD-Friendly Design */
/* Now with warmth, celebration, and joy */

/* ============================================================
   ANIMATIONS - Life and movement
   ============================================================ */

/* Pop-in: cards appear with a gentle bounce */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); }
    60% { opacity: 1; transform: scale(1.05) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.card-pop-in {
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Gentle float for the login icon */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(-2deg); }
    75% { transform: translateY(-3px) rotate(2deg); }
}

/* Confetti falling */
@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg) scale(0); opacity: 1; }
    10% { transform: translateY(-80vh) rotate(36deg) scale(1); opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    animation: confettiFall 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform;
}

/* Subtle pulse for active elements */
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Emoji wiggle on hover */
@keyframes emojiWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

/* Success bounce */
@keyframes successBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.15); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Shimmer effect for streak badges */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Glow pulse for selected items */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
}

/* Wave for greeting */
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-8deg); }
    60% { transform: rotate(14deg); }
    80% { transform: rotate(-4deg); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   LOGIN INTERFACE
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-card {
    max-width: 500px;
    width: 100%;
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.1);
}

.login-icon {
    animation: gentleFloat 3s ease-in-out infinite;
    display: inline-block;
}

.login-greeting {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.user-card {
    position: relative;
    padding: 1rem;
    border: 3px solid #e0e0e0;
    border-radius: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: white;
}

.user-card:hover {
    border-color: #4CAF50;
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.2);
}

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

.user-card input[type="radio"] { position: absolute; opacity: 0; }
.user-card input[type="radio"]:checked + .user-avatar {
    border-color: #4CAF50;
    background: #e8f5e9;
}
.user-card input[type="radio"]:checked ~ .user-name {
    color: #2E7D32;
    font-weight: 700;
}

.user-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.user-card:hover .user-avatar {
    animation: emojiWiggle 0.5s ease;
}

.user-name { font-weight: 600; }
.error-message { background: #ffebee; color: #c62828; padding: 1rem; border-radius: 0.75rem; margin-bottom: 1rem; border-left: 4px solid #c62828; }

/* ============================================================
   CHILD INTERFACE - The Heart of ComeCome
   ============================================================ */
.child-interface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f6ff;
}

/* Override Pico container so child content matches full-width header/footer */
.child-interface > .container {
    max-width: 100%;
    width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    flex: 1;
}

.child-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

/* Subtle sparkle overlay on nav */
.child-nav::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.child-nav h1 { margin: 0; font-size: 1.25rem; position: relative; z-index: 1; }
.btn-back, .btn-logout {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    padding: 0.5rem;
    position: relative;
    z-index: 1;
    border-radius: 0.5rem;
    transition: background 0.2s;
}
.btn-back:hover, .btn-logout:hover {
    background: rgba(255,255,255,0.15);
}

.child-nav .theme-toggle {
    color: white;
    background: rgba(255,255,255,0.15);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Streak badge in nav */
.streak-badge {
    display: none;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Bottom Navigation - Child's main nav */
.child-footer {
    background: white;
    border-top: 2px solid #e8e0f0;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 100;
}

.footer-btn {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.footer-btn.active {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    color: #2E7D32;
    font-weight: 700;
    transform: translateY(-2px);
}

.footer-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 25%;
    right: 25%;
    height: 3px;
    background: #4CAF50;
    border-radius: 3px;
}

.footer-btn:hover:not(.active) {
    background: #f8f6ff;
    color: #667eea;
    transform: translateY(-1px);
}

.footer-btn span:first-child {
    transition: transform 0.2s;
}

.footer-btn:hover span:first-child,
.footer-btn.active span:first-child {
    transform: scale(1.15);
}

/* ============================================================
   MEAL & FOOD SELECTION
   ============================================================ */
.meal-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.meal-btn {
    padding: 1.25rem;
    background: white;
    border: 3px solid #e0d4f0;
    border-radius: 1rem;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.meal-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
}

.meal-btn:hover, .meal-btn.active {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
}

.meal-btn:hover::before, .meal-btn.active::before {
    opacity: 1;
    background: linear-gradient(90deg, #4CAF50, #81C784);
}

.meal-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Food Grid */
.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.food-card {
    position: relative;
    padding: 1rem;
    background: white;
    border: 3px solid #e8e0f0;
    border-radius: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.food-card:hover {
    border-color: #4CAF50;
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 12px 30px rgba(76, 175, 80, 0.15);
}

.food-card:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

.food-card:hover .food-emoji {
    animation: emojiWiggle 0.4s ease;
}

.food-emoji { font-size: 3rem; margin-bottom: 0.5rem; transition: transform 0.2s; }
.food-name { font-weight: 600; font-size: 0.875rem; color: #444; }
.favorite-badge { position: absolute; top: 0.25rem; right: 0.25rem; font-size: 1.25rem; }

.food-card.is-favorite {
    border-color: #FFC107;
    background: linear-gradient(135deg, #fff, #fffde7);
}

.food-card.is-favorite::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 1.25rem;
    padding: 2px;
    background: linear-gradient(135deg, #FFC107, #FFD54F, #FFC107);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

.food-card.favorite {
    border-color: #FFC107;
    background: linear-gradient(135deg, #fff, #fffde7);
}

/* Section titles with a little flair */
.food-section h3 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.25rem;
}

/* ============================================================
   PORTION SELECTION - Make choosing feel good
   ============================================================ */
.portion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.portion-btn {
    padding: 1.5rem;
    border: 3px solid #e8e0f0;
    border-radius: 1.25rem;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
}

.portion-btn:hover {
    border-color: #4CAF50;
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
}

.portion-btn:active {
    transform: scale(0.95);
}

/* ============================================================
   CHECK-IN INTERFACE - Your feelings matter
   ============================================================ */
.checkin-section {
    background: white;
    padding: 1.5rem;
    border-radius: 1.25rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e8e0f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.checkin-section h3 {
    text-align: center;
    color: #555;
    margin-bottom: 1rem;
}

.face-scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.face-option {
    padding: 0.75rem 0.25rem;
    border: 3px solid #e8e0f0;
    border-radius: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: white;
}

.face-option:hover {
    border-color: #667eea;
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.face-option input[type="radio"] { display: none; }

.face-option input[type="radio"]:checked ~ .face-emoji {
    transform: scale(1.3);
}

.face-option input[type="radio"]:checked + .face-emoji + .face-label {
    font-weight: 700;
    color: #2E7D32;
}

/* Visual feedback when face is selected */
.face-selected, .face-option:has(input:checked) {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    animation: glowPulse 2s ease-in-out infinite;
    transform: scale(1.05);
}

.face-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.face-label { font-size: 0.75rem; transition: all 0.2s; }

.medication-check, .option-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.option-card label {
    padding: 1.5rem;
    border: 3px solid #e8e0f0;
    border-radius: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: white;
}

.option-card label:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.option-card input[type="radio"] { display: none; }
.option-card input[type="radio"]:checked ~ div { border-color: #4CAF50; background: #e8f5e9; }

/* ============================================================
   WEIGHT & CHARTS - Growing is natural
   ============================================================ */
.weight-entry-section {
    background: white;
    padding: 2rem;
    border-radius: 1.25rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e8e0f0;
}

.weight-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.weight-input-group input {
    flex: 1;
    font-size: 1.5rem;
    text-align: center;
    border-radius: 1rem;
}

.weight-unit { font-size: 1.25rem; font-weight: 600; color: #667eea; }

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 1.25rem;
    margin: 1rem 0;
    border: 2px solid #e8e0f0;
}

.weight-increase { color: #4CAF50; font-weight: 600; }
.weight-decrease { color: #FF9800; font-weight: 600; }

.weight-encouragement {
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    color: #667eea;
    font-style: italic;
}

/* ============================================================
   HISTORY - Your food story
   ============================================================ */
.date-selector {
    background: white;
    padding: 1rem;
    border-radius: 1.25rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e8e0f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.date-nav-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.date-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.date-nav-btn:active {
    transform: scale(0.95);
}

.checkin-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 1.25rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e8e0f0;
}

.summary-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.summary-item {
    text-align: center;
    min-width: 80px;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 2rem;
}

.meal-group {
    background: white;
    padding: 1.25rem;
    border-radius: 1.25rem;
    margin-bottom: 1rem;
    border: 2px solid #e8e0f0;
    transition: all 0.2s;
}

.meal-group:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.meal-group h4 { margin-bottom: 0.5rem; color: #667eea; font-weight: 700; }
.food-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f0ecf5;
    transition: background 0.2s;
}
.food-entry:last-child { border-bottom: none; }
.food-entry:hover { background: #f8f6ff; border-radius: 0.5rem; }
.food-entry .food-emoji { font-size: 2rem; }
.food-details { flex: 1; }

/* Empty state - be kind, not blank */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #888;
}

.empty-state-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: gentleFloat 3s ease-in-out infinite;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #667eea;
    font-weight: 600;
}

.empty-state-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ============================================================
   BUTTONS - Satisfying to press
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

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

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.btn-large {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
}

.btn-danger {
    background: #e53935;
    color: white;
    border-color: #e53935;
}
.btn-danger:hover {
    background: #c62828;
    color: white;
    border-color: #c62828;
}

/* Alert/notification boxes */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4CAF50;
}
.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #e53935;
}
.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #FF9800;
}

.text-danger {
    color: #e53935;
}

/* ============================================================
   SUCCESS MODALS - Celebrate EVERYTHING
   ============================================================ */
dialog {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    padding: 0;
    max-width: 400px;
    width: 90%;
    /* Override Pico CSS - ensure proper centering */
    margin: auto;
    position: fixed;
    inset: 0;
    height: fit-content;
}

dialog[open] {
    display: block;
}

dialog::backdrop {
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}

dialog article {
    padding: 2rem;
}

dialog article header {
    text-align: center;
    margin-bottom: 1rem;
}

.success-emoji {
    font-size: 5rem;
    animation: successBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.success-message {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 0.5rem;
}

.success-encouragement {
    font-size: 0.95rem;
    color: #667eea;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.success-streak {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #FFC107, #FFD54F);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: #333;
}

/* ============================================================
   GUARDIAN INTERFACE
   ============================================================ */
.guardian-interface { display: flex; min-height: 100vh; }
.guardian-interface > main { flex: 1; padding: 2rem; overflow-y: auto; max-width: none; width: auto; }
.guardian-nav { background: #1a237e; color: white; width: 250px; padding: 1.5rem; flex-shrink: 0; }
.nav-header { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid rgba(255,255,255,0.2); flex: 1; }

/* Hamburger toggle - hidden on desktop */
.nav-toggle {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    margin-left: 0.5rem;
    min-height: 0;
    width: auto;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}
.nav-menu { list-style: none; padding: 0; margin: 0; }
.nav-menu li { margin-bottom: 0.5rem; }
.nav-menu a { color: rgba(255,255,255,0.8); text-decoration: none; padding: 0.75rem; display: block; border-radius: 0.5rem; transition: all 0.2s; }
.nav-menu a:hover, .nav-menu a.active { background: rgba(255,255,255,0.1); color: white; }

.dashboard-filters { display: flex; gap: 1rem; margin: 2rem 0; flex-wrap: wrap; }
.filter-group { flex: 1; min-width: 200px; }

/* Guardian management pages */
.management-section { margin-bottom: 2rem; }
.management-section h2 { margin-bottom: 1rem; color: #333; }
.form-grid { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.5rem; }
.form-grid > * { flex: 1; min-width: 200px; }
.table-responsive { overflow-x: auto; }
.table-responsive table { width: 100%; border-collapse: collapse; }
.table-responsive th, .table-responsive td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #e0e0e0; }
.table-responsive th { background: #f5f5f5; font-weight: 600; }
.table-responsive tr:hover { background: #f8f6ff; }
.table-responsive code { background: #f0ecf5; padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-size: 0.8rem; }
.btn-small { display: inline-block; padding: 0.4rem 0.75rem; background: #667eea; color: white; border-radius: 0.5rem; text-decoration: none; font-size: 0.8rem; transition: all 0.2s; border: none; cursor: pointer; }
.btn-small:hover { background: #764ba2; transform: translateY(-1px); color: white; }

/* Override Pico CSS for guardian pages */
.guardian-interface table { margin-bottom: 0; }
.guardian-interface select,
.guardian-interface input[type="text"],
.guardian-interface input[type="search"],
.guardian-interface textarea { margin-bottom: 0; }
.guardian-interface h1 { margin-bottom: 1.5rem; color: #1a237e; }
.guardian-interface h2 { color: #333; }
.guardian-interface label { cursor: pointer; }
.guardian-interface .form-grid label { display: block; }
.guardian-interface .management-section input[type="checkbox"] { width: auto; margin-right: 0.5rem; vertical-align: middle; }

/* ============================================================
   OFFLINE BANNER
   ============================================================ */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-banner.visible {
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .guardian-interface { flex-direction: column; }
    .guardian-nav {
        width: 100% !important;
        max-width: 100%;
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 1rem;
    }
    .nav-header { margin-bottom: 0; }
    .nav-brand { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
    .nav-toggle { display: flex !important; }
    .guardian-nav .nav-menu {
        display: none;
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    .guardian-nav.nav-open .nav-menu { display: block; }
    /* Animate hamburger to X when open */
    .guardian-nav.nav-open .nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .guardian-nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .guardian-nav.nav-open .nav-toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    .food-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .meal-selection { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

    .face-scale { grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
    .face-option { padding: 0.5rem 0.15rem; border-width: 2px; }
    .face-emoji { font-size: 1.75rem; }
    .face-label { font-size: 0.6rem; }

    .login-card { margin: 1rem; padding: 1.5rem; }
}

@media (max-width: 400px) {
    .food-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .food-card { min-height: 100px; padding: 0.75rem; }
    .food-emoji { font-size: 2.5rem; }
    .food-name { font-size: 0.75rem; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

/* ============================================================
   DARK MODE - Warm and cozy, not cold
   ============================================================ */
[data-theme="dark"] {
    --bg-primary: #1a1625;
    --bg-secondary: #2d2640;
    --bg-card: #352e48;
    --text-primary: #e8e0f0;
    --text-secondary: #b0a3c0;
    --border-color: #4a3d60;
    --accent-green: #66BB6A;
    --accent-purple: #9575CD;
}

[data-theme="dark"] .child-interface {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .food-card,
[data-theme="dark"] .meal-btn,
[data-theme="dark"] .face-option,
[data-theme="dark"] .portion-btn,
[data-theme="dark"] .option-card label,
[data-theme="dark"] .checkin-section,
[data-theme="dark"] .weight-entry-section,
[data-theme="dark"] .chart-container,
[data-theme="dark"] .meal-group,
[data-theme="dark"] .checkin-summary,
[data-theme="dark"] .date-selector {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .food-name {
    color: var(--text-primary);
}

[data-theme="dark"] .food-card:hover,
[data-theme="dark"] .meal-btn:hover,
[data-theme="dark"] .meal-btn.active {
    border-color: var(--accent-green);
    background: rgba(102, 187, 106, 0.1);
}

[data-theme="dark"] .face-selected,
[data-theme="dark"] .face-option:has(input:checked) {
    border-color: var(--accent-green);
    background: rgba(102, 187, 106, 0.15);
}

[data-theme="dark"] .child-footer {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .footer-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .footer-btn.active {
    background: rgba(102, 187, 106, 0.15);
    color: var(--accent-green);
}

[data-theme="dark"] .login-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .user-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .user-card:hover {
    border-color: var(--accent-green);
}

[data-theme="dark"] .error-message {
    background: rgba(198, 40, 40, 0.15);
    color: #ef9a9a;
}

[data-theme="dark"] dialog {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary {
    background: transparent;
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--accent-purple);
    color: white;
}

[data-theme="dark"] .weight-unit {
    color: var(--accent-purple);
}

[data-theme="dark"] .meal-group h4 {
    color: var(--accent-purple);
}

[data-theme="dark"] .food-entry {
    border-color: var(--border-color);
}

[data-theme="dark"] .food-entry:hover {
    background: rgba(102, 126, 234, 0.08);
}

[data-theme="dark"] .empty-state-text {
    color: var(--accent-purple);
}

[data-theme="dark"] .success-message {
    color: var(--accent-green);
}

[data-theme="dark"] .success-encouragement {
    color: var(--accent-purple);
}

[data-theme="dark"] .food-card.is-favorite,
[data-theme="dark"] .food-card.favorite {
    border-color: #FFC107;
    background: rgba(255, 193, 7, 0.08);
}

[data-theme="dark"] .weight-decrease {
    color: #FFB74D;
}

[data-theme="dark"] .checkin-notes {
    color: var(--text-secondary);
}

[data-theme="dark"] .guardian-interface > main {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .guardian-nav {
    background: #0d1137;
}

[data-theme="dark"] .table-responsive th {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .table-responsive td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .table-responsive tr:hover {
    background: rgba(102, 126, 234, 0.08);
}

[data-theme="dark"] .table-responsive code {
    background: var(--bg-card);
    color: var(--accent-purple);
}

[data-theme="dark"] .management-section h2 {
    color: var(--text-primary);
}

/* Guardian page headings */
[data-theme="dark"] .guardian-interface h1 {
    color: #b3a8ff;
}

[data-theme="dark"] .guardian-interface h2 {
    color: var(--text-primary);
}

/* Child interface text on dark cards */
[data-theme="dark"] .checkin-section h3 {
    color: var(--text-secondary);
}

[data-theme="dark"] .meal-btn {
    color: var(--text-primary);
}

[data-theme="dark"] .portion-btn {
    color: var(--text-primary);
}

[data-theme="dark"] .option-card label {
    color: var(--text-primary);
}

[data-theme="dark"] .face-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .face-option input[type="radio"]:checked + .face-emoji + .face-label {
    color: var(--accent-green);
}

[data-theme="dark"] .user-card input[type="radio"]:checked ~ .user-name {
    color: var(--accent-green);
}

/* Summary and empty state */
[data-theme="dark"] .summary-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .empty-state {
    color: var(--text-secondary);
}

[data-theme="dark"] .weight-encouragement {
    color: var(--accent-purple);
}

/* Guardian login link on login page */
[data-theme="dark"] .guardian-login-link {
    color: var(--text-secondary);
}

/* Login greeting text */
[data-theme="dark"] .login-greeting {
    color: var(--text-secondary);
}

/* User name in login cards */
[data-theme="dark"] .user-name {
    color: var(--text-primary);
}

/* Weight unit */
[data-theme="dark"] .weight-input-group input {
    color: var(--text-primary);
}

/* Dashboard filters and inputs */
[data-theme="dark"] .dashboard-filters select,
[data-theme="dark"] .dashboard-filters label {
    color: var(--text-primary);
}

[data-theme="dark"] .filter-group label {
    color: var(--text-secondary);
}

/* Dashboard section background */
[data-theme="dark"] .dashboard-section {
    color: var(--text-primary);
}

/* Alert boxes for dark mode */
[data-theme="dark"] .alert-success {
    background: rgba(76, 175, 80, 0.15);
    color: #81C784;
    border-color: #4CAF50;
}

[data-theme="dark"] .alert-error {
    background: rgba(229, 57, 53, 0.15);
    color: #ef9a9a;
    border-color: #e53935;
}

[data-theme="dark"] .alert-warning {
    background: rgba(255, 152, 0, 0.15);
    color: #FFB74D;
    border-color: #FF9800;
}

/* Inline style overrides - message boxes in guardian pages */
[data-theme="dark"] .guardian-interface [style*="background:#ffebee"],
[data-theme="dark"] .guardian-interface [style*="background:#e8f5e9"],
[data-theme="dark"] .guardian-interface [style*="background:#fff3e0"] {
    filter: none;
}

/* Guardian form inputs on dark */
[data-theme="dark"] .guardian-interface input[type="text"],
[data-theme="dark"] .guardian-interface input[type="password"],
[data-theme="dark"] .guardian-interface input[type="number"],
[data-theme="dark"] .guardian-interface input[type="date"],
[data-theme="dark"] .guardian-interface input[type="time"],
[data-theme="dark"] .guardian-interface input[type="file"],
[data-theme="dark"] .guardian-interface input[type="search"],
[data-theme="dark"] .guardian-interface select,
[data-theme="dark"] .guardian-interface textarea {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .guardian-interface label {
    color: var(--text-primary);
}

[data-theme="dark"] .guardian-interface small {
    color: var(--text-secondary);
}

/* Delete warning text */
[data-theme="dark"] .text-danger {
    color: #ef5350;
}

/* btn-danger in dark mode */
[data-theme="dark"] .btn-danger {
    background: #c62828;
}

[data-theme="dark"] .btn-danger:hover {
    background: #b71c1c;
}

/* Child page inline text colors that need dark support */
[data-theme="dark"] .child-interface [style*="color:#667eea"] {
    color: var(--accent-purple) !important;
}

[data-theme="dark"] .child-interface [style*="color:#4CAF50"] {
    color: var(--accent-green) !important;
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.35rem;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.theme-toggle:hover {
    transform: scale(1.2) rotate(15deg);
}

/* Login page theme toggle */
.login-theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   STREAK BADGE - Improved with label
   ============================================================ */
.streak-badge {
    display: none;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.3);
    white-space: nowrap;
}

/* ============================================================
   FOOD CATEGORY TABS
   ============================================================ */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    margin: 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.category-tab {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e8e0f0;
    border-radius: 2rem;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    color: #666;
}

.category-tab:hover,
.category-tab.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8eaf6, #ede7f6);
    color: #667eea;
    transform: translateY(-1px);
}

[data-theme="dark"] .category-tab {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .category-tab:hover,
[data-theme="dark"] .category-tab.active {
    border-color: var(--accent-purple);
    background: rgba(149, 117, 205, 0.15);
    color: var(--accent-purple);
}

/* ============================================================
   GUARDIAN LOGIN LINK (footer)
   ============================================================ */
.guardian-login-link {
    display: inline-block;
    font-size: 0.8rem;
    opacity: 0.5;
    text-decoration: none;
    color: #666;
    transition: opacity 0.3s;
    margin-top: 0.5rem;
}

.guardian-login-link:hover {
    opacity: 1;
}
