/* KasbonTracker Custom Styles & Responsive Utilities */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

/* iOS Safe Area */
.safe-top {
  padding-top: env(safe-area-inset-top, 0px);
}
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Bottom Nav bar spacer so content isn't covered.
   Pakai !important + selector lebih spesifik karena Tailwind CDN menyuntik
   <style> setelah file ini, sehingga utility `py-4` pada <main> sebelumnya
   menimpa padding-bottom dan konten terakhir tertutup navbar. */
main.pb-bottom-nav {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

/* Smooth modal transition */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.modal-backdrop.active .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Tab Switching animation */
.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}
.tab-content.active {
  display: block;
}

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

/* Card hover animation */
.kasbon-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kasbon-card:active {
  transform: scale(0.985);
}

/* Smart parser pill tags */
.preset-chip {
  transition: all 0.15s ease;
}
.preset-chip:active {
  transform: scale(0.92);
}

/* Podium Leaderboard Styling */
.podium-pillar {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.podium-first {
  min-height: 100px;
}
.podium-second {
  min-height: 75px;
}
.podium-third {
  min-height: 55px;
}

/* Toast Notification */
#toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}
.toast.toast-hide {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

/* Print styling for printing weekly summary */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .no-print,
  #bottom-nav,
  #app-header,
  .btn-action,
  #toast-container {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .kasbon-card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    break-inside: avoid;
  }
}

