/* -------------------------------------------------
   Les Nübs Dashboard Styles — v2.0.5 (Visual Revamp)
   ------------------------------------------------- */

/* ✅ Import font */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

body {
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

/* -----------------------------------------------
   🎨 Background
   ----------------------------------------------- */
.fade-bg {
  background: linear-gradient(135deg, #fffaf5, #eef2ff);
  min-height: 100vh;
}

/* -----------------------------------------------
   🧍 Character Select Animations
   ----------------------------------------------- */
@keyframes pulseSelect {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.08);
    filter: brightness(1.05);
  }
}

.character img {
  transition: all 0.25s ease;
}

.character:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.character.selected img {
  animation: pulseSelect 1.2s ease-in-out infinite;
}

/* --- Avatar fall-in effect --- */
.avatar-fall {
  transform: translateY(-100px);
  opacity: 0;
  animation: fallIn 0.8s ease forwards;
}

@keyframes fallIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* slight stagger delay for each avatar */
.avatar-fall:nth-child(1) { animation-delay: 0.1s; }
.avatar-fall:nth-child(2) { animation-delay: 0.2s; }
.avatar-fall:nth-child(3) { animation-delay: 0.3s; }
.avatar-fall:nth-child(4) { animation-delay: 0.4s; }
.avatar-fall:nth-child(5) { animation-delay: 0.5s; }
.avatar-fall:nth-child(6) { animation-delay: 0.6s; }

/* -----------------------------------------------
   ⚡ Loading and Fade Transitions
   ----------------------------------------------- */
#loading-screen.fade-out {
  animation: fadeOut 0.7s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.fade-section {
  transition: opacity 0.4s ease, max-height 0.4s ease;
}

/* -----------------------------------------------
   📊 Collapsible / Retractable UI
   ----------------------------------------------- */
.collapsible {
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.collapsible.closed {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0;
}

.retractable-box {
  background-color: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.retractable-box.closed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
}

.retractable-box.open {
  opacity: 1;
  max-height: none;
}

.retractable-header {
  font-weight: 600;
  color: #f97316;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.retractable-icon {
  transition: transform 0.3s ease;
}

/* -----------------------------------------------
   💡 Tooltip
   ----------------------------------------------- */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: default;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: max-content;
  max-width: 220px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* -----------------------------------------------
   🔍 Focus Tips
   ----------------------------------------------- */
.focus-tip {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.focus-tip:hover {
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}

.focus-tip strong {
  color: #f97316;
}

/* ==================================================
   🆕 DASHBOARD LAYOUT ENHANCEMENTS
   ================================================== */

/* 🌄 Unified Card Layout */
.dashboard-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.6s ease forwards;
}

.dashboard-card:hover {
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}

/* ✨ Smooth Fade / Slide-in */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🧡 Section Wrappers (Orange-Tinted Backgrounds) */
.section-wrapper {
  background-color: #fff7ed;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.08);
}

/* 🕒 Trend Header Styling */
.trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.trend-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f97316;
}

/* 🔸 Soft Fade-in Timing Utility */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

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

/* Small delay utilities for staggered fade-ins */
.fade-in.delay-1 { animation-delay: 0.2s; }
.fade-in.delay-2 { animation-delay: 0.4s; }
.fade-in.delay-3 { animation-delay: 0.6s; }

/* 🧩 Section Spacing */
.section-spacing > * + * {
  margin-top: 2rem;
}

/* 🧱 Table Styling */
.table-clean {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}

.table-clean th {
  text-align: left;
  padding: 0.5rem;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.table-clean td {
  padding: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.table-clean tr:hover td {
  background: #f9fafb;
}

/* 🧭 Responsive Improvements */
@media (max-width: 640px) {
  .dashboard-card {
    padding: 1rem;
  }
  .trend-header h2 {
    font-size: 1.1rem;
  }
}

/* ==================================================
   📊 Split Snapshots — 3 Equal Cards
   ================================================== */

#splits {
  margin-top: 2rem;
}

/* Keep Split section consistent with other big cards */
#splits .dashboard-card {
  max-width: 1200px;
  margin: 0 auto;
}

/* Make three split cards equal height in the grid */
#splits .grid {
  align-items: stretch;
}

/* Each split card fills its cell */
#splits .split-card {
  height: 100%;
}

/* Hover effect inside splits (reuse dashboard-card vibe lightly) */
#splits .split-card:hover {
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}
