/* JumpTrack — Custom CSS (supplements Tailwind CDN) */

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

/* ---- CSS Custom Properties ---- */
:root {
    --clr-primary:       #1f1f1f;
    --clr-primary-dark:  #1f1f1f;
    --clr-secondary:     #1f1f1f;
    --clr-bg:            #f5f5f5;
    --clr-surface:       #f0f0f0;
    --clr-text:          #1b1c1c;
    --clr-text-muted:    #757575;
    --clr-border:        #E0E0E0;
    --clr-success:       #4CAF50;
    --clr-error:         #F44336;
    --clr-warning:       #FF9800;

    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-full: 9999px;

    --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-fab:  0 8px 24px rgba(0,0,0,0.4);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--clr-text);
    background: var(--clr-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    overscroll-behavior: none;
}

/* ---- Material Symbols ---- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
    user-select: none;
}

/* ---- Auth form components ---- */
.field-group { display: flex; flex-direction: column; }

.field-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #595959;
    margin-bottom: 6px;
    padding: 0 4px;
}

.field-input {
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: #f5f5f5;
    font-size: 16px;
    font-family: inherit;
    color: var(--clr-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.field-input:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.12);
}
.field-input.field-input-error {
    border-color: var(--clr-error);
    box-shadow: 0 0 0 3px rgba(244,67,54,0.10);
}

.field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clr-text-muted);
    font-size: 20px;
    pointer-events: none;
}

.field-error {
    font-size: 12px;
    color: var(--clr-error);
    margin-top: 4px;
    padding: 0 4px;
}

.global-error {
    background: #ffdad6;
    border: 1px solid #F44336;
    color: #93000a;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
}

/* ---- Buttons ---- */
.btn-primary {
    height: 48px;
    width: 100%;
    background: var(--clr-primary);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.30);
    transition: transform 0.12s, box-shadow 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* ---- Divider ---- */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--clr-text-muted);
    font-size: 12px;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--clr-border);
}

/* ---- Password strength bar ---- */
.strength-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 0 4px;
}
.seg {
    height: 4px;
    border-radius: 2px;
    background: var(--clr-border);
    transition: background-color 0.2s;
}

/* ---- Spinner ---- */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Shimmer skeleton ---- */
.shimmer {
    background: linear-gradient(90deg, #ebebeb 25%, #e0e0e0 50%, #ebebeb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Animations ---- */
@keyframes fadeSlideUp {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.animate-fadeSlideUp { animation: fadeSlideUp 0.3s ease both; }

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0   rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 0 0 16px rgba(0,0,0,0);   }
}
.animate-pulseGlow { animation: pulseGlow 2s ease-in-out infinite; }

/* ---- Cards ---- */
.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

/* ---- Settings components ---- */
.section-heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1f1f1f;
    padding-left: 4px;
    margin-bottom: 8px;
}
.settings-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    divide-color: #E0E0E0;
}
.settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid #E0E0E0;
}
.settings-row:last-child { border-bottom: none; }
.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.settings-label { font-size: 15px; font-weight: 500; color: #1b1c1c; }
.settings-sub   { font-size: 12px; color: #757575; margin-top: 1px; }

/* ---- Toggle switch ---- */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
    width: 44px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    position: relative;
    transition: background-color 0.2s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-track {
    background: #4CAF50;
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-track {
    outline: 2px solid #1f1f1f;
    outline-offset: 2px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 0; height: 0; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Dark mode overrides ---- */
.dark body { background: #121212; color: #e0e0e0; }
.dark .settings-card { background: #1e1e1e; border-color: #333; }
.dark .settings-row  { border-color: #333; }
.dark .settings-label { color: #e0e0e0; }
.dark .card { background: #1e1e1e; }
.dark .field-input { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
.dark .field-label { color: #a8a8a8; }
.dark .global-error { background: #3c1010; border-color: #F44336; color: #ffb4ab; }

/* ---- Achievement confetti ---- */
@keyframes confetti-fall {
    0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--x),var(--y)) rotate(var(--rot)) scale(0.4); opacity: 0; }
}
.confetti-particle {
    position: absolute;
    width:  var(--size);
    height: var(--size);
    background: var(--color);
    border-radius: 2px;
    top: 50%; left: 50%;
    margin-left: calc(var(--size) / -2);
    margin-top:  calc(var(--size) / -2);
    animation: confetti-fall 0.85s ease-out forwards;
    animation-delay: var(--delay);
}

/* ---- Safe area insets (notch devices) ---- */
.safe-top    { padding-top:    env(safe-area-inset-top, 0px); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---- Page transitions ---- */
#app > * {
    animation: pageFadeIn 0.25s ease both;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
