/* ============================================
   REMINDO — Design System
   Core tokens, reset, base styles, animations
   ============================================ */

:root {
    color-scheme: dark;
    /* Colors - Pure Black with Extreme Aurora Accents */
    --bg: #000000; /* Pure black */
    
    /* Subtle Aurora Gradients (Darkened) */
    --aurora-1: radial-gradient(circle at 0% 0%, rgba(255, 106, 0, 0.08) 0%, transparent 50%);
    --aurora-2: radial-gradient(circle at 100% 0%, rgba(124, 92, 252, 0.08) 0%, transparent 50%);
    --aurora-3: radial-gradient(circle at 100% 100%, rgba(0, 136, 255, 0.08) 0%, transparent 50%);
    --aurora-4: radial-gradient(circle at 0% 100%, rgba(255, 107, 157, 0.08) 0%, transparent 50%);

    --bg-rgb: 0, 0, 0;
    --dropdown-bg: rgba(15, 15, 18, 0.7);
    --surface: rgba(255, 255, 255, 0.08); /* Stronger white glass on black */
    --surface-rgb: 255, 255, 255;
    --surface-elevated: rgba(255, 255, 255, 0.12);
    --surface-elevated-rgb: 255, 255, 255;
    --surface-hover: rgba(255, 255, 255, 0.15);

    /* Primary Accent: Rich Darker Orange */
    --primary: #E65C00;
    --primary-rgb: 230, 92, 0;
    --primary-light: #FF7B25;
    --primary-dark: #BA4A00;

    /* Secondary Accent: Vivid Blue */
    --accent: #0088FF; 
    --accent-rgb: 0, 136, 255;

    --warning: #ffb347;
    --warning-rgb: 255, 179, 71;

    --danger: #ff6b6b;
    --danger-rgb: 255, 107, 107;

    --success: #4ecdc4;
    --success-rgb: 78, 205, 196;

    --text-primary: #eaeaf2;
    --text-secondary: #a0a0b8;
    --text-tertiary: #7c7c8f;

    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.12);

    /* Section Gradients */
    --gradient-birthday: linear-gradient(135deg, #ff6b9d 0%, #c44dff 100%);
    --gradient-bills: linear-gradient(135deg, #ffb347 0%, #ff6723 100%);
    --gradient-student: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-jobs: linear-gradient(135deg, #7c5cfc 0%, #a855f7 100%);
    --gradient-medicines: linear-gradient(135deg, #00d4aa 0%, #00b4d8 100%);
    --gradient-wishlist: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-sizes: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.035);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-blur: 16px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fs-2xs: 0.625rem;
    --fs-xs: 0.6875rem;
    --fs-sm: 0.75rem;
    --fs-base: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 2rem;

    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    /* Spacing */
    --space-2xs: 2px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-base: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-xs: 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-primary: 0 0 24px rgba(var(--primary-rgb), 0.25);
    --shadow-glow-accent: 0 0 24px rgba(var(--accent-rgb), 0.2);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);
    --transition-spring: 500ms var(--ease-spring);

    /* Z-index layers */
    --z-base: 1;
    --z-sticky: 50;
    --z-nav: 100;
    --z-overlay: 200;
    --z-drawer: 300;
    --z-modal: 400;
    --z-toast: 500;

    /* Layout */
    --top-bar-height: 56px;
    --bottom-nav-height: 84px; /* Updated for floating pill */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --content-padding: var(--space-base);
}

/* --- Light Theme Overrides --- */
[data-theme="light"] {
    color-scheme: light;
    --bg: #f2f2f7;
    --bg-rgb: 242, 242, 247;
    --dropdown-bg: rgba(255, 255, 255, 0.85);
    --surface: rgba(0, 0, 0, 0.03);
    --surface-rgb: 0, 0, 0;
    --surface-elevated: rgba(255, 255, 255, 0.8);
    --surface-elevated-rgb: 255, 255, 255;
    --surface-hover: rgba(0, 0, 0, 0.08);

    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-tertiary: #a0a0a5;

    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.15);
    
    --primary: #5e5ce6;
    --primary-rgb: 94, 92, 230;
    --primary-light: #7d7aff;
    --primary-dark: #403eb3;
    
    --glass-bg: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.5);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    background-image: var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4);
    color: var(--text-primary);
    font-size: var(--fs-base);
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
}

#app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1; /* Above any fixed backgrounds */
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:active {
    color: var(--primary);
    transform: scale(0.98);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    -webkit-appearance: none;
}

/* --- Form Elements --- */
input, select, textarea {
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text-primary);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-base);
    outline: none;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    line-height: 1.5;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

input::placeholder, textarea::placeholder {
    color: var(--text-tertiary);
}

select.custom-select-applied {
    display: none; /* Only hide selects that have been wrapped by our custom-select JS */
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* --- Custom Checkbox Toggle --- */
input[type="checkbox"] {
    width: auto;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xs);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    padding: 0;
}

input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary-color { color: var(--primary); }
.text-accent { color: var(--accent); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes scaleInCentered {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.15); }
    50% { box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3); }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn 150ms var(--ease-out) forwards !important;
    animation-delay: 0ms !important;
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 150ms var(--ease-out) forwards !important;
    animation-delay: 0ms !important;
}

.animate-scale-in {
    animation: scaleIn 350ms var(--ease-spring) forwards;
}

.animate-bounce-in {
    animation: bounceIn 500ms var(--ease-out) forwards;
}

/* ===== SPLASH SCREEN ===== */
.splash-screen { position: fixed; inset: 0; background: var(--bg); z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.4s ease, visibility 0.4s ease; }
.splash-screen.hidden { opacity: 0; visibility: hidden; }
.splash-logo { width: 80px; height: 80px; border-radius: 20px; box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.3); margin-bottom: 30px; animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1); }
.splash-spinner { width: 40px; height: 40px; border: 4px solid rgba(var(--primary-rgb), 0.2); border-left-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
