/* ===================================
   West Valley Bank - Custom Styles
   Modern, Elegant Banking Interface
   =================================== */

/* Root Variables - Professional Banking Color Palette */
:root {
  /* Primary Brand Colors */
  --primary-blue: #0f4c81;
  --primary-blue-light: #1e6bb8;
  --primary-blue-dark: #0a3a61;

  /* Accent Colors */
  --accent-gold: #d4af37;
  --accent-gold-light: #f0d98e;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  /* Neutral Palette */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0f4c81 0%, #1e6bb8 100%);
  --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f0d98e 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-glass: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(15, 76, 129, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing Scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

/* Global Enhancements */
* {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-blue-light);
  border-radius: 4px;
  transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

/* Glassmorphism Card */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  border-radius: 16px;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

/* Premium Card Styles */
.premium-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

.premium-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.premium-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.premium-card:hover::before {
  opacity: 1;
}

/* Balance Card with Gradient */
.balance-card {
  background: var(--gradient-primary);
  border-radius: 20px;
  padding: 2rem;
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.balance-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.balance-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Gold Accent Card */
.gold-card {
  background: var(--gradient-gold);
  border-radius: 20px;
  padding: 2rem;
  color: var(--neutral-900);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.gold-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.gold-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(212, 175, 55, 0.4);
}

/* Button Styles */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left var(--transition-slow);
}

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

.btn-primary:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: white;
  color: var(--primary-blue);
  padding: 0.75rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 2px solid var(--primary-blue-light);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--neutral-50);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Input Styles */
.input-modern {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  border: 2px solid var(--neutral-200);
  background: var(--neutral-50);
  transition: all var(--transition-base);
  font-size: 0.95rem;
}

.input-modern:focus {
  outline: none;
  border-color: var(--primary-blue-light);
  background: white;
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.1);
}

.input-modern::placeholder {
  color: var(--neutral-300);
}

/* Sidebar Enhancements */
.sidebar-nav {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right: 1px solid var(--neutral-200);
}

.sidebar-item {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  transition: all var(--transition-base);
  color: var(--neutral-700);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.sidebar-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.sidebar-item:hover {
  background: var(--neutral-100);
  color: var(--primary-blue);
  transform: translateX(4px);
}

.sidebar-item.active {
  background: linear-gradient(
    90deg,
    rgba(15, 76, 129, 0.1) 0%,
    transparent 100%
  );
  color: var(--primary-blue);
  font-weight: 600;
}

.sidebar-item.active::before {
  transform: scaleY(1);
}

/* Transaction Row */
.transaction-row {
  padding: 1rem;
  border-radius: 12px;
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.transaction-row:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-200);
  transform: translateX(4px);
}

/* Status Badges */
.badge {
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: white;
}

.badge-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: white;
}

.badge-failed {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  color: white;
}

.badge-info {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
}

/* Loading Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--neutral-200);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Pulse Animation */
.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(15, 76, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(15, 76, 129, 0.5);
  }
}

/* Fade In Animation */
.fade-in {
  animation: fadeIn var(--transition-base) ease-in;
}

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

/* Slide In Animation */
.slide-in {
  animation: slideIn var(--transition-slow) ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Divider with Gradient */
.divider-gradient {
  height: 2px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 2px;
}

/* Modal Overlay */
.modal-overlay {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Table Styles */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table-modern thead th {
  background: var(--neutral-100);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--neutral-700);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-modern tbody tr {
  background: white;
  transition: all var(--transition-base);
}

.table-modern tbody tr:hover {
  background: var(--neutral-50);
  box-shadow: var(--shadow-md);
  transform: scale(1.01);
}

.table-modern tbody td {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--neutral-200);
  border-bottom: 1px solid var(--neutral-200);
}

.table-modern tbody td:first-child {
  border-left: 1px solid var(--neutral-200);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.table-modern tbody td:last-child {
  border-right: 1px solid var(--neutral-200);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Stat Card */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border-left: 4px solid transparent;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.stat-card.stat-primary {
  border-left-color: var(--primary-blue);
}

.stat-card.stat-success {
  border-left-color: var(--accent-emerald);
}

.stat-card.stat-gold {
  border-left-color: var(--accent-gold);
}

/* Icon Container */
.icon-container {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition-base);
}

.icon-container.icon-primary {
  background: linear-gradient(
    135deg,
    rgba(15, 76, 129, 0.1) 0%,
    rgba(30, 107, 184, 0.1) 100%
  );
  color: var(--primary-blue);
}

.icon-container.icon-success {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(52, 211, 153, 0.1) 100%
  );
  color: var(--accent-emerald);
}

.icon-container.icon-gold {
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.1) 0%,
    rgba(240, 217, 142, 0.1) 100%
  );
  color: var(--accent-gold);
}

.icon-container:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Responsive Utilities */
@media (max-width: 768px) {
  /* Card Adjustments */
  .balance-card,
  .gold-card {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .premium-card {
    border-radius: 12px;
    margin: 0.5rem;
  }

  /* Sidebar Adjustments */
  .sidebar-item {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  /* Typography Adjustments */
  h1 {
    font-size: 1.75rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  /* Button Adjustments */
  .btn-primary,
  .btn-secondary {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    width: 100%;
    justify-content: center;
  }

  /* Input Adjustments */
  .input-modern {
    padding: 0.875rem 1rem;
    font-size: 1rem; /* Prevent zoom on iOS */
  }

  /* Icon Container */
  .icon-container {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  /* Stat Card */
  .stat-card {
    padding: 1.25rem;
  }

  /* Table Improvements */
  .table-modern {
    font-size: 0.875rem;
  }

  .table-modern thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
  }

  .table-modern tbody td {
    padding: 1rem 0.5rem;
  }

  /* Badge Adjustments */
  .badge {
    padding: 0.25rem 0.625rem;
    font-size: 0.625rem;
  }

  /* Improve Touch Targets */
  a,
  button {
    min-height: 44px;
    min-width: 44px;
  }

  /* Spacing Adjustments */
  .space-y-6 > * + * {
    margin-top: 1rem !important;
  }

  .space-y-4 > * + * {
    margin-top: 0.75rem !important;
  }

  /* Modal Adjustments */
  .glass-card {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }

  /* Form Adjustments */
  form {
    width: 100%;
  }

  /* Reduce Motion for Better Performance */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .premium-card {
    padding: 1.5rem;
  }

  .balance-card,
  .gold-card {
    padding: 1.75rem;
  }

  .icon-container {
    width: 44px;
    height: 44px;
  }
}

/* Large Screen Enhancements */
@media (min-width: 1440px) {
  .premium-card {
    padding: 2.5rem;
  }

  .balance-card,
  .gold-card {
    padding: 2.5rem;
  }

  .icon-container {
    width: 52px;
    height: 52px;
    font-size: 1.75rem;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .dark-mode {
    --neutral-50: #1e293b;
    --neutral-100: #334155;
    --neutral-200: #475569;
  }

  .dark-mode .premium-card {
    background: var(--neutral-800);
    color: var(--neutral-50);
  }

  .dark-mode .glass-card {
    background: rgba(30, 41, 59, 0.85);
  }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--neutral-200);
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1),
    0 -2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 40;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--neutral-700);
  transition: all var(--transition-base);
  border-radius: 12px;
  position: relative;
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  transition: all var(--transition-base);
}

.mobile-nav-item span {
  font-size: 0.625rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.mobile-nav-item.active {
  color: var(--primary-blue);
}

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

.mobile-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 0 0 3px 3px;
}

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

/* Hide footer on mobile when bottom nav is present */
@media (max-width: 768px) {
  .dashboard-footer {
    display: none;
  }

  /* Add padding to content to account for bottom nav */
  .main-content-mobile {
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
  }
}

/* Print Styles */
@media print {
  .sidebar-nav,
  .btn-primary,
  .btn-secondary,
  .mobile-bottom-nav {
    display: none;
  }

  .premium-card,
  .balance-card,
  .gold-card {
    box-shadow: none;
    border: 1px solid var(--neutral-300);
  }
}
