/* ============================================
   Joykek Gider Takip Dashboard — Custom Styles
   joyakademi.com referans: Dark Glassmorphism + Neon Glow
   ============================================ */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* --- Base Styles --- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) rgba(255, 255, 255, 0.02);
}

body {
  background: #050510;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Glass Card --- */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

.glass-card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-hover:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #818CF8 60%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-accent {
  background: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Neon Glow --- */
.neon-glow {
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.15),
    0 0 40px rgba(99, 102, 241, 0.05),
    0 0 80px rgba(99, 102, 241, 0.02);
}

.neon-glow-strong {
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.25),
    0 0 40px rgba(99, 102, 241, 0.15),
    0 0 80px rgba(99, 102, 241, 0.05);
}

/* --- Button Gradient --- */
.btn-gradient {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: white;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn-gradient:hover::before {
  left: 100%;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #818CF8, #6366F1);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-gradient:active {
  transform: translateY(0);
}

/* --- Button Ghost --- */
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Input Styles --- */
.input-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.input-glass:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.07);
}

/* --- Animations --- */

/* Shake — login error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}
.shake {
  animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

/* Float — background orbs */
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
.animate-float {
  animation: float 20s ease-in-out infinite;
}
.animate-float-delayed {
  animation: float 25s ease-in-out infinite;
  animation-delay: -7s;
}
.animate-float-slow {
  animation: float 30s ease-in-out infinite;
  animation-delay: -12s;
}

/* Fade In — elements appearing */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
}
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }
.fade-in-delay-5 { animation-delay: 0.5s; opacity: 0; }

/* Pulse Glow — logo */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6), 0 0 80px rgba(99, 102, 241, 0.2); }
}
.pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Spin — loading */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spin 3s linear infinite;
}

/* Scale In — modal */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide In — notification */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}
.slide-out-right {
  animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Count Up — numbers */
@keyframes countFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-up {
  animation: countFade 0.5s ease-out;
}

/* --- Modal Backdrop --- */
.modal-backdrop {
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* --- Table --- */
.expense-table th {
  background: rgba(255, 255, 255, 0.02);
  color: #94A3B8;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expense-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}

.expense-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* --- Logo Ring --- */
.logo-ring {
  position: relative;
}

.logo-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #06B6D4, #6366F1);
  z-index: -1;
  animation: spin 6s linear infinite;
}

.logo-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #06B6D4, #6366F1);
  z-index: -2;
  filter: blur(12px);
  opacity: 0.5;
  animation: spin 6s linear infinite reverse;
}

/* --- Progress Bar --- */
.progress-bar-bg {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Category / Payer / Currency Badge --- */
.category-badge,
.payer-badge,
.ccy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.payer-badge.payer-joykek {
  background: rgba(99, 102, 241, 0.12);
  color: #818CF8;
}

.payer-badge.payer-client {
  background: rgba(244, 114, 182, 0.12);
  color: #F472B6;
}

.ccy-badge {
  background: rgba(34, 211, 238, 0.10);
  color: #22D3EE;
  font-family: 'Inter', monospace;
  font-weight: 600;
  font-size: 0.7rem;
}

/* --- Toggle Active States --- */
.ccy-btn.active,
.view-btn.active,
.chip-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.15));
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4) !important;
}

/* --- v1.3 Filter helpers (Tailwind hidden + flex çakışması) --- */
#customRangePanel.is-visible,
#clientFilterRow.is-visible {
  display: flex;
}

/* --- Date input dark mode tweaks --- */
.input-glass[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}
.input-glass[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) opacity(0.8);
}

/* --- Header Blur --- */
.header-blur {
  background: rgba(5, 5, 16, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .glass-card {
    border-radius: 0.75rem;
  }

  .expense-table {
    font-size: 0.875rem;
  }
}

/* --- Selection Color --- */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: white;
}

/* --- Focus Visible (Accessibility) --- */
:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}
