/* ===== PORTFOLIO STATS WIDGET ===== */

/* Toggle Pill - Bottom Left */
.stats-toggle {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 9997;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(255, 159, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
}

.stats-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 159, 0, 0.5);
}

.stats-toggle i {
  font-size: 14px;
}

.stats-toggle .stats-toggle-count {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

/* Expanded Panel */
.stats-panel {
  position: fixed;
  bottom: 80px;
  left: 30px;
  z-index: 9997;
  background: #1a1a1a;
  border: 1px solid rgba(255, 159, 0, 0.2);
  border-radius: 16px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  animation: statsSlideUp 0.3s ease-out;
}

.stats-panel.open {
  display: block;
}

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

.stats-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stats-panel-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #ff9f00;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-panel-close {
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.stats-panel-close:hover {
  color: #ff9f00;
}

/* 2x2 Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s;
}

.stat-item:hover {
  border-color: rgba(255, 159, 0, 0.3);
}

.stat-item .stat-icon {
  font-size: 18px;
  color: #ff9f00;
  margin-bottom: 6px;
}

.stat-item .stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.stat-item .stat-label {
  display: block;
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ===== LIGHT MODE ===== */
body.light-mode .stats-panel {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

body.light-mode .stat-item {
  background: #f8f8f8;
  border-color: #eee;
}

body.light-mode .stat-item .stat-value {
  color: #222;
}

body.light-mode .stat-item .stat-label {
  color: #777;
}

body.light-mode .stats-panel-close {
  color: #aaa;
}

body.light-mode .stats-toggle .stats-toggle-count {
  background: rgba(255, 255, 255, 0.35);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .stats-toggle {
    bottom: 20px;
    left: 16px;
    padding: 8px 14px;
    font-size: 0.75rem;
  }

  .stats-panel {
    bottom: 70px;
    left: 16px;
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}
