/**
 * AK Product Set — Frontend Styles
 * Aesthetic: Ultra-Premium, Dynamic, Modern
 */

/* ============================================================
   Utility & Base
   ============================================================ */
.ak-hidden {
  display: none !important;
}

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

.ak-product-set-section {
  margin: 40px 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b; /* slate-800 */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: akFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================================
   Participant List
   ============================================================ */
.ak-participant-list {
  margin-bottom: 28px;
}

.ak-list-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #64748b; /* slate-500 */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
  display: block;
}

.ak-participants-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ak-participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03), inset 0 0 0 1px rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ak-participant-item:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04), inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.ak-participant-name {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a; /* slate-900 */
}

.ak-participant-extras {
  font-weight: 500;
  color: #94a3b8; /* slate-400 */
  font-size: 0.875rem;
  margin-left: 8px;
}

.ak-remove-btn {
  background: rgba(239, 68, 68, 0.05); /* subtle red */
  border: 1px solid transparent;
  cursor: pointer;
  color: #ef4444; /* red-500 */
  font-size: 14px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ak-remove-btn:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: rotate(90deg);
}

.ak-remove-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ak-no-participants {
  font-size: 0.95rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0;
  padding: 16px 0;
  font-style: italic;
}

/* ============================================================
   Add-Participant Form (Inner Form)
   ============================================================ */
.ak-form-wrapper {
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

/* ============================================================
   Boxed Product Card Layout
   ============================================================ */
.ak-box-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
}

/* Subtle top gradient glow for the form */
.ak-box-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  opacity: 0.8;
}

.ak-box-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.ak-box-image {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(0,0,0,0.05);
}

.ak-box-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.ak-box-info {
  flex: 1;
}

.ak-box-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0f172a, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 12px;
  line-height: 1.2;
}

.ak-box-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
}

.ak-box-desc p {
  margin: 0 0 12px;
}
.ak-box-desc p:last-child {
  margin-bottom: 0;
}

.ak-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 20px;
  display: block;
}

@media (max-width: 640px) {
  .ak-product-set-section {
    margin: 16px 0;
  }

  .ak-box-card {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .ak-box-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
  }

  .ak-box-image {
    width: 100px;
    height: 100px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 10px;
  }

  .ak-box-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .ak-box-desc {
    font-size: 0.875rem;
  }

  .ak-event-meta-info {
    margin-bottom: 16px !important;
    gap: 6px !important;
  }

  .ak-meta-chip {
    padding: 4px 10px !important;
    font-size: 10px !important;
  }

  .ak-pricing-table-wrapper {
    padding: 14px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .ak-pricing-table-title {
    font-size: 1.1rem;
    margin-bottom: 14px;
  }

  .ak-round-block {
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .ak-pt-table th,
  .ak-pt-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .ak-participant-item {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .ak-participant-list {
    margin-bottom: 16px;
  }

  .ak-form-wrapper {
    margin-top: 12px;
    padding-top: 16px;
  }
}

/* ============================================================
   Quick Select
   ============================================================ */
.ak-quick-select-container {
  margin-bottom: 28px;
}

.ak-quick-select-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 12px;
}

.ak-quick-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Smooth pill buttons for chips */
.ak-quick-select-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.ak-quick-select-btn:hover {
  background: #ffffff;
  border-color: #6366f1; /* indigo-500 */
  color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

/* Secondary outline for Add All */
.ak-quick-select-add-all-btn {
  background: transparent;
  border: 1.5px dashed #cbd5e1;
  color: #64748b;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ak-quick-select-add-all-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

.ak-quick-select-add-all-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Form Fields
   ============================================================ */
.ak-form-field {
  margin-bottom: 20px;
}

.ak-form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.ak-form-field label .required {
  color: #ef4444;
  margin-left: 2px;
}

.ak-form-field input[type="text"],
.ak-form-field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  height: 48px;
}

.ak-form-field select {
  /* Elegant chevron */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

.ak-form-field input[type="text"]:focus,
.ak-form-field select:focus {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Row: two selects side by side */
.ak-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

/* Submit button */
.ak-form-actions {
  margin-top: 32px;
}

.ak-btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 10px;
  height: 52px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.ak-btn-add::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.ak-btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}
.ak-btn-add:hover::after {
  opacity: 1;
}

/* Content needs to sit above the hover gradient */
.ak-btn-add {
  /* Using a span for text if we could, but since it's just text, we rely on the background transition directly */
  /* Actually, the pseudo-element will cover the text if z-index is not handled. Let's simplify and just transition the background property. */
}
/* Revert complex pseudo element for button to keep it bulletproof */
.ak-btn-add::after { display: none; }
.ak-btn-add:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

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

/* Inline form notice */
.ak-form-notice {
  margin-top: 20px;
  padding: 16px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  animation: akFadeInUp 0.4s ease;
}

.ak-form-notice.ak-notice--error {
  background: #fef2f2;
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px #fecaca;
}

.ak-form-notice.ak-notice--success {
  background: #f0fdf4;
  color: #15803d;
  box-shadow: inset 0 0 0 1px #bbf7d0;
}

/* ============================================================
   Stock exhausted message
   ============================================================ */
.ak-stock-exhausted {
  padding: 24px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #b45309;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px #fde68a, 0 4px 6px -1px rgba(0,0,0,0.02);
  margin: 0;
  text-align: center;
}

/* ============================================================
   Cart page: locked quantity
   ============================================================ */
.ak-qty-locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-weight: 700;
  color: #475569;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

/* ============================================================
   Admin: participant card (wp-admin only)
   ============================================================ */
.ak-admin-participant {
  font-size: 13px;
  font-weight: 500;
}

/* ============================================================
   Participant Summary & Checkout
   ============================================================ */
.ak-participant-summary {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ak-summary-total {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.ak-summary-total strong {
  font-weight: 600;
  margin-right: 12px;
  color: #64748b;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ak-total-price {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

.ak-btn-checkout {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 12px 28px !important;
  border-radius: 10px !important;
  border: none !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  height: 48px;
}

.ak-btn-checkout:hover {
  background: #1e293b !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

@media (max-width: 480px) {
  .ak-participant-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    text-align: center;
  }
}

/* ============================================================
   Floating Cart Bar
   ============================================================ */
.ak-floating-cart-bar {
  position: sticky;
  bottom: 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
  z-index: 99;
  padding: 24px 32px;
  border-radius: 16px;
  margin-top: 24px;
  box-sizing: border-box;
  width: 100%;
  animation: akFadeInUp 0.4s ease-out;
}

.ak-floating-cart-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.ak-floating-cart-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.ak-floating-cart-total strong {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #64748b;
  margin-right: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.ak-global-cart-total-value {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

.ak-floating-cart-bar .ak-btn-checkout {
  margin: 0 !important;
}

@media (max-width: 600px) {
  .ak-floating-cart-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .ak-floating-cart-bar .ak-btn-checkout {
    width: 100%;
  }
}

/* ============================================================
   Participant Item Price & Rule
   ============================================================ */
.ak-participant-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: #3b82f6; /* blue-500 */
  display: inline-block;
  margin-top: 4px;
}

.ak-participant-rule-desc {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8; /* slate-400 */
  margin-left: 6px;
  font-style: italic;
}

/* ============================================================
   Pricing Table
   ============================================================ */
.ak-pricing-table-wrapper {
  margin-bottom: 36px;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  border: 1px solid #e2e8f0;
}

.ak-pricing-table-title {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.ak-round-block {
  margin-bottom: 24px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #f1f5f9;
}

.ak-round-block:last-child {
  margin-bottom: 0;
}

.ak-round-block--active {
  background: #ffffff;
  border: 2px solid #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.ak-round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ak-round-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.ak-round-end-date {
  font-weight: 400;
  color: #64748b;
  font-size: 0.875rem;
}

.ak-round-badge--active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ak-pt-table-responsive {
  overflow-x: auto;
}

.ak-pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.ak-pt-table th {
  padding: 12px 14px;
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  border-bottom: 2px solid #e2e8f0;
}

.ak-pt-table th small {
  display: block;
  font-weight: 500;
  color: #64748b;
  margin-top: 2px;
}

.ak-pt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
}

.ak-pt-label {
  font-weight: 700;
  color: #0f172a;
}

.ak-per-item-hint {
  display: block;
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.3;
}

.ak-pt-cell--empty {
  color: #94a3b8;
}
