/* ============================================================
   RyL — Global Stylesheet
   ============================================================ */

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

/* ── Variables ────────────────────────────────────────────── */
:root {
  --c-from:   #1a1a2e;
  --c-mid:    #16213e;
  --c-to:     #0f3460;
  --glass-bg: rgba(255,255,255,0.05);
  --glass-bd: rgba(255,255,255,0.10);
  --glass-sh: 0 8px 32px rgba(0,0,0,0.4);
  --radius:   1rem;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .brand {
  font-family: 'Outfit', system-ui, sans-serif;
}

/* ── Backgrounds ─────────────────────────────────────────── */
.pin-page-bg,
.public-bg,
.admin-bg {
  background: linear-gradient(135deg, var(--c-from) 0%, var(--c-mid) 50%, var(--c-to) 100%);
  min-height: 100vh;
}

/* ── Glassmorphism Card ──────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-bd);
  box-shadow: var(--glass-sh);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

/* Hover grow: only on expense cards */
.expense-card.glass-card:hover {
  transform: scale(1.04) translateY(-6px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.2);
}

/* ── Total Banner ────────────────────────────────────────── */
.total-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.8) 0%, rgba(99,102,241,0.7) 50%, rgba(139,92,246,0.8) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(196,181,253,0.2);
  box-shadow: 0 20px 60px rgba(109,40,217,0.4);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar-glass {
  background: rgba(15,12,41,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  transform: translateX(4px);
}
.sidebar-link-active {
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(99,102,241,0.3));
  color: #fff;
  border: 1px solid rgba(196,181,253,0.2);
}

/* ── Top Bar ─────────────────────────────────────────────── */
.top-bar {
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(10px);
}

/* ── Public Header ───────────────────────────────────────── */
.public-header {
  background: rgba(15,12,41,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover:not(:disabled) {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 30px rgba(124,58,237,0.45);
}

.btn-secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

.btn-danger {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.4);
  transform: scale(1.05);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.form-input::placeholder { color: rgba(255,255,255,0.25); }
.form-input:focus {
  border-color: rgba(139,92,246,0.6);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-input option { background: #1e1b4b; color: #fff; }

.glass-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.875rem;
  color: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.glass-select:focus { border-color: rgba(139,92,246,0.6); }
.glass-select option { background: #1e1b4b; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  transition: all 0.3s ease;
}
.upload-zone:hover {
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.05);
}

/* ── PIN Keypad ──────────────────────────────────────────── */
.pin-key-num {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.pin-key-num:hover {
  background: rgba(139,92,246,0.3);
  border-color: rgba(139,92,246,0.5);
  transform: scale(1.08);
}
.pin-key-num:active { transform: scale(0.95); }

.pin-key-del {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  transition: all 0.15s ease;
}
.pin-key-del:hover {
  background: rgba(239,68,68,0.3);
  transform: scale(1.05);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}

.expense-card {
  animation: fadeInUp 0.4s ease both;
}
.expense-card:nth-child(1)  { animation-delay: .05s; }
.expense-card:nth-child(2)  { animation-delay: .10s; }
.expense-card:nth-child(3)  { animation-delay: .15s; }
.expense-card:nth-child(4)  { animation-delay: .20s; }
.expense-card:nth-child(5)  { animation-delay: .25s; }
.expense-card:nth-child(6)  { animation-delay: .30s; }
.expense-card:nth-child(7)  { animation-delay: .35s; }
.expense-card:nth-child(8)  { animation-delay: .40s; }

.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

/* line-clamp utility */
.line-clamp-1 { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.7); }
