/**
 * eXthus Apps Portal — page-specific overrides (light theme)
 */

/* WHMCS utility overrides */
body.exthus-portal .bg-light { background-color: var(--ex-panel-2) !important; }
body.exthus-portal .bg-white { background-color: var(--ex-panel) !important; }
body.exthus-portal .border { border-color: var(--ex-line) !important; }
body.exthus-portal .text-dark { color: var(--ex-text) !important; }
body.exthus-portal hr { border-color: var(--ex-line); }
body.exthus-portal .dropdown-divider { border-color: var(--ex-line); }
body.exthus-portal pre,
body.exthus-portal code {
  background: var(--ex-panel-2);
  color: var(--ex-link);
  border-radius: 6px;
}

/* Hide WHMCS powered-by injection in page content */
body.exthus-portal .exthus-content > p[style*="text-align:center"],
body.exthus-portal .primary-content > p[style*="text-align:center"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding:  0 !important;
  overflow: hidden !important;
}

/* Homepage full-bleed */
body.exthus-homepage .exthus-main--home {
  padding-top: 0;
  padding-bottom: 0;
}
body.exthus-homepage .exthus-home-wrap,
body.exthus-homepage .exthus-layout,
body.exthus-homepage .exthus-content.primary-content {
  max-width: none;
  padding: 0;
  background: transparent;
}
body.exthus-homepage .exthus-hero {
  width: 100%;
}

/* Homepage sections (marketing-style blocks inside WHMCS) */
.exthus-hero {
  position: relative;
  padding: clamp(56px, 8vw, 88px) 24px clamp(48px, 6vw, 72px);
  background: var(--ex-chrome);
  color: var(--ex-text-on-dark);
  overflow: hidden;
  text-align: center;
}
.exthus-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(143, 224, 0, 0.14) 0%, transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(143, 224, 0, 0.06) 0%, transparent 40%);
  pointer-events: none;
}
.exthus-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 80%);
  pointer-events: none;
}
.exthus-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}
.exthus-eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ex-lime-soft);
  border: 1px solid rgba(143, 224, 0, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ex-lime);
}
.exthus-hero-title {
  margin: 0 0 20px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--ex-text-on-dark);
}
.exthus-hero-lead {
  margin: 0 auto 32px;
  max-width: 560px;
  font-size: 1.1rem;
  color: var(--ex-muted-on-dark);
  line-height: 1.65;
}
.exthus-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.exthus-hero .btn-primary {
  box-shadow: 0 1px 6px rgba(143, 224, 0, 0.2);
}
.exthus-hero .btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}
.exthus-hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}
.text-lime { color: var(--ex-lime); }

.exthus-section {
  padding: clamp(40px, 6vw, 56px) 24px;
}
.exthus-section--surface { background: var(--ex-panel); }
.exthus-section--muted { background: var(--ex-panel-2); }
.exthus-section-header { margin-bottom: 28px; }
.exthus-section-header--center { text-align: center; }
.exthus-section-title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.exthus-section-lead {
  margin: 0 auto;
  max-width: 620px;
  color: var(--ex-muted);
  font-size: 1.05rem;
}

.exthus-app-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: var(--ex-wrap);
  margin: 0 auto;
}
.exthus-app-card {
  flex: 1 1 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--ex-panel);
  border: 1px solid var(--ex-line);
  border-radius: var(--ex-radius);
  box-shadow: var(--ex-shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.exthus-section--surface .exthus-app-card { background: var(--ex-bg); }
.exthus-app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ex-shadow-lg);
  border-color: rgba(143, 224, 0, 0.35);
}
.exthus-app-card__badge {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ex-muted);
}
.exthus-app-card__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.exthus-app-card__text {
  margin: 0 0 24px;
  flex: 1;
  color: var(--ex-muted);
  line-height: 1.6;
}
.exthus-app-card__cta { align-self: flex-start; }

.exthus-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  max-width: var(--ex-wrap);
  margin: 0 auto;
}
.exthus-link-grid--compact {
  max-width: 720px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.exthus-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  background: var(--ex-panel);
  border: 1px solid var(--ex-line);
  border-radius: var(--ex-radius-sm);
  box-shadow: none;
  text-align: center;
  text-decoration: none !important;
  color: var(--ex-text) !important;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.exthus-link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ex-shadow);
  border-color: rgba(143, 224, 0, 0.35);
  color: var(--ex-text) !important;
  background: var(--ex-panel);
}
.exthus-link-card--accent {
  border-color: var(--ex-line);
  background: var(--ex-panel);
}
.exthus-link-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ex-panel-2);
  font-size: 1.15rem;
  color: var(--ex-link);
}
.exthus-link-card--accent .exthus-link-card__icon {
  background: var(--ex-panel-2);
  color: var(--ex-link);
}
.exthus-link-card__label {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Store group header */
body.exthus-portal .header-lined {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ex-line);
}
body.exthus-portal .header-lined h1,
body.exthus-portal .header-lined h2 {
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
body.exthus-portal .header-lined p {
  color: var(--ex-muted);
  margin: 0;
  font-size: 1.05rem;
}

/* Sidebar panels */
body.exthus-portal .exthus-sidebar .panel-sidebar > .panel-heading,
body.exthus-portal .sidebar .panel-sidebar > .panel-heading {
  background: var(--ex-panel-2);
  border-radius: var(--ex-radius-sm) var(--ex-radius-sm) 0 0;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ex-muted);
}
body.exthus-portal .sidebar .panel-sidebar .list-group-item {
  font-weight: 500;
}

/* OAuth */
body.exthus-portal #header {
  background: var(--ex-panel);
  border-bottom: 1px solid var(--ex-line);
  padding: 20px 0;
}

@media (max-width: 767.98px) {
  .exthus-hero { padding: 48px 20px 56px; }
  .exthus-section { padding: 40px 20px; }
  .exthus-link-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Override WHMCS default rotated admin tab on homepage */
@media (min-width: 768px) {
  body.exthus-portal .btn-return-to-admin,
  body.exthus-portal .btn-return-to-admin.floating,
  body.exthus-portal a.btn-return-to-admin {
    top: auto !important;
    right: 16px !important;
    transform: none !important;
    transform-origin: unset !important;
    border-radius: 999px !important;
  }
}

/* Homepage polish — beat body.exthus-portal h1 / theme.css cascade */
body.exthus-portal.exthus-homepage .exthus-hero .exthus-hero-title,
body.exthus-portal .exthus-hero .exthus-hero-title {
  color: var(--ex-text-on-dark) !important;
}
body.exthus-portal .exthus-hero .btn-primary,
body.exthus-portal .exthus-app-card .btn-primary {
  box-shadow: 0 1px 6px rgba(143, 224, 0, 0.2) !important;
}
body.exthus-portal .exthus-hero .btn-primary:hover,
body.exthus-portal .exthus-app-card .btn-primary:hover {
  box-shadow: 0 2px 10px rgba(143, 224, 0, 0.26) !important;
}
body.exthus-portal .exthus-hero .btn-secondary,
body.exthus-portal .exthus-hero .btn-secondary:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}
body.exthus-portal .exthus-hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}
body.exthus-portal .exthus-app-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
}
body.exthus-portal .exthus-app-card {
  flex: 0 1 360px !important;
  max-width: 360px !important;
  width: 100%;
}
