/**
 * تحسينات عامة — لا تستهدف صفحة الامتحان (.quiz-* / #quiz / table#quiz)
 */

:root {
  --brand-radius-sm: 10px;
  --brand-radius-md: 14px;
  --brand-radius-lg: 18px;
  --brand-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --brand-shadow-md: 0 8px 28px rgba(15, 23, 42, 0.08);
  --brand-transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

/* ——— صفحات بدون شريط علوي ——— */
.app-shell--minimal > .container-lg:first-child,
.app-shell--minimal #btnOffcanvas,
.app-shell--minimal #btnToTop {
  display: none !important;
}

.app-shell--minimal #container {
  min-height: 100vh;
}

.app-shell--minimal.dash-route #container {
  padding: 0;
}

/* ——— تحميل احترافي ——— */
.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 220px;
  color: var(--site-text-muted, #6c757d);
}

.page-loader__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(111, 66, 193, 0.15);
  border-top-color: #6f42c1;
  border-radius: 50%;
  animation: page-loader-spin 0.75s linear infinite;
}

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

/* ——— الصفحة الرئيسية ——— */
#palmix .home-section {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

#palmix .home-section__title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--site-text, #212529);
}

#palmix .home-section__subtitle {
  font-size: 0.95rem;
  color: var(--site-text-muted, #6c757d);
  line-height: 1.7;
}

#palmix .home-section hr {
  border-color: var(--site-border, rgba(0, 0, 0, 0.08));
  opacity: 1;
  margin: 1.25rem 0 1.5rem;
}

#palmix .home-section .itembtnhome {
  min-height: 88px;
  border: 1px solid transparent;
  transition:
    transform var(--brand-transition),
    box-shadow var(--brand-transition),
    border-color var(--brand-transition);
}

#palmix .home-section .itembtnhome:hover {
  transform: translateY(-2px);
  box-shadow: var(--brand-shadow-md);
  border-color: rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

#palmix .tenant-welcome {
  padding: 1.25rem 1rem 0.5rem;
}

#palmix .tenant-welcome__tagline {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--site-text, #212529);
  margin-bottom: 0.35rem;
}

#palmix .tenant-welcome__text {
  font-size: 0.95rem;
  color: var(--site-text-muted, #6c757d);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ——— حركة أنعم للأقسام ——— */
#palmix .containeranimate {
  animation-duration: 0.55s;
}

#palmix {
  transition: opacity 0.35s ease;
}

/* ——— نماذج ——— */
.form-control:focus,
.form-select:focus {
  border-color: rgba(111, 66, 193, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.12);
}

.btn {
  transition:
    background-color var(--brand-transition),
    border-color var(--brand-transition),
    transform var(--brand-transition),
    box-shadow var(--brand-transition);
}

.btn-default:active {
  transform: scale(0.98);
}

/* ——— تنبيهات ——— */
.alert {
  border-radius: var(--brand-radius-sm);
  border-width: 1px;
}

/* ——— صفحات المصادقة ——— */
.auth-page {
  min-height: 100vh;
}

.auth-page__form-inner .card {
  border-radius: var(--brand-radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body[data-color-mode="dark"] .auth-page__form-inner .card {
  background: var(--site-surface, #1e2229);
  border-color: rgba(255, 255, 255, 0.08);
}

.register-school-page .auth-page__form-inner {
  max-width: 720px;
}

/* ——— لوحة التحكم ——— */
.dash-card,
.dash-sidebar,
.dash-stat {
  transition: box-shadow var(--brand-transition);
}

.dash-card:hover {
  box-shadow: var(--brand-shadow-md);
}

.dash-skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: dash-skeleton 1.2s ease-in-out infinite;
  border-radius: var(--brand-radius-sm);
  min-height: 1rem;
}

@keyframes dash-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body[data-color-mode="dark"] .dash-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
}

/* ——— اتصل بنا ——— */
.contact-page {
  background: transparent;
}

body[data-color-mode="light"] #container:has(.contact-page) {
  background: var(--site-page-bg, #eef0f3);
}

body[data-color-mode="dark"] #container:has(.contact-page) {
  background: var(--site-page-bg, #0f1114);
}

/* ——— أزرار عائمة ——— */
#btnOffcanvas,
#btnToTop {
  transition: transform var(--brand-transition), opacity var(--brand-transition);
}

#btnOffcanvas:hover,
#btnToTop:hover {
  transform: translateY(-2px);
}

/* ——— حساب المستخدم ——— */
.profile-page__avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.profile-page__avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 3px solid rgba(var(--bs-default-rgb, 111, 66, 193), 0.25);
}

.profile-page__avatar-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
}

#palmix .navbar .navbar-nav .navbar-auth-link > i {
  display: block;
  text-align: center;
}

#palmix .navbar .navbar-nav .navbar-auth-link > span {
  display: block;
  position: relative;
  top: 3px;
  text-align: center;
}

#palmix .navbar .navbar-nav .navbar-user-avatar-wrap {
  position: relative;
  display: block;
  width: 35px;
  height: 35px;
  margin: 0 auto;
  line-height: 0;
}

#palmix .navbar .navbar-nav .navbar-user-menu .navbar-user__avatar {
  display: block;
  width: 35px;
  height: 35px;
  max-width: 35px;
  max-height: 35px;
  margin: 0;
  object-fit: cover;
  border-radius: 50%;
}

#palmix .navbar .navbar-nav .navbar-user-trigger {
  display: block !important;
  padding: 8px 12px !important;
  line-height: 1;
}

#palmix .navbar .navbar-nav .navbar-user-caret {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  font-size: 10px;
  line-height: 1;
  top: auto;
  text-align: center;
  pointer-events: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.65));
}

#palmix .navbar .navbar-nav .navbar-user-caret.dropdown-toggle::after {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
  border-top-width: 0.28em;
  border-inline-end-width: 0.28em;
  border-inline-start-width: 0.28em;
}

#palmix .navbar .navbar-nav .navbar-user-fallback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-account__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-account__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-account__name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.sidebar-account__email {
  font-size: 0.75rem;
  opacity: 0.8;
  word-break: break-all;
}

.saved-exams__count {
  font-weight: 400;
  opacity: 0.85;
  font-size: 0.9em;
}

.adsense-unit {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  margin: 12px auto;
  overflow: hidden;
}

.adsense-unit--content {
  min-height: 120px;
}

.adsense-unit--exam {
  min-height: 70px;
  margin-top: 14px;
}

.adsense-unit .adsbygoogle {
  width: 100%;
}

.swal2-popup .adsense-unit {
  margin: 14px 0 4px;
}

.adsense-unit {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  margin: 12px auto;
  overflow: hidden;
}

.adsense-unit--content {
  min-height: 120px;
}

.adsense-unit--exam {
  min-height: 70px;
  margin-top: 14px;
}

.adsense-unit .adsbygoogle {
  width: 100%;
}

.swal2-popup .adsense-unit {
  margin: 14px 0 4px;
}
