/* ============================================================
   FileVault – Global Styles & Design Tokens
   ============================================================ */

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

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Colors */
    --primary:        #7C3AED;
    --primary-light:  #9F67FF;
    --primary-dark:   #5B21B6;
    --secondary:      #06B6D4;
    --accent:         #F59E0B;
    --success:        #10B981;
    --danger:         #EF4444;
    --danger-dark:    #B91C1C;

    /* Backgrounds */
    --bg-base:        #0F0F1A;
    --bg-surface:     #16162A;
    --bg-card:        rgba(255,255,255,0.05);
    --bg-card-hover:  rgba(255,255,255,0.09);
    --bg-glass:       rgba(255,255,255,0.07);
    --bg-glass-solid: #1E1E35;

    /* Text */
    --text-primary:   #F1F1FF;
    --text-secondary: #A0A0C0;
    --text-muted:     #5C5C80;

    /* Borders */
    --border:         rgba(255,255,255,0.08);
    --border-focus:   rgba(124,58,237,0.6);

    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:  0 8px 30px rgba(0,0,0,0.4);
    --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);
    --glow:       0 0 30px rgba(124,58,237,0.25);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Transitions */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }
.spin { animation: spin 0.8s linear infinite; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124,58,237,0.6);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-secondary:active { transform: scale(0.97); }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--danger), #FF6B6B);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(239,68,68,0.4);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(239,68,68,0.6); }

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

.modal-sheet {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    background: var(--bg-glass-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-xl) var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom));
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-sheet.modal-sm { max-width: 380px; padding-bottom: var(--space-xl); }

.modal-handle {
    width: 40px; height: 4px;
    background: var(--border);
    border-radius: 99px;
    margin: -8px auto var(--space-lg);
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-xs);
}
.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-lg);
}
.modal-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions .btn-danger { flex: 1; }

/* --- Toast Notifications --- */
.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
    animation: slideDown 0.3s ease;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #34D399; }
.toast-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: #FCA5A5; }

/* --- Animations --- */
@keyframes fadeIn    { from { opacity: 0 }            to { opacity: 1 } }
@keyframes slideUp   { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes spin      { to { transform: rotate(360deg) } }
@keyframes pulse     { 0%,100%{ opacity:1 } 50%{ opacity:.6 } }
@keyframes float {
    0%,100% { transform: translateY(0) }
    50%     { transform: translateY(-20px) }
}
