.countdown-timer {
  font-size: 1.25rem;
  font-weight: bold;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* Spinner container centers everything */
.custom-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

/* Rotating ring */
.spinner-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  border: 4px solid transparent;
  border-top-color: #fff; /* Brighter accent color */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Icon centered over ring */
.spinner-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Fade transitions */
#loadingSpinner {
  opacity: 1;
  transition: opacity 0.4s ease;
}

#dashboardContent {
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Admin Dashboard Container */
.admin-dashboard {
  background: #111;
  color: #eee;
  padding: 1.5em;
  border-radius: 0.5em;
  margin-top: 2em;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  animation: fadeIn 0.6s ease;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity:0; transform: translateY(10px); }
  to { opacity:1; transform: translateY(0); }
}

.admin-dashboard h2, .admin-dashboard h3 {
  text-align: center;
  margin-bottom: 1em;
}

/* Metric cards grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1em;
  margin-bottom: 1.5em;
}

.metric-card {
  background: #222;
  padding: 1em;
  border-radius: 0.4em;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 10px rgba(0,255,204,0.3);
}
.metric-value {
  font-size: 1.6em;
  font-weight: bold;
  color: #00ffcc;
}
.metric-label {
  font-size: 0.9em;
  color: #aaa;
}

/* Referrer list styling */
.referrer-list {
  list-style: none;
  padding: 0;
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
}
.referrer-list li {
  padding: 0.4em 0;
  border-bottom: 1px solid #333;
  transition: background 0.2s ease;
}
.referrer-list li:last-child {
  border-bottom: none;
}
.referrer-list li:hover {
  background: rgba(255,255,255,0.05);
}

.timeframe-toggle {
  text-align: center;
  margin-bottom: 1em;
}
.timeframe-btn {
  background: #222;
  color: #eee;
  border: 1px solid #333;
  padding: 0.4em 1em;
  margin: 0.2em 0.2em 0.2em 0.2em;
  border-radius: 0.3em;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s ease, border 0.2s ease;
}
.timeframe-btn:hover {
  background: #333;
}
.timeframe-btn.active {
  background: #00ffcc;
  color: #000;
  border-color: #00ffcc;
}

/* Custom Date Picker Styling */
.custom-date-picker input[type="date"] {
  background: #222;
  color: #eee;
  border: 1px solid #333;
  padding: 0.4em;
  border-radius: 0.3em;
  margin: 0 0.2em;
  font-size: 0.9em;
}

.custom-date-picker input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.custom-date-picker button {
  background: #222;
  color: #eee;
  border: 1px solid #333;
  padding: 0.4em 1em;
  margin-left: 0.5em;
  border-radius: 0.3em;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s ease, border 0.2s ease;
}

.custom-date-picker button:hover {
  background: #333;
}

.custom-date-picker button:active {
  background: #00ffcc;
  color: #000;
  border-color: #00ffcc;
}

.metrics-grid-2col {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0 auto;
  max-width: 1200px;
  margin-bottom: 2em;
}

/* Mobile breakpoint: stack to 1 column */
@media (max-width: 768px) {
  .metrics-grid-2col {
    grid-template-columns: 1fr;
  }
}


.charts-grid {
  display: block; /* Use single column so one big chart spans full width */
}

.charts-grid canvas {
  width: 100% !important;
  max-width: 1000px;
  margin: 0 auto;
  display: block;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.leaderboard-table th {
  padding: 8px 12px;
  text-align: left;
  background: #1a1a1a; /* dark header background */
  color: #ccc;
}

.leaderboard-row td {
  padding: 10px 12px;
  background: #000; /* keep row background black */
  border-top: 1px solid #333;
  color: #eee;
}

.leaderboard-row.gold {
  border-left: 4px solid #ffd700;
}

.leaderboard-row.silver {
  border-left: 4px solid #c0c0c0;
}

.leaderboard-row.bronze {
  border-left: 4px solid #cd7f32;
}

.rank-icon {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.leaderboard-row.your-rank {
  border-top: 2px solid #555;
  background: #0d0d0d; /* slightly lighter for contrast */
  font-weight: bold;
}




#rewards h3 {
  margin-bottom: 0.8em;
}

.rewards-list {
  list-style: disc;
  list-style-position: inside;
  padding: 0;
  margin: 0;
}

.rewards-list li {
  margin: 0.5em 0;
  line-height: 1.35;
}

.rewards-list li strong {
  font-weight: 600;
}

.rewards-list li.locked .lock-name {
  opacity: 0.4;
  text-decoration: line-through;
}

.rewards-list .lock-hint {
  font-size: 0.85em;
  color: #aaa;
  opacity: 0.4;
  margin-left: 1.6em;
  display: block;
  line-height: 1.2;
}

.bonus-note {
  color: #00ff99;
  font-size: 0.9em;
  font-weight: normal;
  margin-left: 0.3em;
}

.rewards-list li.new-unlock {
  animation: fadeSlideIn 0.8s ease;
}

.dashboard-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.dashboard-card + .dashboard-card {
  margin-top: 2em;
}

@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

