@import url('../../assets/css/brand.css');

:root {
  --panel-sidebar-w: 268px;
  --panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  color: var(--lx-text);
  background-color: #eef1f7;
  background-image:
    radial-gradient(ellipse 90% 55% at 100% -10%, rgba(255, 84, 56, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at -10% 110%, rgba(19, 34, 77, 0.12), transparent 50%),
    linear-gradient(180deg, #f4f6fb 0%, #e9edf5 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---- Shell ---- */
.panel {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
}

.panel-sidebar {
  width: var(--panel-sidebar-w);
  max-width: 84vw;
  background:
    radial-gradient(ellipse 120% 60% at 0% 0%, rgba(255, 84, 56, 0.22), transparent 50%),
    linear-gradient(180deg, #182a5c 0%, #13224d 48%, #0e1a3c 100%);
  padding: 1.35rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  color: #fff;
  box-shadow: -8px 0 32px rgba(19, 34, 77, 0.18);
  z-index: 30;
}

.panel-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0.35rem 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.panel-logo__icon {
  width: 42px;
  height: 42px;
  background: var(--lx-gradient-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(255, 84, 56, 0.35);
}

.panel-logo__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.panel-logo__name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.panel-logo__tag {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.panel-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.panel-nav__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.35rem 0.85rem 0.45rem;
}

.panel-nav__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  transition: background 0.22s var(--panel-ease), color 0.22s, transform 0.22s var(--panel-ease);
}

.panel-nav__link .lx-icon {
  width: 1.15rem;
  height: 1.15rem;
  opacity: 0.9;
}

.panel-nav__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.panel-nav__link.router-link-active {
  background: rgba(255, 84, 56, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-coral);
}

.panel-sidebar__foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.panel-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.35rem;
  min-width: 0;
}

.panel-user__avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 84, 56, 0.2);
  color: #ffb4a6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.panel-user__meta {
  min-width: 0;
  line-height: 1.45;
}

.panel-user__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-user__phone {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.panel-sidebar__foot .lx-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.panel-sidebar__foot .lx-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.panel-main {
  flex: 1;
  min-width: 0;
  padding: clamp(1.15rem, 3vw, 2.25rem);
  animation: panelFadeIn 0.45s var(--panel-ease) both;
}

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

/* ---- Page chrome ---- */
.panel-page__head {
  margin-bottom: 1.35rem;
}

.panel-page__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.panel-page__sub {
  margin: 0;
  color: var(--lx-text-secondary);
  line-height: 1.7;
  max-width: 42rem;
}

.panel-section-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-navy);
}

/* ---- Dashboard hero ---- */
.panel-dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: clamp(1.25rem, 3vw, 1.85rem);
  margin-bottom: 1.25rem;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(255, 84, 56, 0.45), transparent 55%),
    linear-gradient(135deg, #1a2f66 0%, #13224d 55%, #101c42 100%);
  box-shadow: var(--lx-shadow-md);
}

.panel-dash-hero::after {
  content: '';
  position: absolute;
  inset: auto -10% -40% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.panel-dash-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
}

.panel-dash-hero__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.panel-dash-hero__desc {
  margin: 0;
  opacity: 0.78;
  line-height: 1.7;
  max-width: 34rem;
  position: relative;
  z-index: 1;
}

.panel-dash-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  position: relative;
  z-index: 1;
}

.panel-dash-hero__actions .lx-btn--gold {
  box-shadow: 0 8px 22px rgba(255, 84, 56, 0.35);
}

.panel-dash-hero__actions .lx-btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.panel-dash-hero__actions .lx-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ---- Stats ---- */
.panel-hero-stat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
  gap: 0.9rem;
  margin-bottom: 1.15rem;
}

.panel-stat {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.15rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(19, 34, 77, 0.07);
  box-shadow: var(--lx-shadow-sm);
  backdrop-filter: blur(8px);
  transition: transform 0.25s var(--panel-ease), box-shadow 0.25s;
}

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

.panel-stat__icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.7rem;
  background: var(--brand-coral-muted);
  color: var(--brand-coral);
}

.panel-stat__icon .lx-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.panel-stat:nth-child(2) .panel-stat__icon {
  background: var(--brand-navy-muted);
  color: var(--brand-navy);
}

.panel-stat:nth-child(3) .panel-stat__icon {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.panel-stat:nth-child(4) .panel-stat__icon {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.panel-stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 0.15rem;
  letter-spacing: -0.02em;
}

.panel-stat span {
  font-size: 0.82rem;
  color: var(--lx-muted);
  font-weight: 600;
}

/* ---- Progress / surfaces ---- */
.panel-surface {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(19, 34, 77, 0.07);
  box-shadow: var(--lx-shadow-sm);
  padding: 1.15rem 1.25rem;
  backdrop-filter: blur(8px);
}

.panel-progress {
  margin: 0 0 1.25rem;
}

.panel-progress__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--brand-navy);
}

.panel-progress__track {
  height: 12px;
  border-radius: 999px;
  background: rgba(19, 34, 77, 0.08);
  overflow: hidden;
}

.panel-progress__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--lx-gradient-accent);
  transition: width 0.55s var(--panel-ease);
  box-shadow: 0 0 12px rgba(255, 84, 56, 0.35);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
  align-items: center;
}

/* ---- Lessons ---- */
.panel-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.panel-lesson-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 72px;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(19, 34, 77, 0.07);
  box-shadow: var(--lx-shadow-sm);
  text-decoration: none;
  color: inherit;
  max-width: 100%;
  transition: transform 0.22s var(--panel-ease), box-shadow 0.22s, border-color 0.22s;
}

a.panel-lesson-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--lx-shadow-md);
  border-color: rgba(255, 84, 56, 0.28);
}

.panel-lesson-row--locked {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.panel-lesson-row--locked:hover {
  transform: none;
  box-shadow: var(--lx-shadow-sm);
  border-color: rgba(19, 34, 77, 0.07);
}

.panel-lesson-row__num {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(19, 34, 77, 0.1), rgba(19, 34, 77, 0.04));
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.panel-lesson-row__num .lx-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--brand-coral);
}

.panel-lesson-row__body {
  flex: 1;
  min-width: 0;
}

.panel-lesson-row__title {
  margin: 0 0 0.25rem;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--brand-navy);
}

.panel-lesson-row__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--lx-muted);
  font-weight: 500;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--brand-navy-muted);
  color: var(--brand-navy);
  flex-shrink: 0;
}

.panel-badge--ok {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.panel-badge--warn {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

/* ---- Lesson player / exam ---- */
.panel-lesson-body {
  max-width: min(760px, 100%);
  line-height: 1.9;
  font-size: 1.03rem;
}

.panel-lesson-body.lx-card,
.lx-card.panel-exam-card {
  border-radius: 18px;
  border: 1px solid rgba(19, 34, 77, 0.07);
  box-shadow: var(--lx-shadow-sm);
  background: rgba(255, 255, 255, 0.95);
}

.panel-lesson-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.panel-lesson-sentinel {
  height: 1px;
  width: 100%;
}

.panel-video {
  width: 100%;
  max-width: min(900px, 100%);
  border-radius: 18px;
  background: #0b1228;
  aspect-ratio: 16 / 9;
  box-shadow: var(--lx-shadow-md);
}

.panel-read-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  margin: 0.85rem 0 1rem;
  font-size: 0.84rem;
  color: var(--lx-muted);
  font-weight: 600;
}

.panel-exam-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.panel-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0;
}

.panel-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 52px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--lx-border);
  background: #fff;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: 1.65;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--panel-ease);
}

.panel-option:hover {
  border-color: rgba(255, 84, 56, 0.35);
  transform: translateX(-2px);
}

.panel-option--on {
  border-color: var(--brand-coral);
  background: rgba(255, 84, 56, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 84, 56, 0.1);
}

.panel-option__check {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  border: 2px solid var(--lx-border);
  transition: background 0.2s, border-color 0.2s;
}

.panel-option--on .panel-option__check {
  border-color: var(--brand-coral);
  background: var(--brand-coral);
  box-shadow: inset 0 0 0 2px #fff;
}

.panel-option__text {
  flex: 1;
  min-width: 0;
  font-family: inherit;
}

.panel-option__text p {
  margin: 0;
}

/* ---- Gate / auth / payment ---- */
.panel-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

.panel-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 10%, rgba(255, 84, 56, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(19, 34, 77, 0.14), transparent 45%);
  pointer-events: none;
}

.panel-gate__card {
  width: min(460px, 100%);
  position: relative;
  z-index: 1;
  border-radius: 22px !important;
  padding: 1.5rem 1.4rem !important;
  border: 1px solid rgba(19, 34, 77, 0.08);
  box-shadow: var(--lx-shadow-lg);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  animation: panelFadeIn 0.5s var(--panel-ease) both;
}

.panel-gate__card .panel-page__title {
  font-size: 1.55rem;
}

.panel-methods {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1rem 0;
}

.panel-method {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--lx-border);
  background: #fff;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--panel-ease);
}

.panel-method:hover {
  border-color: rgba(255, 84, 56, 0.35);
  transform: translateY(-1px);
}

.panel-method--on {
  border-color: var(--brand-coral);
  box-shadow: 0 0 0 3px rgba(255, 84, 56, 0.14);
  background: rgba(255, 84, 56, 0.04);
}

.panel-method__label {
  font-family: inherit;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--brand-navy);
}

.panel-method__body {
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--lx-text-secondary);
  line-height: 1.7;
}

.panel-method__body,
.panel-method__body * {
  font-family: inherit;
}

.panel-wait {
  text-align: center;
  padding: 1.5rem 0.5rem 0.5rem;
}

.panel-wait__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-coral-muted);
  color: var(--brand-coral);
  animation: panelPulse 2.2s ease-in-out infinite;
}

.panel-wait__icon .lx-icon {
  width: 1.75rem;
  height: 1.75rem;
}

@keyframes panelPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@media (max-width: 820px) {
  .panel {
    flex-direction: column;
  }

  .panel-sidebar {
    width: 100%;
    max-width: none;
    height: auto;
    position: relative;
    padding-bottom: 1rem;
  }

  .panel-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .panel-nav__label {
    width: 100%;
  }

  .panel-nav__link {
    flex: 1 1 calc(50% - 0.3rem);
  }

  .panel-nav__link.router-link-active {
    box-shadow: none;
  }

  .panel-sidebar__foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .panel-sidebar__foot .lx-btn {
    width: auto;
    flex-shrink: 0;
  }

  .panel-user {
    flex: 1;
    min-width: 0;
  }
}
