@tailwind base;
@tailwind components;
@tailwind utilities;

/* ---- CSS Variables ---- */
:root {
  --gold: #F5C542;
  --gold-dark: #D4A017;
  --gold-light: #FFF8DC;
  --sidebar-w: 248px;
  --header-h: 60px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #BDBDBD; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9E9E9E; }

/* ---- Focus ring ---- */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Smooth transitions ---- */
a, button { transition: all 0.18s ease; }

/* ---- Card hover effect ---- */
.card-hover {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

/* ---- Progress bar fill ---- */
.progress-fill {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Drag and drop ---- */
.dragging {
  opacity: 0.5;
  cursor: grabbing !important;
}
.drag-over {
  background: #FFF8DC !important;
  border: 2px dashed var(--gold) !important;
}

/* ---- Tag / Badge ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---- Connector line ---- */
.connector {
  width: 2px;
  margin-left: 28px;
  background: linear-gradient(to bottom, #E0E0E0, var(--gold));
  position: relative;
}
.connector::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: -4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
}

/* ---- Modal ---- */
.modal-overlay {
  animation: fadeOverlay 0.2s ease forwards;
}
@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-content {
  animation: slideModal 0.25s ease forwards;
}
@keyframes slideModal {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- Toast ---- */
.toast-enter {
  animation: toastIn 0.3s ease forwards;
}
.toast-leave {
  animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ---- Sidebar animation ---- */
.sidebar-transition {
  transition: width 0.3s ease, transform 0.3s ease;
}

/* ---- Chart bars ---- */
.bar-animate {
  animation: barGrow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: bottom;
}
@keyframes barGrow {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* ---- Input focus gold ---- */
input:focus, textarea:focus, select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.18) !important;
  outline: none;
}

/* ---- Stagger children ---- */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

@layer utilities {
  .text-balance { text-wrap: balance; }
  .scrollbar-thin { scrollbar-width: thin; }
}
