/**
 * Shumokh Edu Design System
 * Scope: .shumokh-edu-wrapper
 * Theme Compatibility: EduBlink / MasterStudy / Craterea
 */

.shumokh-edu-wrapper {
  /* --- Design Tokens --- */

  /* Brand Identity Colors (Thalath Niqat) */
  --sh-brand-primary: #F8A030;
  /* Orange */
  --sh-brand-secondary: #B82028;
  /* Red */
  --sh-neutral-900: #303030;
  /* Charcoal */

  /* Fallbacks / Mappings */
  --sh-primary: var(--sh-brand-primary);
  --sh-primary-dark: #d68b29;
  /* Darker Orange */
  --sh-secondary: var(--sh-brand-secondary);
  --sh-accent: #f8b81f;

  /* Functional Colors */
  --sh-success: #31b978;
  --sh-warning: var(--sh-brand-primary);
  /* Use brand orange for warning */
  --sh-danger: var(--sh-brand-secondary);
  /* Use brand red for danger */
  --sh-info: #2d89ef;
  --sh-muted: #6f748d;

  /* Neutrals */
  --sh-white: #ffffff;
  --sh-light: #f9fafb;
  /* Slightly cooler grey */
  --sh-border: #e5e7eb;
  --sh-text-main: var(--sh-neutral-900);
  --sh-text-dark: #111827;

  /* Shadows & Radius */
  --sh-radius-sm: 8px;
  --sh-radius: 12px;
  --sh-radius-lg: 20px;
  --sh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --sh-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --sh-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Typography */
  --sh-font-family: inherit;
  --sh-font-size-sm: 0.875rem;
  --sh-font-size-base: 1rem;
  --sh-font-size-lg: 1.125rem;
  --sh-font-size-xl: 1.5rem;

  /* Spacing Scale */
  --sh-space-xs: 4px;
  --sh-space-sm: 8px;
  --sh-space-md: 16px;
  --sh-space-lg: 24px;
  --sh-space-xl: 32px;

  /* --- Reset & Base --- */
  font-family: var(--sh-font-family);
  color: var(--sh-text-main);
  line-height: 1.6;
  box-sizing: border-box;
  width: 100%;
}

/* --- Full Width Overrides --- */
/* Force full width on plugin pages, overriding theme containers */
.shumokh-edu-wrapper.sh-full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-left: 5%;
  padding-right: 5%;
  max-width: 100vw !important;
  background: var(--sh-light);
  /* Base background for full pages */
  min-height: 80vh;
  padding-top: 40px;
  padding-bottom: 60px;
}

/* --- Animations --- */
@media (prefers-reduced-motion: no-preference) {
  .shumokh-edu-wrapper .sh-anim-fade-in {
    animation: shFadeIn 0.4s ease-out forwards;
  }

  .shumokh-edu-wrapper .sh-anim-slide-up {
    animation: shSlideUp 0.4s ease-out forwards;
  }

  @keyframes shFadeIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  @keyframes shSlideUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

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

  .shumokh-edu-wrapper .sh-card:hover {
    transform: translateY(-4px);
  }
}

.shumokh-edu-wrapper *,
.shumokh-edu-wrapper *::before,
.shumokh-edu-wrapper *::after {
  box-sizing: inherit;
}

/* --- Components --- */

/* 1. Cards */
.shumokh-edu-wrapper .sh-card {
  background: var(--sh-white);
  border-radius: var(--sh-radius);
  box-shadow: var(--sh-shadow);
  border: 1px solid var(--sh-border);
  padding: var(--sh-space-lg);
  margin-bottom: var(--sh-space-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.shumokh-edu-wrapper .sh-card:hover {
  box-shadow: var(--sh-shadow-hover);
}

.shumokh-edu-wrapper .sh-card.sh-card--glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.shumokh-edu-wrapper .sh-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sh-space-md);
  padding-bottom: var(--sh-space-sm);
  border-bottom: 1px solid var(--sh-border);
}

.shumokh-edu-wrapper .sh-card__title {
  margin: 0;
  font-size: var(--sh-font-size-lg);
  font-weight: 700;
  color: var(--sh-primary-dark);
}

/* 2. Stat Cards */
.shumokh-edu-wrapper .sh-stat-card {
  display: flex;
  align-items: center;
  gap: var(--sh-space-md);
  padding: var(--sh-space-lg);
}

.shumokh-edu-wrapper .sh-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--sh-radius-sm);
  background: rgba(26, 182, 157, 0.1);
  /* Primary light */
  color: var(--sh-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.shumokh-edu-wrapper .sh-stat-content h4 {
  margin: 0;
  font-size: var(--sh-font-size-sm);
  color: var(--sh-muted);
  font-weight: 500;
}

.shumokh-edu-wrapper .sh-stat-content .value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sh-text-dark);
  line-height: 1.2;
}

/* 3. Buttons */
.shumokh-edu-wrapper .sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sh-space-sm);
  padding: 10px 24px;
  border-radius: var(--sh-radius-sm);
  font-size: var(--sh-font-size-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1.4;
  border: none;
}

.shumokh-edu-wrapper .sh-btn--primary {
  background: var(--sh-primary);
  color: #fff;
}

.shumokh-edu-wrapper .sh-btn--primary:hover {
  background: var(--sh-primary-dark);
  transform: translateY(-2px);
  color: #fff;
}

.shumokh-edu-wrapper .sh-btn--secondary {
  background: #fff;
  border: 1px solid var(--sh-border);
  color: var(--sh-text-main);
}

.shumokh-edu-wrapper .sh-btn--secondary:hover {
  background: var(--sh-light);
  border-color: var(--sh-primary);
  color: var(--sh-primary);
}

.shumokh-edu-wrapper .sh-btn--ghost {
  background: transparent;
  color: var(--sh-primary);
  padding-left: 0;
  padding-right: 0;
}

.shumokh-edu-wrapper .sh-btn--ghost:hover {
  text-decoration: underline;
}

.shumokh-edu-wrapper .sh-btn--sm {
  padding: 6px 16px;
  font-size: var(--sh-font-size-sm);
}

.shumokh-edu-wrapper .sh-btn--block {
  display: flex;
  width: 100%;
}

/* 4. Inputs */
.shumokh-edu-wrapper .sh-form-group {
  margin-bottom: var(--sh-space-md);
}

.shumokh-edu-wrapper .sh-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: var(--sh-font-size-sm);
  color: var(--sh-text-dark);
}

.shumokh-edu-wrapper .sh-input,
.shumokh-edu-wrapper .sh-select,
.shumokh-edu-wrapper .sh-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  font-size: var(--sh-font-size-base);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.shumokh-edu-wrapper .sh-input:focus,
.shumokh-edu-wrapper .sh-select:focus,
.shumokh-edu-wrapper .sh-textarea:focus {
  border-color: var(--sh-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 182, 157, 0.15);
}

/* 5. Badges */
.shumokh-edu-wrapper .sh-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shumokh-edu-wrapper .sh-badge--success {
  background: rgba(49, 185, 120, 0.1);
  color: var(--sh-success);
}

.shumokh-edu-wrapper .sh-badge--warning {
  background: rgba(255, 190, 11, 0.1);
  color: darken(var(--sh-warning), 20%);
}

/* simple mixin logic */
.shumokh-edu-wrapper .sh-badge--danger {
  background: rgba(255, 0, 3, 0.1);
  color: var(--sh-danger);
}

.shumokh-edu-wrapper .sh-badge--info {
  background: rgba(45, 137, 239, 0.1);
  color: var(--sh-info);
}

.shumokh-edu-wrapper .sh-badge--neutral {
  background: var(--sh-light);
  color: var(--sh-muted);
  border: 1px solid var(--sh-border);
}

/* 6. Alerts */
.shumokh-edu-wrapper .sh-alert {
  padding: var(--sh-space-md);
  border-radius: var(--sh-radius);
  margin-bottom: var(--sh-space-md);
  display: flex;
  gap: var(--sh-space-sm);
  align-items: flex-start;
  border-inline-start: 4px solid transparent;
}

.shumokh-edu-wrapper .sh-alert--info {
  background: #eef6fc;
  color: #104e8b;
  border-color: var(--sh-info);
}

.shumokh-edu-wrapper .sh-alert--warning {
  background: #fff8e1;
  color: #8a6d3b;
  border-color: var(--sh-warning);
}

.shumokh-edu-wrapper .sh-alert--error {
  background: #fee2e2;
  color: #b91c1c;
  border-color: var(--sh-danger);
}

.shumokh-edu-wrapper .sh-alert--success {
  background: #d1fae5;
  color: #065f46;
  border-color: var(--sh-success);
}

/* 7. Grid System & Utilities */
.shumokh-edu-wrapper .sh-grid {
  display: grid;
  gap: var(--sh-space-lg);
}

.shumokh-edu-wrapper .sh-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.shumokh-edu-wrapper .sh-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.shumokh-edu-wrapper .sh-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive Grid */
@media (max-width: 992px) {
  .shumokh-edu-wrapper .sh-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .shumokh-edu-wrapper .sh-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .shumokh-edu-wrapper .sh-grid--2,
  .shumokh-edu-wrapper .sh-grid--3,
  .shumokh-edu-wrapper .sh-grid--4 {
    grid-template-columns: 1fr;
  }
}

.shumokh-edu-wrapper .sh-flex {
  display: flex;
  gap: var(--sh-space-md);
}

.shumokh-edu-wrapper .sh-flex--wrap {
  flex-wrap: wrap;
}

.shumokh-edu-wrapper .sh-flex--center {
  align-items: center;
}

.shumokh-edu-wrapper .sh-flex--between {
  justify-content: space-between;
}

.shumokh-edu-wrapper .sh-mb-4 {
  margin-bottom: var(--sh-space-md);
}

.shumokh-edu-wrapper .sh-text-center {
  text-align: center;
}

/* 8. Responsive Table (Card View on Mobile) */
.shumokh-edu-wrapper .sh-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.shumokh-edu-wrapper .sh-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sh-space-md);
}

.shumokh-edu-wrapper .sh-table th {
  background: var(--sh-light);
  padding: var(--sh-space-md);
  text-align: start;
  /* Logical property for RTL */
  font-weight: 700;
  color: var(--sh-text-dark);
  border-bottom: 2px solid var(--sh-border);
}

.shumokh-edu-wrapper .sh-table td {
  padding: var(--sh-space-md);
  border-bottom: 1px solid var(--sh-border);
  vertical-align: middle;
}

@media (max-width: 768px) {

  /* Mobile Stacked View */
  .shumokh-edu-wrapper .sh-table,
  .shumokh-edu-wrapper .sh-table tbody,
  .shumokh-edu-wrapper .sh-table tr,
  .shumokh-edu-wrapper .sh-table td {
    display: block;
    width: 100%;
  }

  .shumokh-edu-wrapper .sh-table thead {
    display: none;
  }

  .shumokh-edu-wrapper .sh-table tr {
    margin-bottom: var(--sh-space-md);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: var(--sh-space-md);
    background: #fff;
    box-shadow: var(--sh-shadow-sm);
  }

  .shumokh-edu-wrapper .sh-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--sh-border);
    padding: 8px 0;
    text-align: end;
  }

  .shumokh-edu-wrapper .sh-table td:last-child {
    border-bottom: none;
  }

  .shumokh-edu-wrapper .sh-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--sh-muted);
    text-align: start;
    margin-right: auto;
    /* Push label to start */
    padding-right: 10px;
    /* Space between label and content */
  }
}

/* 9. Empty State */
.shumokh-edu-wrapper .sh-empty {
  text-align: center;
  padding: 40px;
  background: var(--sh-light);
  border-radius: var(--sh-radius);
  border: 2px dashed var(--sh-border);
}

.shumokh-edu-wrapper .sh-empty__icon {
  font-size: 3rem;
  color: var(--sh-muted);
  margin-bottom: var(--sh-space-md);
  opacity: 0.5;
  display: block;
}

.shumokh-edu-wrapper .sh-empty__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* 10. Availability Grid (Time Slots) */
.shumokh-edu-wrapper .sh-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.shumokh-edu-wrapper .sh-slot-btn {
  padding: 10px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.shumokh-edu-wrapper .sh-slot-btn:hover {
  border-color: var(--sh-primary);
  color: var(--sh-primary);
}

.shumokh-edu-wrapper .sh-slot-btn.active {
  background: var(--sh-primary);
  color: #fff;
  border-color: var(--sh-primary);
}

.shumokh-edu-wrapper .sh-slot-btn.disabled {
  background: var(--sh-light);
  color: var(--sh-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* 11. Tabs */
.shumokh-edu-wrapper .sh-tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--sh-border);
  margin-bottom: var(--sh-space-lg);
  overflow-x: auto;
}

.shumokh-edu-wrapper .sh-tab-link {
  padding: 12px 24px;
  font-weight: 600;
  color: var(--sh-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
}

.shumokh-edu-wrapper .sh-tab-link:hover {
  color: var(--sh-primary);
}

.shumokh-edu-wrapper .sh-tab-link.active {
  color: var(--sh-primary);
  border-bottom-color: var(--sh-primary);
}

.shumokh-edu-wrapper .sh-tab-content {
  display: none;
}

.shumokh-edu-wrapper .sh-tab-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

/* --- Admin Dashboard Sidebar Layout --- */
.shumokh-edu-wrapper .sh-admin-layout {
  display: flex;
  gap: var(--sh-space-lg);
  align-items: flex-start;
}

.shumokh-edu-wrapper .sh-admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sh-white);
  border-radius: var(--sh-radius);
  box-shadow: var(--sh-shadow);
  border: 1px solid var(--sh-border);
  position: sticky;
  top: 100px;
  /* Adjust based on theme header */
  overflow: hidden;
  z-index: 10;
}

.shumokh-edu-wrapper .sh-admin-content {
  flex-grow: 1;
  min-width: 0;
  /* Prevent flex overflow */
}

/* Sidebar Navigation */
.shumokh-edu-wrapper .sh-sidebar-nav {
  display: flex;
  flex-direction: column;
}

.shumokh-edu-wrapper .sh-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--sh-text-main);
  text-decoration: none;
  border-left: 3px solid transparent;
  /* RTL: will be right support needed */
  transition: all 0.2s;
  font-weight: 500;
}

.shumokh-edu-wrapper .sh-sidebar-link:hover {
  background: var(--sh-light);
  color: var(--sh-brand-primary);
}

.shumokh-edu-wrapper .sh-sidebar-link.active {
  background: rgba(248, 160, 48, 0.08);
  /* Brand orange low opacity */
  color: var(--sh-brand-primary);
  border-left-color: var(--sh-brand-primary);
}

/* Mobile Sidebar Drawer */
@media (max-width: 992px) {
  .shumokh-edu-wrapper .sh-admin-layout {
    flex-direction: column;
  }

  .shumokh-edu-wrapper .sh-admin-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: 200px;
    /* Or use toggle logic for full drawer */
    overflow-y: auto;
  }
}

/* RTL Support for Sidebar */
[dir="rtl"] .shumokh-edu-wrapper .sh-sidebar-link {
  border-left: none;
  border-right: 3px solid transparent;
}

[dir="rtl"] .shumokh-edu-wrapper .sh-sidebar-link.active {
  border-right-color: var(--sh-brand-primary);
}

/* --- Fluent Forms Overrides (Premium Look) --- */
.shumokh-edu-wrapper .fluentform {
  max-width: 100%;
}

.shumokh-edu-wrapper .fluentform .ff-el-input--content input,
.shumokh-edu-wrapper .fluentform .ff-el-input--content select,
.shumokh-edu-wrapper .fluentform .ff-el-input--content textarea {
  border-radius: var(--sh-radius-sm) !important;
  border: 1px solid var(--sh-border) !important;
  padding: 12px 14px !important;
  min-height: 48px;
  font-size: var(--sh-font-size-base) !important;
  color: var(--sh-text-main) !important;
  background-color: #fff !important;
  transition: all 0.2s ease;
}

.shumokh-edu-wrapper .fluentform .ff-el-input--content input:focus,
.shumokh-edu-wrapper .fluentform .ff-el-input--content select:focus,
.shumokh-edu-wrapper .fluentform .ff-el-input--content textarea:focus {
  border-color: var(--sh-brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(248, 160, 48, 0.15) !important;
  outline: none !important;
}

.shumokh-edu-wrapper .fluentform .ff-el-group {
  margin-bottom: var(--sh-space-md) !important;
}

.shumokh-edu-wrapper .fluentform .ff-el-form-check-label {
  font-weight: 500 !important;
  color: var(--sh-text-main) !important;
}

/* Submit Button Override */
.shumokh-edu-wrapper .fluentform .ff-btn-submit {
  background-color: var(--sh-brand-primary) !important;
  color: #fff !important;
  border-radius: var(--sh-radius-sm) !important;
  padding: 12px 32px !important;
  font-weight: 700 !important;
  border: none !important;
  transition: transform 0.2s !important;
}

.shumokh-edu-wrapper .fluentform .ff-btn-submit:hover {
  background-color: var(--sh-primary-dark) !important;
  transform: translateY(-2px);
}

/* Form Container Style (if wrapper used) */
.shumokh-edu-wrapper .fluentform-widget-wrapper {
  background: #fff;
  padding: var(--sh-space-xl);
  border-radius: var(--sh-radius);
  box-shadow: var(--sh-shadow-sm);
  border: 1px solid var(--sh-border);
}