/**
 * FEM Design System - Components
 * Cards, buttons, alerts, badges, avatars, stats, grids, tabs, pills, empty states
 *
 * Version: 1.0.0
 * Date: April 2026
 */

/* ============================================
   1. CARDS
   ============================================ */

.fem-card {
  background: white;
  border-radius: var(--fem-radius);
  box-shadow: var(--fem-shadow);
  padding: 24px;
  margin-bottom: 20px;
}

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

.fem-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fem-primary);
}

.fem-card-subtitle {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

/* Page header */
.fem-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.fem-page-title {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.fem-page-subtitle {
  font-size: 14px;
  color: #888;
}

.fem-page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ============================================
   2. BUTTONS
   ============================================ */

.fem-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--fem-radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
  min-height: 44px;
}

.fem-btn-primary {
  background: var(--fem-accent);
  color: white;
}

.fem-btn-primary:hover {
  background: #d66a4a;
  color: white;
}

.fem-btn-secondary {
  background: var(--fem-warm-bg);
  color: var(--fem-primary);
  border: 1px solid var(--fem-warm-border);
}

.fem-btn-secondary:hover {
  background: var(--fem-accent-light);
}

.fem-btn-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.fem-btn-danger:hover {
  background: #fee2e2;
}

.fem-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 32px;
}

.fem-btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.fem-btn-block {
  display: flex;
  width: 100%;
}

/* ============================================
   3. ALERTS
   ============================================ */

.fem-alert {
  padding: 12px 16px;
  border-radius: var(--fem-radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fem-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.fem-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.fem-alert-info {
  background: var(--fem-accent-light);
  color: var(--fem-primary);
  border: 1px solid var(--fem-warm-border);
}

.fem-alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ============================================
   4. BADGES
   ============================================ */

.fem-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.fem-badge-success {
  background: #dcfce7;
  color: #166534;
}

.fem-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.fem-badge-danger {
  background: #fef2f2;
  color: #991b1b;
}

.fem-badge-info {
  background: var(--fem-accent-light);
  color: var(--fem-accent);
}

.fem-badge-gold {
  background: var(--fem-gold-light);
  color: #92710c;
}

.fem-badge-neutral {
  background: #f3f4f6;
  color: #6b7280;
}

/* ============================================
   5. STATS
   ============================================ */

.fem-stat {
  text-align: center;
  padding: 20px;
}

.fem-stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fem-primary);
  line-height: 1.1;
}

.fem-stat-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* ============================================
   6. GRID
   ============================================ */

.fem-grid {
  display: grid;
  gap: 20px;
}

.fem-grid-2 { grid-template-columns: repeat(2, 1fr); }
.fem-grid-3 { grid-template-columns: repeat(3, 1fr); }
.fem-grid-4 { grid-template-columns: repeat(4, 1fr); }
.fem-grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

@media (max-width: 1023px) {
  .fem-grid-2,
  .fem-grid-3 {
    grid-template-columns: 1fr;
  }

  .fem-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fem-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .fem-grid-auto {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   7. TABS & PILLS
   ============================================ */

.fem-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--fem-warm-border);
  padding-bottom: 0;
}

.fem-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-body);
}

.fem-tab:hover {
  color: var(--fem-primary);
}

.fem-tab.active {
  color: var(--fem-accent);
  border-bottom-color: var(--fem-accent);
}

.fem-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.fem-pill {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  color: #666;
  border: 1px solid var(--fem-warm-border);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font-body);
}

.fem-pill:hover,
.fem-pill.active {
  background: var(--fem-accent);
  color: white;
  border-color: var(--fem-accent);
}

/* ============================================
   8. EMPTY STATE
   ============================================ */

.fem-empty {
  text-align: center;
  padding: 48px 24px;
  color: #999;
}

.fem-empty i {
  font-size: 48px;
  color: var(--fem-warm-border);
  margin-bottom: 12px;
  display: block;
}

.fem-empty-text {
  font-size: 15px;
  margin-bottom: 16px;
}

/* ============================================
   9. CHART CONTAINER
   ============================================ */

.fem-chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

@media (max-width: 1023px) {
  .fem-chart-container { height: 240px; }
}

@media (max-width: 600px) {
  .fem-chart-container { height: 200px; }

  .fem-card {
    padding: 16px;
    border-radius: 10px;
  }

  .fem-stat { padding: 14px; }
  .fem-stat-value { font-size: 1.6rem; }

  .fem-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fem-tabs::-webkit-scrollbar { display: none; }

  .fem-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .fem-pills::-webkit-scrollbar { display: none; }
  .fem-pill { flex-shrink: 0; }
}
