/* =============================================
   NEVA Creative Arts Co. — UI Components
   Buttons, cards, forms, modal, cart
   ============================================= */

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .1s, box-shadow .2s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn:active { transform: none; box-shadow: none; }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover { background: #6A2278; color: #fff; }

.btn--secondary {
  background: var(--color-secondary);
  color: #fff;
}
.btn--secondary:hover { background: #D04B88; color: #fff; }

.btn--outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  padding: 10px 18px;
}
.btn--ghost:hover { background: #F3EDF8; }

.btn--danger {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}
.btn--danger:hover { background: #A93226; color: #fff; }

.btn--sm { padding: 8px 16px; font-size: .85rem; border-radius: var(--radius-sm); }
.btn--lg { padding: 16px 36px; font-size: 1.05rem; }

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-body { padding: 24px; }
.card-header {
  padding: 20px 24px 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--color-primary);
}

.card-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tag--dance   { background: #EDE7F6; color: #6A1B9A; }
.tag--voice   { background: #FCE4EC; color: #880E4F; }
.tag--acting  { background: #E3F2FD; color: #0D47A1; }
.tag--combo   { background: #FFF8E1; color: #F57F17; }
.tag--summer  { background: #E8F5E9; color: #1B5E20; }

/* ── Course card ─────────────────────────── */
.course-card { display: flex; flex-direction: column; }
.course-card .card-body { flex: 1; display: flex; flex-direction: column; }

.course-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .85rem;
  color: var(--color-text-muted);
  margin: 10px 0 16px;
}

.course-meta-row {
  display: flex;
  gap: 14px;
}

.course-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.course-price {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-primary);
  font-weight: 700;
  margin-top: auto;
  padding-top: 16px;
}

.course-price small {
  font-size: .75rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ── Forms ───────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-text);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(123, 45, 139, .12);
}

textarea { resize: vertical; min-height: 120px; }

.field-hint {
  font-size: .8rem;
  color: var(--color-text-muted);
}

.field-error {
  font-size: .8rem;
  color: var(--color-error);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Modal ───────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  transform: translateY(20px);
  transition: transform .2s;
}

.modal-backdrop.open .modal { transform: none; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: var(--color-text); }

/* ── Cart drawer ─────────────────────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  max-width: 100vw;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}

.cart-drawer.open { transform: none; }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-header h3 { color: var(--color-primary); font-size: 1.1rem; }

.cart-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--color-text-muted);
}

.cart-items-wrapper { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.cart-section { padding: 16px 24px; border-bottom: 1px solid var(--color-border); }
.cart-section:last-child { border-bottom: none; }
.cart-section.hidden { display: none; }

.cart-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.cart-items { padding: 0; }

.cart-dual-note {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: 10px;
  text-align: center;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: .95rem; }
.cart-item-meta { font-size: .8rem; color: var(--color-text-muted); margin-top: 2px; }

.cart-item-price {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: .9rem;
  padding: 2px;
}

.cart-item-remove:hover { color: var(--color-error); }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
}

.cart-summary { margin-bottom: 16px; }

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  margin-bottom: 6px;
}

.cart-summary-row.total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary);
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}

.cart-discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #D4EDDA;
  color: #155724;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.cart-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

/* ── Pricing table ───────────────────────── */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}

.pricing-table th,
.pricing-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.pricing-table th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .05em;
}

.pricing-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.pricing-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.pricing-table tr:nth-child(even) td { background: #F9F5FD; }

.pricing-table td.highlight {
  font-weight: 700;
  color: var(--color-primary);
}

/* ── Staff card ──────────────────────────── */
.staff-card {
  text-align: center;
}

.staff-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  font-family: var(--font-heading);
  overflow: hidden;
}

.staff-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-name { color: var(--color-primary); margin-bottom: 4px; }
.staff-role { font-size: .85rem; color: var(--color-secondary); font-weight: 700; margin-bottom: 12px; }
.staff-bio  { font-size: .9rem; color: var(--color-text-muted); }

/* ── Calendar event ──────────────────────── */
.event-item {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
}

.event-date-box {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
}

.event-date-month { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.event-date-day   { font-size: 1.6rem; font-weight: 800; line-height: 1; }

.event-info { flex: 1; }
.event-title { font-weight: 700; font-size: 1rem; color: var(--color-text); }
.event-desc  { font-size: .88rem; color: var(--color-text-muted); margin-top: 4px; }
.event-time  { font-size: .82rem; color: var(--color-secondary); font-weight: 600; margin-top: 4px; }

/* ── Loading spinner ─────────────────────── */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px;
  color: var(--color-text-muted);
  font-size: .9rem;
}

/* ── Student chip in cart/account ────────── */
.student-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EDE7F6;
  color: var(--color-primary);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: .82rem;
  font-weight: 700;
}

/* ── Billing toggle ─────────────────────── */
.billing-toggle {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
}

.billing-opt {
  flex: 1;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: background .15s;
  border: none;
  background: none;
  font-family: var(--font-body);
}

.billing-opt input { display: none; }

.billing-opt.selected {
  background: var(--color-primary);
  color: #fff;
}

.billing-opt-label { font-weight: 700; display: block; font-size: .95rem; }
.billing-opt-sub   { font-size: .78rem; opacity: .8; }
