﻿/* components.css - Cards, Buttons, Forms, Badges */

/* =======================================================================
   6. CARDS
   ======================================================================= */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-fg));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.35s var(--spring), transform 0.35s var(--spring), border-color 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: hsl(var(--border) / 0.6);
}

/* ---- App Card (Top Charts Style) ---- */
.app-card-chart {
  display: flex;
  align-items: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  gap: 1rem;
  transition: transform 0.2s var(--spring), box-shadow 0.2s var(--spring), border-color 0.2s;
  text-decoration: none;
  color: inherit;
}

.app-card-chart:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: hsl(var(--border) / 0.8);
}

.app-card-chart-rank {
  font-size: 1rem;
  font-weight: 700;
  color: hsl(var(--muted-fg));
  min-width: 1.5rem;
  text-align: center;
}

.app-card-chart-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  background: hsl(var(--muted) / 0.5);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-card-chart-icon img,
.app-card-chart-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.app-card-chart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-card-chart-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: hsl(var(--fg));
}

.app-card-chart-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-fg));
}

.app-card-chart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 1rem;
  background: hsl(152 76% 36%);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
}

.app-card-chart-btn:hover {
  opacity: 0.9;
}

.app-card-chart-btn:active {
  transform: scale(0.96);
}

/* ---- Original App Card specific interior elements ---- */

.dark .card {
  border-color: hsl(var(--border));
  background: hsl(var(--card) / 0.8);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-header {
  padding: 1rem 1.25rem 0.5rem;
}

.card-content {
  padding: 0 1.25rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =======================================================================
   7. BUTTONS
   ======================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius);
  border: none;
  transition: all 0.25s var(--spring);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.85));
  color: hsl(var(--primary-fg));
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px hsl(var(--primary) / 0.35);
  filter: brightness(1.05);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-fg));
}

.btn-secondary:hover:not(:disabled) {
  background: hsl(var(--muted));
}

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-fg));
}

.btn-destructive:hover:not(:disabled) {
  filter: brightness(0.9);
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--fg));
}

.btn-ghost:hover:not(:disabled) {
  background: hsl(var(--accent));
}

.btn-outline {
  background: transparent;
  color: hsl(var(--fg));
  border: 1px solid hsl(var(--border));
}

.btn-outline:hover:not(:disabled) {
  background: hsl(var(--accent));
}

.btn-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

.btn-rounded {
  border-radius: 9999px;
}

/* =======================================================================
   8. FORMS
   ======================================================================= */
.input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12), 0 1px 6px hsl(var(--ring) / 0.08);
}

.input::placeholder {
  color: hsl(var(--muted-fg));
}

textarea.input {
  min-height: 80px;
  resize: vertical;
}

select.input {
  appearance: auto;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* =======================================================================
   9. BADGES
   ======================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.badge-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-fg));
}

.badge-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-fg));
}

.badge-success {
  background: hsl(142 76% 36% / 0.1);
  color: hsl(142 76% 36%);
  border-color: hsl(142 76% 36% / 0.2);
}

.badge-warning {
  background: hsl(38 92% 50% / 0.1);
  color: hsl(38 92% 50%);
  border-color: hsl(38 92% 50% / 0.2);
}

.badge-destructive {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

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

