/* =========================================================
   Apple Liquid Glass Design System - FinanZen
   ========================================================= */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-scaleIn {
  animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom modern scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* =========================================================
   SIDEBAR AMBIENT LIGHTING & GLASS FOUNDATION
   ========================================================= */
.sidebar-liquid-glass {
  background: linear-gradient(180deg, #090d16 0%, #0f172a 50%, #090d16 100%);
  position: relative;
  overflow: hidden;
}

/* Ambient colored aura glows behind glass items */
.sidebar-liquid-glass::before {
  content: '';
  position: absolute;
  top: 15%;
  left: -20%;
  width: 140%;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(139, 92, 246, 0.12) 50%, transparent 75%);
  pointer-events: none;
  filter: blur(50px);
}

.sidebar-liquid-glass::after {
  content: '';
  position: absolute;
  bottom: 12%;
  right: -20%;
  width: 130%;
  height: 260px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 75%);
  pointer-events: none;
  filter: blur(45px);
}

/* Glass Logo Pill & Glass Avatar Box */
.glass-panel-dark {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3), inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
}

/* =========================================================
   APPLE LIQUID GLASS MENU BUTTONS (SIDEBAR)
   ========================================================= */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  overflow: hidden;

  /* Frosted Glass Surface */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  
  box-shadow: 
    0 4px 15px -3px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2);

  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

/* Specular Light Sheen Reflection on hover */
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.08) 45%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.08) 55%, 
    transparent 100%
  );
  transform: skewX(-25deg);
  transition: all 0.75s ease;
  pointer-events: none;
}

/* Hover Liquid Glass state */
.nav-item:hover {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1.5px);
  box-shadow: 
    0 8px 24px -4px rgba(0, 0, 0, 0.35),
    0 2px 8px -1px rgba(99, 102, 241, 0.2),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.3);
}

.nav-item:hover::before {
  left: 120%;
}

.nav-item:active {
  transform: scale(0.97) translateY(0);
}

/* Active Apple VisionOS / macOS Liquid Glass state */
.nav-item.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55) 0%, rgba(79, 70, 229, 0.32) 100%) !important;
  border-color: rgba(165, 180, 252, 0.38) !important;
  border-top-color: rgba(255, 255, 255, 0.65) !important;
  border-bottom-color: rgba(79, 70, 229, 0.4) !important;
  
  box-shadow: 
    0 8px 24px -2px rgba(79, 70, 229, 0.5),
    0 2px 8px 0 rgba(99, 102, 241, 0.35),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.25) !important;
}

.nav-item.active i {
  color: #c7d2fe;
  filter: drop-shadow(0 0 8px rgba(165, 180, 252, 0.6));
}

/* =========================================================
   APPLE LIQUID GLASS FILTER BUTTONS (LIGHT THEME)
   ========================================================= */
.filter-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  
  /* Frosted Glass Light */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(241, 245, 249, 0.65) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 4px 14px -2px rgba(0, 0, 0, 0.04),
    inset 0 1px 1.5px 0 #ffffff;
  
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn:hover {
  color: #0f172a;
  background: linear-gradient(135deg, #ffffff 0%, rgba(248, 250, 252, 0.9) 100%);
  border-color: #cbd5e1;
  border-top-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 
    0 6px 18px -2px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px 0 #ffffff;
}

.filter-btn:active {
  transform: scale(0.97);
}

/* Active Filter Pill */
.filter-btn.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(79, 70, 229, 0.9) 100%) !important;
  border-color: rgba(165, 180, 252, 0.5) !important;
  border-top-color: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 
    0 6px 20px -2px rgba(99, 102, 241, 0.42),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.65) !important;
}

/* =========================================================
   APPLE LIQUID GLASS PRIMARY ACTION BUTTON (+ NOVA TRANSAÇÃO)
   ========================================================= */
.liquid-glass-btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.92) 0%, rgba(79, 70, 229, 0.82) 100%);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid rgba(165, 180, 252, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 
    0 8px 24px -4px rgba(79, 70, 229, 0.45),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.liquid-glass-btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  pointer-events: none;
}

.liquid-glass-btn-primary:hover::before {
  left: 120%;
}

.liquid-glass-btn-primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(79, 70, 229, 0.96) 100%);
  border-top-color: #ffffff;
  transform: translateY(-1.5px) scale(1.01);
  box-shadow: 
    0 12px 28px -4px rgba(79, 70, 229, 0.55),
    0 4px 12px 0 rgba(99, 102, 241, 0.35),
    inset 0 1px 2px 0 #ffffff;
}

.liquid-glass-btn-primary:active {
  transform: scale(0.97) translateY(0);
}

/* =========================================================
   TRANSACTION TYPE SELECTORS (MODAL LIQUID GLASS)
   ========================================================= */
.type-selector {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.type-selector.active-despesa {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(225, 29, 72, 0.08) 100%) !important;
  color: #e11d48 !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 
    0 4px 12px -2px rgba(225, 29, 72, 0.25),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.type-selector.active-receita {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.08) 100%) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 
    0 4px 12px -2px rgba(5, 150, 105, 0.25),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.8) !important;
}


/* =========================================================
   APPLE LIQUID GLASS SECONDARY BUTTONS (CSV & NOVA CATEGORIA)
   ========================================================= */
.liquid-glass-btn-secondary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.75) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 4px 14px -2px rgba(0, 0, 0, 0.05),
    inset 0 1px 1.5px 0 #ffffff;
  
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.liquid-glass-btn-secondary:hover {
  color: #0f172a;
  background: linear-gradient(135deg, #ffffff 0%, rgba(248, 250, 252, 0.95) 100%);
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 
    0 6px 18px -2px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px 0 #ffffff;
}

.liquid-glass-btn-secondary:active {
  transform: scale(0.97);
}

/* Glass Select (Month/Year Picker) */
.liquid-glass-select {
  appearance: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.75) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 4px 14px -2px rgba(0, 0, 0, 0.04),
    inset 0 1px 1.5px 0 #ffffff;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.55rem 2.25rem 0.55rem 0.95rem;
  border-radius: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.liquid-glass-select:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* CSV Drag and Drop Zone */
.csv-drop-zone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.csv-drop-zone:hover, .csv-drop-zone.dragover {
  border-color: #6366f1;
  background: #eef2ff;
}

/* Category icon button selector */
.icon-option {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-option:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: #f5f3ff;
}

.icon-option.selected {
  border-color: #6366f1;
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}


/* =========================================================
   FLOATING BATCH ACTION TOOLBAR & CHECKBOXES
   ========================================================= */
.floating-batch-bar {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.custom-checkbox {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.375rem;
  background-color: #ffffff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-checkbox:hover {
  border-color: #6366f1;
}

.custom-checkbox:checked {
  background-color: #4f46e5;
  border-color: #4f46e5;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.custom-checkbox:checked::before {
  content: "";
  width: 0.55rem;
  height: 0.3rem;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}


/* =========================================================
   APPLE LIQUID GLASS MOBILE BOTTOM NAVIGATION BAR
   ========================================================= */
.mobile-bottom-bar {
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.mobile-nav-item {
  color: #94a3b8;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item.active {
  color: #ffffff !important;
}

.mobile-nav-item.active i {
  color: #818cf8;
  filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.8));
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  width: 1.25rem;
  height: 3px;
  background: #6366f1;
  border-radius: 9999px;
  box-shadow: 0 0 10px #6366f1;
}

/* Touch targets optimization */
@media (max-width: 768px) {
  button, input, select {
    touch-action: manipulation;
  }
}


/* iOS Safari font zoom fix for inputs */
@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="password"],
  input[type="email"],
  select {
    font-size: 16px !important;
  }
}

/* =========================================================
   APPLE LIQUID GLASS AUTHENTICATION / LOGIN SCREEN
   ========================================================= */
.auth-ambient-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.45;
  transition: all 1s ease;
}

.auth-glow-1 {
  width: 450px;
  height: 450px;
  top: -80px;
  left: -80px;
  background: radial-gradient(circle, #6366f1 0%, #4338ca 60%, transparent 80%);
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.auth-glow-2 {
  width: 500px;
  height: 500px;
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, #06b6d4 0%, #3b82f6 50%, transparent 80%);
  animation: floatOrb 15s ease-in-out infinite alternate-reverse;
}

.auth-glow-3 {
  width: 350px;
  height: 350px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #8b5cf6 0%, transparent 75%);
  opacity: 0.3;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.08); }
  100% { transform: translate(-20px, 30px) scale(0.95); }
}

.auth-card {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(28px) saturate(210%);
  -webkit-backdrop-filter: blur(28px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(99, 102, 241, 0.15),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-tab-btn {
  color: #94a3b8;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab-btn:hover {
  color: #e2e8f0;
}

.auth-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(79, 70, 229, 0.25) 100%);
  border: 1px solid rgba(165, 180, 252, 0.4);
  box-shadow: 
    0 4px 15px rgba(99, 102, 241, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: #818cf8;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.auth-input::placeholder {
  color: #64748b;
}

