/* Plugin: InstructorPro Suite | File Version: 2016v2 */
/* ==========================================================================
   EZ2D Global Layout v3
   - Cards, buttons, inputs, tables, sidebar
   - NO hard-coded colours, only CSS variables
   ========================================================================== */

/* Wrapper utilities */
.ez2d-page-shell {
  max-width: var(--ez2d-content-max-width);
  margin: 0 auto;
  padding: var(--ez2d-page-padding);
}

/* ------------------------------------------------------------
   CARDS
------------------------------------------------------------ */
.ez2d-card {
  border-radius: var(--ez2d-card-radius);
  background: var(--ez2d-bg-elevated);
  box-shadow: var(--ez2d-card-shadow);
  border: 1px solid var(--ez2d-border-subtle);
  padding: 1.1rem 1.25rem;
}

.ez2d-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.ez2d-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ez2d-text);
}

.ez2d-card-subtitle {
  font-size: .85rem;
  color: var(--ez2d-text-muted);
}

.ez2d-card-body {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ------------------------------------------------------------
   BADGES (status)
------------------------------------------------------------ */
.ez2d-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem .7rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.ez2d-badge-booked {
  background: color-mix(in srgb, var(--ez2d-status-booked) 16%, var(--ez2d-primary));
  color: var(--ez2d-status-booked);
}

.ez2d-badge-completed {
  background: color-mix(in srgb, var(--ez2d-status-completed) 16%, var(--ez2d-primary));
  color: var(--ez2d-status-completed);
}

.ez2d-badge-available {
  background: color-mix(in srgb, var(--ez2d-status-available) 16%, var(--ez2d-primary));
  color: var(--ez2d-status-available);
}

/* ------------------------------------------------------------
   BUTTONS (pill-style)
------------------------------------------------------------ */
.ez2d-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .55rem 1.15rem;
  border-radius: var(--ez2d-btn-radius);
  border: 0;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}

.ez2d-btn-primary {
  background: linear-gradient(135deg, var(--ez2d-primary), var(--ez2d-primary-strong));
  color: #fff;
  box-shadow: var(--ez2d-btn-shadow);
}

.ez2d-btn-primary:hover {
  filter: brightness(1.04);
}

.ez2d-btn-secondary {
  background: var(--ez2d-bg-elevated);
  color: var(--ez2d-text);
  border: 1px solid var(--ez2d-border-subtle);
  box-shadow: none;
}

.ez2d-btn-secondary:hover {
  border-color: var(--ez2d-primary);
}

.ez2d-btn-ghost {
  background: transparent;
  color: var(--ez2d-primary);
  border: 1px solid var(--ez2d-border-subtle);
}

.ez2d-btn-ghost:hover {
  background: var(--ez2d-primary-soft);
}

/* Small button */
.ez2d-btn-sm {
  padding: .35rem .8rem;
  font-size: .8rem;
}

/* Block button */
.ez2d-btn-block {
  display: inline-flex;
  width: 100%;
}

/* Icon-only */
.ez2d-btn-icon-only {
  padding: .4rem .55rem;
  border-radius: 999px;
}

/* ------------------------------------------------------------
   FORMS
------------------------------------------------------------ */
.ez2d-form-row {
  display: flex;
  gap: .9rem;
  margin-bottom: .9rem;
  flex-wrap: nowrap;
}

.ez2d-form-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.ez2d-form-field label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ez2d-text);
}

.ez2d-form-field input,
.ez2d-form-field select,
.ez2d-form-field textarea {
  width: 100%;
  border: 2px solid var(--ez2d-border-subtle) !important;
  background: var(--ez2d-bg-elevated) !important;
}

/* Basic inputs */
.ez2d-input,
.ez2d-select,
.ez2d-textarea {
  border-radius: 10px;
  border: 2px solid var(--ez2d-border-subtle) !important;
  background: var(--ez2d-bg-elevated) !important;
  padding: .4rem .6rem;
  font-size: .85rem;
  color: var(--ez2d-text);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
}

/* Ensure all plugin inputs show a frame */
.ez2d-module-content input:not([type="checkbox"]):not([type="radio"]),
.ez2d-module-content select,
.ez2d-module-content textarea {
  border: 2px solid var(--ez2d-border-subtle) !important;
  background: var(--ez2d-bg-elevated) !important;
  border-radius: 10px !important;
}

.ez2d-input:focus,
.ez2d-select:focus,
.ez2d-textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--ez2d-primary) 35%, transparent);
  border-color: var(--ez2d-primary);
}

/* ------------------------------------------------------------
   TABLES
------------------------------------------------------------ */
.ez2d-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.ez2d-table-head {
  display: grid;
  align-items: center;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--ez2d-border-subtle);
  font-weight: 600;
  color: var(--ez2d-text-muted);
  background: var(--ez2d-bg-soft);
}

.ez2d-table-row {
  display: grid;
  align-items: center;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--ez2d-border-subtle);
}

/* ------------------------------------------------------------
   TOGGLE PILL (shared)/* ------------------------------------------------------------
   GLOBAL SIDEBAR (dashboard)
   Uses sidebar variables from theme engine
------------------------------------------------------------ */
.ez2d-nav-shell {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Sidebar container */
.ez2d-nav {
  background: var(--sidebar-bg);
  border-radius: 18px;
  padding: .9rem;
  box-shadow: var(--ez2d-card-shadow);
}

/* Top-level items */
.ez2d-nav-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .75rem;
  margin-bottom: .25rem;
  border-radius: 26px; /* base; shape tweaks below */
  background: var(--sidebar-button-bg);
  border: 1px solid color-mix(in srgb, var(--sidebar-button-bg) 70%, var(--ez2d-border-subtle));
  cursor: pointer;
  color: var(--sidebar-text-color);
}

/* Active item */
.ez2d-nav-item.active {
  background: linear-gradient(135deg, var(--ez2d-primary), var(--ez2d-primary-strong));
  color: var(--ez2d-primary);
  border-color: transparent;
  box-shadow: 0 12px 24px var(--ez2d-primary);
}

/* Icons */
.ez2d-nav-item svg {
  width: var(--sidebar-icon-size);
  height: var(--sidebar-icon-size);
  fill: var(--sidebar-icon-color);
}

/* Active icon override */
.ez2d-nav-item.active svg {
  fill: var(--ez2d-primary);
}

/* Text */
.ez2d-nav-label {
  font-size: .85rem;
  white-space: nowrap;
}

/* Subnav container */
.ez2d-nav-sub {
  margin-left: 2.2rem;
  margin-top: .2rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

/* Subnav item */
.ez2d-nav-sub-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sidebar-button-bg) 85%, var(--ez2d-bg));
  color: var(--sidebar-text-color);
  font-size: .8rem;
  cursor: pointer;
}

.ez2d-nav-sub-item svg {
  width: calc(var(--sidebar-icon-size) - 4px);
  height: calc(var(--sidebar-icon-size) - 4px);
  fill: var(--sidebar-icon-color);
}

.ez2d-nav-sub-item.active {
  background: color-mix(in srgb, var(--ez2d-primary) 18%, var(--sidebar-button-bg));
  color: var(--ez2d-primary-strong);
}

/* Shape variants applied via JS by sidebar_shape */
.ez2d-nav-item.circle {
  border-radius: 999px;
}

.ez2d-nav-item.rounded {
  border-radius: 14px;
}

.ez2d-nav-item.square {
  border-radius: 6px;
}

/* ------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------ */
@media (max-width: 900px) {
  .ez2d-form-row {
    flex-direction: column;
  }
}
/* ==========================================================
   EZ2D GLOBAL FULLSCREEN SPINNER
   ========================================================== */

#ez2d-global-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(255,255,255,.9);
    display: none;
    align-items: center;
    justify-content: center;
}

#ez2d-global-overlay.is-active {
    display: flex;
}

.ez2d-global-box {
    text-align: center;
}

.ez2d-global-message {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ez2d-text);
}

/* Unified Toggle (single source of truth) */
.ez2d-toggle-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.ez2d-toggle-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.ez2d-toggle-visual {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background .25s ease, border-color .25s ease;
}

.ez2d-toggle-visual::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .25s ease;
}

.ez2d-toggle-pill input[type="checkbox"]:checked + .ez2d-toggle-visual {
  background: #16a34a;
  border-color: #15803d;
}

.ez2d-toggle-pill input[type="checkbox"]:checked + .ez2d-toggle-visual::after {
  transform: translateX(18px);
}

.ez2d-toggle-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

/* Discount type toggle (radio pills) */
.ez2d-discount-type-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.ez2d-discount-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ez2d-discount-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.ez2d-discount-toggle input:checked + .ez2d-toggle-label {
  color: #ffffff;
}

.ez2d-discount-toggle:has(input:checked) {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

/* Dashboard-wide card glow fallback */
.ez2d-admin-dashboard-shell .ez2d-card,
.ez2d-admin-dashboard-shell .ez2d-card-padded,
.ez2d-admin-dashboard-shell .ez2d-modern-card {
  box-shadow: var(--ez2d-shadow-md, 0 10px 20px var(--ez2d-primary)) !important;
}
