/* Use Poppins throughout */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  /* Prevent horizontal scrollbar caused by potential animation overflows */
  overflow-x: hidden;
}

/* Sidebar styling */
.custom-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background-color: #ffffff; /* White or a very light shade */
  border-right: 1px solid #eaeaea;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  overflow-y: auto;
  z-index: 1030; /* Ensure sidebar is above most content */
}

.brand-logo {
  width: 180px; /* Increased from 60px to better fill sidebar width */
  max-height: 60px;
  max-width: 180px;
  height: auto; /* Allow height to adjust based on aspect ratio */
  width: auto; /* allow width to adjust based on aspect ratio */
  margin: 0 auto; /* Center the logo */
}

.login-brand-logo {
  width: 80%; /* Increased from 60px to better fill sidebar width */
  max-height: 150px;
  max-width: 300px;
  height: auto; /* Allow height to adjust based on aspect ratio */
  width: auto; /* allow width to adjust based on aspect ratio */
  margin: 0 auto; /* Center the logo */
}

.brand-name {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

.nav-link {
  color: #555;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
  font-size: 0.85rem;
}

/* Icon container behind each icon (bold circles) */
.icon-container {
  width: 56px;
  height: 56px;
  border-radius: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bold background classes for icons */
.bg-cyan {
  background-color: #2BB8E6; /* lighter bright blue */
}
.bg-pink {
  background-color: #FF6B6B; /* softer red */
}
.bg-yellow {
  background-color: #FFD93D; /* bright yellow */
}
.bg-blue {
  background-color: #4A90E2; /* royal blue */
}
.bg-orange {
  background-color: #FF9F43; /* warm orange */
}
.bg-green {
  background-color: #2ECC71; /* bright green */
}
.bg-purple {
  background-color: #6C5CE7; /* vibrant purple */
}
.bg-gray {
  background-color: #95A5A6; /* neutral gray */
}

/* Icon itself inside container */
.icon {
  width: 32px;
  height: 32px;
}

/* On hover, highlight link and gently scale */
.nav-link:hover {
  background-color: #f0f2f5;
  transform: scale(1.02);
}

.nav-link.active {
  background-color: #e5e7eb; /* Subtle highlight for active link */
  color: #333;
  font-weight: 500;
}

/* Main content shifts to the right of sidebar */
.main-content {
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Fixed header styling */
.content-header {
  position: sticky;
  top: 0;
  z-index: 1020; /* Below sidebar but above content */
  background-color: #ffffff;
  border-bottom: 1px solid #eaeaea;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  text-transform: capitalize; /* Automatically capitalize view names */
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo-img {
  height: 40px;
  width: auto;
}

/* The container for the dynamic content area */
#page-content-wrapper {
  flex: 1;
  background-color: #f8f9fa; /* Match body background */
}

#mainContent {
    background-color: #ffffff; /* White background for the content itself */
    border-radius: 8px; /* Optional: rounded corners for content area */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Optional: subtle shadow */
    padding: 1.5rem; /* Internal padding for loaded content */
}


/* Footer pinned to bottom by flex arrangement */
.footer {
  background-color: #fff;
  border-top: 1px solid #eaeaea;
  margin-top: auto; /* Pushes footer down */
}

.footer-logo {
  height: 50px;
  width: auto;
}

/* Titles for sections (can be used within views) */
.section-title {
  font-weight: 600;
  color: #444;
  margin-bottom: 1.5rem; /* Consistent spacing */
}

/* Brand logo link styling */
.brand-logo-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
}

.brand-logo-link:hover {
  transform: scale(1.05);
}

.brand-logo-link:hover .brand-name {
  color: #0d6efd; /* Bootstrap primary blue on hover */
}

/* Global Helper for Tooltips (ensure they work after dynamic loading) */
.tooltip-container {
    cursor: pointer;
}

/* Ensure Bootstrap tooltips appear above other elements */
.tooltip {
    z-index: 1080 !important; /* Higher than header/sidebar */
}


/* --- Styles that were previously view-specific but might be needed globally --- */
/* Keep game card related styles global if they appear in multiple views,
   or move them specifically to `views/games/games.css` if only used there.
   For this example, let's assume they are only needed in the 'Games' view
   and move them there. */

/* Keep pastel cards global if used elsewhere (like maybe History or specific game stats)
   or move them to `views/dashboard/dashboard.css` if only used there.
   Let's assume they are only on the Dashboard for now. */

/* Chart placeholder might be reusable */
.chart-placeholder {
  background-color: #f9fafb;
  border-radius: 8px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed #ccc;
  text-align: center;
  padding: 1rem;
}
.chart-placeholder h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.chart-placeholder p {
    font-size: 0.9rem;
    color: #6c757d;
}

/* ── Generic section wrapper (formerly dashboard-only) ─────────── */
.dashboard-section {
  background-color: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dashboard-section h4 { font-weight: 600; color: #343a40; }

/* ── Pastel metric cards ───────────────────────────────────────── */
.pastel-card {
  border-radius: 12px;
  color: #fff;
  width: 100%;
  min-height: 140px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.pastel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.pastel-card h5   { font-size: .95rem; font-weight: 500; margin-bottom:.5rem; }
.pastel-card .metric-value { font-size: 2rem; font-weight: 600; line-height:1.2; }

.pastel-card-blue   { background:#2BB8E6; }
.pastel-card-pink   { background:#FF6B6B; }
.pastel-card-yellow { background:#FFD93D; color:#333; }
.pastel-card-cyan   { background:#4A90E2; }
.pastel-card-green  { background:#2ECC71; }
.pastel-card-purple { background:#6C5CE7; }
.pastel-card-orange { background:#FF9F43; }
.pastel-card-teal   { background:#00B894; }

/* ── Collapse-arrow rotation helper ────────────────────────────── */
.toggle-collapse-btn i { transition: transform .3s ease; }
.toggle-collapse-btn[aria-expanded="true"] i { transform: rotate(180deg); }

/* ---------- Global UI helpers (used by Super Admin & Settings) ---------- */
.btn-animate { transition: all 0.3s ease; }
.btn-animate:active { transform: scale(0.95); }
.btn-animate.loading {
  position: relative;
  pointer-events: none;
}
.btn-animate.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spinner 0.6s linear infinite;
}
@keyframes button-spinner { to { transform: rotate(360deg); } }

/* Shared tiny utility */
.tooltip-container { margin-left: 8px; display: inline-flex; cursor: help; }
.tooltip-container i { font-size: 0.9em; opacity: 0.8; }

/* Soft utility styles (chips, monospace, mini metrics) */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
}
.badge-soft {
  display: inline-block;
  border-radius: 999px;
  background: #f1f3f5;
  color: #495057;
  padding: .25rem .5rem;
}
.chips-row > .badge-soft { margin-right: .25rem; margin-bottom: .25rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.mini-metric { border: 1px solid #e9ecef; border-radius: 8px; padding: .75rem .9rem; background: #fff; }
.mini-metric .label { font-size: .8rem; }
.mini-metric .value { font-size: 1.25rem; font-weight: 600; }