/* =============================================
   VISIÓN MUNASKA — components.css
   Feature-specific Component Styles
   ============================================= */

/* ============================
   TAB 1: DASHBOARD / VISIÓN
   ============================ */

.dashboard-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--honey-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.hero-title {
  background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* Counter Display */
.counter-display {
  position: relative;
  margin: 0 auto 2.5rem;
  width: fit-content;
}

.counter-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(
    var(--honey-500) 0deg,
    var(--honey-500) var(--progress-deg, 0deg),
    rgba(35,30,14,0.8) var(--progress-deg, 0deg),
    rgba(35,30,14,0.8) 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(245,158,11,0.2), 0 0 120px rgba(245,158,11,0.08), inset 0 0 30px rgba(0,0,0,0.3);
  position: relative;
  transition: background 1s ease;
}

.counter-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--dark-bg);
  z-index: 1;
}

.counter-ring::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(245,158,11,0.05), transparent 60%);
  z-index: 2;
  border: 1px solid rgba(245,158,11,0.12);
}

.counter-inner {
  position: relative;
  z-index: 3;
  text-align: center;
}

.counter-number {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: block;
  transition: all 0.5s ease;
}

.counter-divider {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.2rem 0;
}
.counter-divider::before, .counter-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(245,158,11,0.2);
  width: 20px;
}

.counter-goal {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.counter-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Floating bees */
.floating-bees {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bee-particle {
  position: absolute;
  font-size: 1.4rem;
  animation: floatBee linear infinite;
  opacity: 0.6;
}
@keyframes floatBee {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(15px, -20px) rotate(15deg); }
  50% { transform: translate(-5px, -35px) rotate(-10deg); }
  75% { transform: translate(-20px, -15px) rotate(5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(26,21,9,0.7);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.stat-card:hover { border-color: rgba(180,83,9,0.4); transform: translateY(-3px); }
.stat-card:hover::before { transform: scaleX(1); }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Progress Honeycomb Bar */
.progress-section { margin-top: 1rem; }
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.progress-title { font-size: 0.85rem; font-weight: 700; color: var(--honey-400); }
.progress-percent {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-track {
  width: 100%;
  height: 18px;
  background: rgba(35,30,14,0.9);
  border-radius: 999px;
  border: 1px solid var(--dark-border);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a, #fbbf24, #f59e0b);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: shimmer 2s linear infinite;
  position: relative;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: white;
  opacity: 0.4;
  border-radius: 999px;
  filter: blur(2px);
}

/* Honeycomb hexagons */
.honeycomb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hex-cell {
  width: 22px;
  height: 22px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: background 0.4s ease, transform 0.2s ease;
  cursor: default;
}
.hex-cell.filled {
  background: var(--honey-500);
  box-shadow: 0 0 6px rgba(245,158,11,0.4);
}
.hex-cell.empty {
  background: rgba(35,30,14,0.8);
  border: none;
}
.hex-cell.filled:hover { transform: scale(1.2); background: var(--honey-300); }

/* ============================
   TAB 2: DIRECTORY / CARDS
   ============================ */

.filter-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: end;
}

@media (max-width: 600px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .search-wrap { grid-column: 1 / -1; }
}

.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.search-wrap .form-control { padding-left: 2.4rem; }

.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}
.results-count span { color: var(--honey-400); font-weight: 700; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.enrolado-card {
  background: rgba(26,21,9,0.7);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
  animation: cardFadeIn 0.35s ease both;
}

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

.enrolado-card::before {
  content: '🍯';
  position: absolute;
  top: -10px; right: -5px;
  font-size: 3.5rem;
  opacity: 0.06;
  transform: rotate(15deg);
  pointer-events: none;
}

.enrolado-card:hover {
  border-color: rgba(180,83,9,0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-honey);
}

.card-avatar {
  width: 44px; height: 44px;
  background: var(--gold-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-honey);
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.card-meta-item strong { color: var(--honey-400); font-weight: 600; }

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-suma {
  background: rgba(21,128,61,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}
.status-pendiente {
  background: rgba(245,158,11,0.12);
  color: var(--honey-400);
  border: 1px solid rgba(245,158,11,0.2);
}
.status-otro {
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.2);
}

/* ============================
   TAB 3: CRUD ADMIN
   ============================ */

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--dark-border);
}
.section-title h3 { color: var(--honey-300); font-size: 1rem; font-weight: 700; }
.section-title .section-icon { font-size: 1.1rem; }

/* Create Form */
.create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.create-form .form-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

/* Admin Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table thead tr {
  background: rgba(35,30,14,0.95);
  border-bottom: 1px solid var(--dark-border);
}

.admin-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--honey-500);
  white-space: nowrap;
}

.admin-table tbody tr {
  border-bottom: 1px solid rgba(61,50,18,0.5);
  transition: background 0.15s ease;
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(245,158,11,0.04); }

.admin-table td {
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-id { color: var(--text-muted); font-size: 0.75rem; }

.td-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.td-actions .btn { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

/* Validation error */
.field-error {
  font-size: 0.73rem;
  color: #f87171;
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.form-control.invalid { border-color: rgba(239,68,68,0.5); box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

/* Confirm Dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.confirm-overlay.visible { opacity: 1; pointer-events: all; }

.confirm-box {
  background: var(--dark-surface);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.confirm-overlay.visible .confirm-box { transform: scale(1); }

.confirm-icon { font-size: 3rem; margin-bottom: 1rem; }
.confirm-title { font-size: 1.1rem; font-weight: 700; color: #f87171; margin-bottom: 0.5rem; }
.confirm-msg { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* ============================
   MODAL FORM LAYOUT
   ============================ */

.modal-form { display: flex; flex-direction: column; gap: 1rem; }
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dark-border);
}
