/* ========================================
   EcoSmartPlay - Components
   Glass, Cards, Badges, Buttons, etc.
   ======================================== */

/* Glassmorphism */
.glass {
  background: rgba(16, 185, 129, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 1rem;
}

.glass-strong {
  background: rgba(16, 185, 129, 0.1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.glass-accent {
  background: rgba(245, 158, 11, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: 1rem;
}

/* Eco Gradient Backgrounds */
.bg-eco-gradient {
  background: linear-gradient(135deg, #0a1a14 0%, #0d1f2d 50%, #0a1a14 100%);
}

.bg-eco-gradient-card {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.08) 0%,
    rgba(20, 184, 166, 0.04) 100%
  );
}

/* Cards */
.eco-card {
  background: rgba(16, 185, 129, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 1rem;
  padding: 1.25rem;
}

.eco-card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.eco-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Stat Card */
.stat-card {
  background: rgba(16, 185, 129, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
}

.stat-card .stat-icon {
  padding: 0.625rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-outline {
  border: 1px solid var(--border);
  background: transparent;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 0;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 0;
}

.badge-teal {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
  border: 0;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  outline: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #14b8a6);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-outline {
  background: rgba(16, 185, 129, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.12);
  color: var(--foreground);
}

.btn-outline:hover {
  background: rgba(16, 185, 129, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to left, #10b981, #14b8a6);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-weight: 700;
}

.avatar-sm { width: 2.25rem; height: 2.25rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 5rem; height: 5rem; font-size: 1.25rem; }

/* Separator */
.separator {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

/* Icon Wrapper */
.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.75rem;
}

.icon-wrap-sm {
  padding: 0.375rem;
  border-radius: 0.5rem;
}

/* SVG Icons */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-xl { width: 2rem; height: 2rem; }
.icon-2xl { width: 2.5rem; height: 2.5rem; }
.icon-3xl { width: 3rem; height: 3rem; }

/* Touch active state */
.touch-active:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* Category Tab Button */
.cat-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: rgba(16, 185, 129, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.12);
  color: var(--muted-foreground);
}

.cat-tab:hover {
  color: var(--foreground);
}

.cat-tab.active {
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-color: transparent;
}

/* Activity Item */
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem;
  border-radius: 0.75rem;
  transition: background-color 0.15s ease;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Settings Item */
.settings-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: background-color 0.15s ease;
  width: 100%;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.settings-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing Utilities */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-top: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leading-relaxed { line-height: 1.625; }
.whitespace-nowrap { white-space: nowrap; }

/* Color Utilities */
.text-emerald { color: #34d399; }
.text-teal { color: #2dd4bf; }
.text-amber { color: #fbbf24; }
.text-purple { color: #a78bfa; }
.text-red { color: #f87171; }
.text-muted { color: var(--muted-foreground); }
.text-white { color: #fff; }

/* Background Utilities */
.bg-emerald-light { background: rgba(16, 185, 129, 0.1); }
.bg-amber-light { background: rgba(245, 158, 11, 0.1); }
.bg-teal-light { background: rgba(20, 184, 166, 0.1); }
.bg-purple-light { background: rgba(167, 139, 250, 0.1); }
.bg-red-light { background: rgba(239, 68, 68, 0.1); }
.bg-white-3 { background: rgba(255, 255, 255, 0.03); }
.bg-white-5 { background: rgba(255, 255, 255, 0.05); }

/* Border Utilities */
.border-t { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.border-b { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

/* Width Utilities */
.w-full { width: 100%; }
.max-w-3xl { max-width: 48rem; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* Rounded */
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Safe Area */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pb-nav {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

/* Tab Content Animation */
.tab-content {
  animation: fadeInUp 0.2s ease-out;
}

.tab-content-exit {
  animation: fadeInDown 0.15s ease-in reverse;
}

/* Responsive - Desktop bottom nav hidden */
@media (min-width: 768px) {
  .md\:hidden { display: none; }
  .md\:mr-64 { margin-right: 16rem; }
}
@media (min-width: 1024px) {
  .lg\:mr-72 { margin-right: 18rem; }
}
