/* ===================================================================
   KEVIN LUXE LEDGER - BESPOKE ULTRA-PREMIUM LUXURY STYLESHEET
   Obsidian & Champagne Gold Aesthetic with Frosted Glassmorphism
   =================================================================== */

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

:root {
  color-scheme: dark;
  --bg-deep: #07090e;
  --bg-surface: #0e131f;
  --bg-surface-glass: rgba(14, 19, 31, 0.75);
  --bg-card: rgba(18, 24, 38, 0.65);
  --bg-card-hover: rgba(26, 35, 54, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(229, 192, 123, 0.35);
  
  --gold-primary: #e5c07b;
  --gold-glow: rgba(229, 192, 123, 0.2);
  --gold-gradient: linear-gradient(135deg, #f3d79b 0%, #d4af37 100%);
  
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --emerald-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
  
  --rose-primary: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.2);
  --rose-gradient: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  
  --violet-primary: #a855f7;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
}

* {
  box-sizing: border-box;
}

html, body {
  color-scheme: dark;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(229, 192, 123, 0.035) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(16, 185, 129, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.025) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ===================================================================
   CRISP HIGH-CONTRAST DROPDOWNS & FORM INPUTS
   =================================================================== */
select,
input,
textarea,
button {
  color-scheme: dark !important;
}

select {
  background-color: #0e1424 !important;
  color: #f3f4f6 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23e5c07b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1rem 1rem !important;
  padding-right: 2.25rem !important;
}

/* Force dark luxury background & crisp white text on native dropdown popups */
select option,
select optgroup {
  background-color: #0b0f19 !important;
  color: #f3f4f6 !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  border: none !important;
}

select option:checked,
select option:hover,
select option:focus,
select option:active {
  background-color: #1a253a !important;
  color: #f3d79b !important;
}

input,
textarea {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: #f3f4f6 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #e5c07b !important;
  box-shadow: 0 0 0 2px rgba(229, 192, 123, 0.25) !important;
  outline: none !important;
}

/* Custom Luxury Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 9, 14, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(229, 192, 123, 0.4);
}

/* Glassmorphic Utilities */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.glass-panel-gold {
  background: linear-gradient(145deg, rgba(229, 192, 123, 0.07) 0%, rgba(18, 24, 38, 0.7) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(229, 192, 123, 0.2);
  border-radius: 16px;
}

.gold-text-gradient {
  background: linear-gradient(135deg, #fff2cc 0%, #e5c07b 50%, #c49a45 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-btn {
  background: linear-gradient(135deg, #f3d79b 0%, #d4af37 100%);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.gold-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.4);
}

.emerald-btn {
  background: var(--emerald-gradient);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 18px var(--emerald-glow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.emerald-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
}

.rose-btn {
  background: var(--rose-gradient);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 18px var(--rose-glow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.rose-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.35);
}

/* Nav Item States */
.nav-item {
  transition: all 0.2s ease;
  color: #9ca3af;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: #e5c07b;
  background: linear-gradient(90deg, rgba(229, 192, 123, 0.12) 0%, rgba(229, 192, 123, 0.02) 100%);
  border-left: 3px solid #e5c07b;
  font-weight: 600;
}

/* Calendar Grid Styles */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 8px;
}

.calendar-day-cell {
  min-height: 105px;
  background: rgba(18, 24, 38, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-day-cell:hover {
  background: rgba(26, 35, 54, 0.85);
  border-color: rgba(229, 192, 123, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.calendar-day-cell.other-month {
  opacity: 0.4;
  cursor: pointer;
  background: rgba(14, 18, 28, 0.25);
}
.calendar-day-cell.other-month:hover {
  opacity: 0.9;
  border-color: rgba(229, 192, 123, 0.25);
  transform: translateY(-1px);
}

.calendar-day-cell.is-today {
  border: 1px solid #e5c07b;
  background: linear-gradient(145deg, rgba(229, 192, 123, 0.1) 0%, rgba(18, 24, 38, 0.7) 100%);
  box-shadow: 0 0 15px rgba(229, 192, 123, 0.15);
}

.calendar-day-cell.has-events {
  border-color: rgba(255, 255, 255, 0.18);
}

.cal-day-num {
  font-size: 0.875rem;
  font-weight: 700;
  color: #d1d5db;
}
.calendar-day-cell.is-today .cal-day-num {
  color: #e5c07b;
}

.cal-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-badge-income {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.cal-badge-expense {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Modal Animations */
.modal-overlay {
  transition: opacity 0.25s ease;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(0.95) translateY(10px);
  opacity: 0;
}
.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Custom Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #0f1523;
  border: 1px solid var(--border-subtle);
  color: #f3f4f6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}
.toast.toast-error {
  border-color: rgba(244, 63, 94, 0.4);
}
.toast.toast-info {
  border-color: rgba(229, 192, 123, 0.4);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Number / Currency Styling */
.mono-num {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

/* Custom Table Design */
.luxe-table th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.luxe-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
}
.luxe-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .calendar-day-cell {
    min-height: 80px;
    padding: 4px;
  }
  .cal-day-num {
    font-size: 0.75rem;
  }
  .cal-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
}

/* Multi-Payment Card Styling */
.payment-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  animation: cardFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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