/* FONTES: Inter (Padrão), Playfair Display (Bridgerton), VT323 (Y2K) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root { 
    -webkit-tap-highlight-color: transparent; 
    /* Variáveis Padrão (Sereia) */
    --font-main: 'Inter', sans-serif;
    --font-display: 'Inter', sans-serif;
}

/* --- TEMA BRIDGERTON (Regency Era) --- */
[data-theme="bridgerton"] {
    --font-main: 'Inter', sans-serif;
    --font-display: 'Playfair Display', serif;
}
[data-theme="bridgerton"] .bg-blue-500 { background-color: #a78bfa !important; } /* Lilás */
[data-theme="bridgerton"] .bg-indigo-600 { background-color: #7c3aed !important; } /* Roxo Real */
[data-theme="bridgerton"] .text-blue-500 { color: #a78bfa !important; }
[data-theme="bridgerton"] .text-blue-600 { color: #7c3aed !important; }
[data-theme="bridgerton"] .text-blue-100 { color: #f3e8ff !important; }
[data-theme="bridgerton"] .bg-blue-50 { background-color: #faf5ff !important; }
[data-theme="bridgerton"] .border-blue-500 { border-color: #a78bfa !important; }
[data-theme="bridgerton"] .gradient-header { background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%) !important; }
body[data-theme="bridgerton"] { background-color: #fffbef !important; color: #44403c; } /* Creme */
[data-theme="bridgerton"] .glass-card { border: 1px solid #e7e5e4; background: rgba(255, 255, 255, 0.8); }

/* --- TEMA Y2K (Anos 2000/Mean Girls) --- */
[data-theme="y2k"] {
    --font-main: 'Inter', sans-serif;
    --font-display: 'VT323', monospace;
}
[data-theme="y2k"] .bg-blue-500 { background-color: #ec4899 !important; } /* Hot Pink */
[data-theme="y2k"] .bg-indigo-600 { background-color: #be185d !important; } /* Dark Pink */
[data-theme="y2k"] .text-blue-500 { color: #ec4899 !important; }
[data-theme="y2k"] .text-blue-600 { color: #be185d !important; }
[data-theme="y2k"] .text-blue-100 { color: #fce7f3 !important; }
[data-theme="y2k"] .bg-blue-50 { background-color: #fdf2f8 !important; }
[data-theme="y2k"] .border-blue-500 { border-color: #ec4899 !important; }
[data-theme="y2k"] .gradient-header { background: linear-gradient(135deg, #ec4899 0%, #831843 100%) !important; }
body[data-theme="y2k"] { background-color: #fce7f3 !important; }
[data-theme="y2k"] .glass-card { border: 2px solid #fbcfe8; box-shadow: 4px 4px 0px #ec4899; border-radius: 0px !important; }
[data-theme="y2k"] button, [data-theme="y2k"] .tab-btn { border-radius: 0px !important; letter-spacing: 1px; }
[data-theme="y2k"] h1, [data-theme="y2k"] h2, [data-theme="y2k"] h3 { text-transform: uppercase; letter-spacing: 2px; }

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    inset: 0;
    touch-action: none;
    overscroll-behavior: none;
    background-color: #f8fafc;
    font-family: var(--font-main);
    color: #334155;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.5s ease;
}

h1, h2, h3, .font-display { font-family: var(--font-display); }

#app-content {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 40px;
    padding-top: env(safe-area-inset-top);
}

.glass-card {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.gradient-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    transition: background 0.5s ease;
}

.progress-fill { transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

.day-node { 
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border-radius: 12px;
    font-weight: 800;
}

.status-perfect { background-color: #22c55e; border-color: #22c55e; color: white; }
.status-empty { background-color: #f1f5f9; border-color: #e2e8f0; color: #cbd5e1; }

.syringe-used { color: #ef4444; filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.2)); }
.syringe-fresh { color: #22c55e; filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.2)); }

.custom-checkbox {
    appearance: none;
    background-color: #f1f5f9;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.5em;
    height: 1.5em;
    border: 2px solid #cbd5e1;
    border-radius: 0.5em;
    display: grid;
    place-content: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.custom-checkbox::before {
    content: "";
    width: 0.85em;
    height: 0.85em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked { background-color: #3b82f6; border-color: #3b82f6; }
.custom-checkbox:checked::before { transform: scale(1); }
/* Tema Override para Checkbox */
[data-theme="bridgerton"] .custom-checkbox:checked { background-color: #a78bfa; border-color: #a78bfa; }
[data-theme="y2k"] .custom-checkbox:checked { background-color: #ec4899; border-color: #ec4899; }

#loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999;
    background: rgba(255, 255, 255, 1);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.sims-bar-bg {
    width: 240px; height: 16px; background: #fdf2f8;
    border: 2px solid #fbcfe8; border-radius: 99px; overflow: hidden; margin: 20px auto 0 auto; 
}
/* MUDANÇA: 7s total */
.sims-bar-fill { height: 100%; background: linear-gradient(90deg, #f472b6, #ec4899); width: 0%; transition: width 7s linear; }

#login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 5000;
    background: linear-gradient(135deg, #e0f2fe 0%, #fdf2f8 100%);
    padding: 20px;
    overflow-y: auto; 
}

.login-input {
    width: 100%; max-width: 280px;
    background: rgba(255,255,255,0.8); border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
    border-radius: 15px; padding: 15px; outline: none;
    color: #334155; font-weight: 600; font-size: 14px; margin-bottom: 10px;
}
.login-input:focus { border-color: #0ea5e9; }
.login-input::placeholder { color: #94a3b8; }

.tab-nav {
    display: flex; background: white; border-radius: 20px; padding: 5px;
    margin: -30px 20px 20px 20px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    position: relative; z-index: 40;
    overflow-x: auto;
}
.tab-btn {
    flex: 1; min-width: 70px; padding: 14px; font-size: 10px; font-weight: 800; text-transform: uppercase;
    color: #94a3b8; border-radius: 15px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tab-btn i { width: 16px; height: 16px; margin-bottom: 2px; }
.tab-btn.active { background: #0ea5e9; color: white; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); }
/* Tema Override Tab */
[data-theme="bridgerton"] .tab-btn.active { background: #a78bfa; box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3); }
[data-theme="y2k"] .tab-btn.active { background: #ec4899; box-shadow: 4px 4px 0px #be185d; }

.timeline-container { position: relative; padding-left: 30px; margin-top: 10px; }
.timeline-container::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; background: #e2e8f0; }
.timeline-item { position: relative; padding-bottom: 30px; cursor: pointer; }
.timeline-dot { position: absolute; left: -36px; top: 4px; width: 14px; height: 14px; background: #0ea5e9; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1); }

.symptom-btn { border: 1px solid #e2e8f0; background: white; padding: 8px 12px; border-radius: 12px; font-size: 11px; font-weight: 700; color: #64748b; transition: all 0.2s; }
.symptom-btn.selected { background: #fef3c7; border-color: #f59e0b; color: #b45309; box-shadow: 0 2px 5px rgba(245, 158, 11, 0.2); transform: scale(1.05); }

.bottle-icon { transition: all 0.3s ease; }
.bottle-filled { fill: #3b82f6; color: #2563eb; filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.3)); transform: scale(1.1); }
.bottle-empty { fill: none; color: #cbd5e1; }

/* Bottle Theme Overrides */
[data-theme="bridgerton"] .bottle-filled { fill: #a78bfa; color: #7c3aed; }
[data-theme="y2k"] .bottle-filled { fill: #ec4899; color: #be185d; }

.water-bar-fill { transition: width 0.5s ease; }

.diet-bar-bg { width: 100%; height: 10px; background-color: #f1f5f9; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.diet-bar-fill { height: 100%; transition: width 0.5s ease, background-color 0.5s ease; border-radius: 999px; }
.food-check { accent-color: #22c55e; width: 1.25rem; height: 1.25rem; }

.history-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; text-transform: uppercase; margin-right: 4px; margin-bottom: 4px; }
.tag-water-ok { background: #dbeafe; color: #2563eb; }
.tag-water-bad { background: #fee2e2; color: #dc2626; }
.tag-diet-ok { background: #dcfce7; color: #16a34a; }
.tag-diet-bad { background: #fef9c3; color: #ca8a04; }
.tag-diet-medium { background: #fef3c7; color: #d97706; }
.tag-workout { background: #f3e8ff; color: #9333ea; }
.tag-mission { background: #e0f2fe; color: #0284c7; }
.tag-lazy { background: #f1f5f9; color: #64748b; }

.profile-pic { object-fit: cover; border: 2px solid white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.score-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white; border: 2px solid white;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.theme-option {
    aspect-ratio: 16/9;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.theme-option.active { border-color: #3b82f6; transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
[data-theme="bridgerton"] .theme-option.active { border-color: #a78bfa; }
[data-theme="y2k"] .theme-option.active { border-color: #ec4899; }