/* ═══════════════════════════════════════════════════
   Bee Hive — Reusable UI Components
   Cards, forms, buttons, navigation, and layout
   ═══════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────
   Cards
   ──────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 2;
  background: var(--card);
  border-radius: 24px;
  border: 1.5px solid rgba(232, 163, 23, 0.2);
  box-shadow:
    0 4px 32px var(--card-shadow),
    0 0 60px rgba(232, 163, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
}

.card-sm {
  position: relative;
  z-index: 2;
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  border: 1.5px solid rgba(232, 163, 23, 0.2);
  box-shadow:
    0 4px 32px var(--card-shadow),
    0 0 60px rgba(232, 163, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
}

.card-animate {
  opacity: 0;
  transform: translateY(16px);
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ────────────────────────────────────────────────
   Typography
   ──────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 {
  font-size: 30px;
  margin-bottom: 6px;
}

h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.text-muted {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ────────────────────────────────────────────────
   Forms
   ──────────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-wrap > svg:first-of-type {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.field select {
  cursor: pointer;
  appearance: none;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
  padding: 14px 16px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--input-focus);
  background: rgba(255, 252, 240, 0.9);
  box-shadow: 0 0 0 3px var(--honey-light);
}

.input-wrap:has(input:focus) > svg:first-of-type,
.input-wrap:has(select:focus) > svg:first-of-type,
.input-wrap:has(textarea:focus) > svg:first-of-type {
  color: var(--honey);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

/* ────────────────────────────────────────────────
   Buttons
   ──────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 50%, var(--honey-glow) 0%, var(--honey) 45%, var(--honey-dark) 100%);
  color: #3d2e0a;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.1s ease;
  box-shadow: 0 4px 16px rgba(232, 163, 23, 0.3);
  z-index: 2;
  outline: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, #ffd660 0%, var(--honey-glow) 45%, var(--honey) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  box-shadow: 0 6px 24px rgba(232, 163, 23, 0.45);
}

.btn:active {
  transform: scale(0.97) translateY(2px);
  box-shadow: 0 1px 4px rgba(232, 163, 23, 0.2);
  filter: brightness(0.85);
}

.btn-secondary {
  width: 100%;
  padding: 15px;
  border: 1.5px solid var(--honey);
  border-radius: 14px;
  background: transparent;
  color: var(--honey);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  z-index: 2;
  outline: none;
}

.btn-secondary:hover {
  background: rgba(232, 163, 23, 0.1);
  box-shadow: 0 4px 16px rgba(232, 163, 23, 0.15);
}

.btn-secondary:active {
  transform: scale(0.97) translateY(2px);
}

.btn-sm {
  width: auto;
  padding: 10px 20px;
  font-size: 13px;
}

.btn .btn-text {
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.btn .spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.btn .spinner::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(61, 46, 10, 0.3);
  border-top-color: #3d2e0a;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn.loading .spinner {
  opacity: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ────────────────────────────────────────────────
   Hexagonal Elements
   ──────────────────────────────────────────────── */
.hex-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 50% 45%, var(--honey-glow) 0%, var(--honey) 50%, var(--honey-dark) 100%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
}

.hex-icon svg {
  width: 28px;
  height: 28px;
  color: #3d2e0a;
}

.hex-icon-sm {
  width: 36px;
  height: 36px;
}

.hex-icon-sm svg {
  width: 18px;
  height: 18px;
}

.hex-dot {
  width: 20px;
  height: 20px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--comb-stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Hexagonal checkbox */
.checkmark {
  width: 20px;
  height: 20px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--input-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.checkmark::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--comb-stroke);
}

.checkmark::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(240, 214, 138, 0.4);
  transition: background 0.2s ease;
}

.checkmark svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
  color: #3d2e0a;
  position: relative;
  z-index: 1;
}

input:checked ~ .checkmark::after {
  background: var(--honey);
}

input:checked ~ .checkmark svg {
  opacity: 1;
  transform: scale(1);
}

/* ────────────────────────────────────────────────
   Divider
   ──────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  position: relative;
  z-index: 2;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.divider span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ────────────────────────────────────────────────
   Tables
   ──────────────────────────────────────────────── */
.table-wrap {
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid rgba(232, 163, 23, 0.2);
  background: var(--card);
  backdrop-filter: blur(20px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: rgba(240, 214, 138, 0.25);
  padding: 14px 18px;
  text-align: left;
}

td {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(232, 163, 23, 0.04);
}

/* ────────────────────────────────────────────────
   Badges / Tags
   ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 20px;
  background: rgba(240, 214, 138, 0.3);
  color: var(--text-muted);
}

.badge-success {
  background: rgba(72, 187, 120, 0.15);
  color: #2f855a;
}

.badge-warning {
  background: rgba(232, 163, 23, 0.2);
  color: var(--honey-dark);
}

.badge-danger {
  background: rgba(229, 62, 62, 0.15);
  color: #c53030;
}

/* ────────────────────────────────────────────────
   Modals
   ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border-radius: 24px;
  border: 1.5px solid rgba(232, 163, 23, 0.2);
  box-shadow:
    0 4px 32px var(--card-shadow),
    0 0 60px rgba(232, 163, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  width: 100%;
  max-width: 480px;
  animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.modal-header {
  padding: 28px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.modal-header button:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px 32px;
}

.modal-footer {
  padding: 0 32px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer .btn,
.modal-footer .btn-secondary {
  width: auto;
  padding: 12px 24px;
}

/* ────────────────────────────────────────────────
   Stat Cards Grid
   ──────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  position: relative;
  z-index: 2;
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  border: 1.5px solid rgba(232, 163, 23, 0.2);
  box-shadow:
    0 4px 32px var(--card-shadow),
    0 0 60px rgba(232, 163, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
}

.stat-card .stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ────────────────────────────────────────────────
   Empty State
   ──────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  position: relative;
  z-index: 2;
}

.empty-state .hex-icon {
  margin-bottom: 20px;
  opacity: 0.6;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ────────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stat-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .modal {
    max-width: calc(100% - 32px);
    margin: 0 16px;
  }

}

@media (max-width: 480px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 17px;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .stat-card .stat-number {
    font-size: 24px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  th, td {
    padding: 10px 12px;
    font-size: 13px;
  }
}
