/* Movete OME — Global Styles v3.1 */

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
    --dark-bg:        #0b1021;
    --panel-bg:       #151b2e;
    --neon-blue:      #00d0fc;
    --neon-purple:    #a714f9;
    --glass-border:   rgba(255,255,255,0.07);
    --glass-bg:       rgba(21,27,46,0.45);
    --radius-xl:      1rem;
    --radius-2xl:     1.25rem;
    --radius-3xl:     1.5rem;
}

/* ── Mobile Overflow Prevention & Safari Fix ──────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    min-height: 100%;
    position: relative;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    touch-action: manipulation;
}

/* ── Glassmorphism ────────────────────────────────────────────────────────── */
.glass {
    background:           var(--glass-bg);
    backdrop-filter:      blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border:               1px solid var(--glass-border);
    box-shadow:           0 4px 24px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
.scrollbox::-webkit-scrollbar { width: 0; background: transparent; }
*::-webkit-scrollbar { width: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes glowText {
    0%   { text-shadow: 0 0 5px  rgba(0,208,252,0.2); }
    50%  { text-shadow: 0 0 18px rgba(0,208,252,0.7); }
    100% { text-shadow: 0 0 5px  rgba(0,208,252,0.2); }
}
@keyframes pulseSuccess {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes shakeError {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-8px); }
    40%,80% { transform: translateX(8px); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(10px) scale(0.95); }
}
@keyframes float {
    0%,100% { transform: translateY(0px); }
    50%      { transform: translateY(-8px); }
}
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes blobPulse {
    0%,100% { transform: scale(1) translate(0,0); }
    33%      { transform: scale(1.1) translate(10px,-10px); }
    66%      { transform: scale(0.9) translate(-10px,10px); }
}

.animate-fade-in       { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-right   { animation: slideInRight 0.4s ease-out forwards; }
.pulse-success         { animation: pulseSuccess 0.6s ease-out; }
.shake-error           { animation: shakeError 0.5s ease-in-out; }
.animate-float         { animation: float 3s ease-in-out infinite; }
.animate-spin          { animation: spin 1s linear infinite; display: inline-block; }

#header-time           { animation: glowText 3s infinite; }

/* Toast */
.toast-item            { transition: all 0.3s ease; opacity: 0; transform: translateY(16px); }
.toast-show            { animation: toastIn 0.35s ease forwards; opacity: 1; }
.toast-hide            { animation: toastOut 0.35s ease forwards; }

/* ── Auth Screen ──────────────────────────────────────────────────────────── */
.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    animation: blobPulse 8s ease-in-out infinite;
}
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #fff;
    color: #3c4043;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.google-btn:hover       { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.google-btn:active      { transform: scale(0.98); }

.auth-divider {
    display: flex; align-items: center; gap: 12px;
    color: #4b5563; font-size: 0.75rem;
}
.auth-divider::before,.auth-divider::after {
    content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}

.auth-input {
    width: 100%;
    background: rgba(11,16,33,0.8);
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(0,208,252,0.12);
}
.auth-input::placeholder { color: #4b5563; }

.btn-primary-gradient {
    background: linear-gradient(135deg, var(--neon-blue), #2563eb);
    color: #fff; font-weight: 700; font-size: 1rem;
    padding: 14px; border-radius: 14px; border: none; cursor: pointer;
    width: 100%; transition: all 0.2s;
    box-shadow: 0 0 20px rgba(0,208,252,0.3);
}
.btn-primary-gradient:hover  { box-shadow: 0 0 30px rgba(0,208,252,0.5); transform: translateY(-2px); }
.btn-primary-gradient:active { transform: scale(0.98); }
.btn-primary-gradient:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Onboarding ───────────────────────────────────────────────────────────── */
.ob-goal-card {
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(21,27,46,0.4);
    text-align: center;
}
.ob-goal-card:hover  { border-color: rgba(0,208,252,0.4); transform: translateY(-3px); }
.ob-goal-card.selected {
    border-color: var(--neon-blue);
    background: rgba(0,208,252,0.1);
    box-shadow: 0 0 20px rgba(0,208,252,0.2);
}

.ob-input {
    width: 100%;
    background: rgba(11,16,33,0.9);
    color: #fff;
    padding: 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(255,255,255,0.1);
    outline: none;
    font-size: 1.1rem;
    text-align: center;
    transition: border-color 0.2s;
}
.ob-input:focus { border-color: var(--neon-blue); }
.ob-input::placeholder { color: #374151; }

/* ── Bottom Navigation ────────────────────────────────────────────────────── */
#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(11,16,33,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 20px; border-radius: 14px; cursor: pointer; border: none;
    background: transparent; color: #6b7280; transition: all 0.2s;
    font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.nav-btn svg      { transition: all 0.2s; }
.nav-btn:hover    { color: #9ca3af; }
.nav-btn.active   { color: var(--neon-blue); }
.nav-btn.active svg { filter: drop-shadow(0 0 6px rgba(0,208,252,0.8)); }

/* ── Profile View ─────────────────────────────────────────────────────────── */
.profile-stat-card {
    background: rgba(21,27,46,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.badge-auth {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    background: rgba(0,208,252,0.15); color: var(--neon-blue);
    border: 1px solid rgba(0,208,252,0.3);
}

.badge-blue {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 999px; font-size: 10px;
    font-weight: 600; background: rgba(0,208,252,0.12);
    color: var(--neon-blue); border: 1px solid rgba(0,208,252,0.2);
    margin: 2px;
}

/* ── Toast Container ──────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 90px; left: 50%; transform: translateX(-50%);
    z-index: 9999;
    display: flex; flex-direction: column-reverse; gap: 8px; align-items: center;
    width: min(90vw, 360px);
    pointer-events: none;
}
#toast-container .toast-item { pointer-events: auto; min-width: 280px; max-width: 360px; }

/* ── Gradient animated background for loader/auth ─────────────────────────── */
.gradient-animated {
    background: linear-gradient(-45deg, #0b1021, #0d1627, #101830, #0b1021);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* ── AI Processing Screen ─────────────────────────────────────────────────── */
.ai-ring-1 {
    animation: aiRing1 2s ease-in-out infinite;
}
.ai-ring-2 {
    animation: aiRing2 2.5s ease-in-out infinite;
}
.ai-ring-3 {
    animation: aiRing3 3s linear infinite;
}

@keyframes aiRing1 {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.15); opacity: 0.6; }
}
@keyframes aiRing2 {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.7; }
}
@keyframes aiRing3 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Pre-Profile Modal ────────────────────────────────────────────────────── */
#pre-profile-modal {
    transition: opacity 0.3s ease;
}

/* ── Center Button Dynamic Mode ───────────────────────────────────────────── */
#nav-train {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
