/* Admin Panel */
.admin-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
}

.admin-panel * { pointer-events: auto; }

.admin-panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(12,12,20,0.95) 0%, rgba(5,5,8,0.98) 100%);
  border-top: 1px solid rgba(124,58,237,0.35);
  backdrop-filter: blur(20px);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}

.admin-panel__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.15));
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-panel__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,0.3);
}

.admin-panel__quick {
  display: flex;
  gap: 8px;
}

.admin-quick {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.admin-quick:hover {
  background: rgba(124,58,237,0.2);
  transform: scale(1.05);
}

.admin-panel__drawer {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  max-height: 0;
  overflow: hidden;
  background: rgba(8,8,14,0.98);
  border-top: 1px solid rgba(124,58,237,0.2);
  backdrop-filter: blur(24px);
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lang select & grid */
.lang-select {
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 160px;
}

.lang-select option {
  background: var(--bg-3);
  color: var(--text);
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.lang-grid__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-grid__btn:hover,
.lang-grid__btn.active {
  background: rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.45);
  color: var(--text);
}

.lang-grid__flag { font-size: 1.3rem; }
.lang-grid__name { line-height: 1.2; text-align: center; }

@media (max-width: 768px) {
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-select { max-width: 120px; font-size: 0.75rem; }
}

/* RTL support (Urdu) */
html[dir="rtl"] .header__inner { flex-direction: row-reverse; }
html[dir="rtl"] .about-feature { flex-direction: row-reverse; }
html[dir="rtl"] .timeline__item { flex-direction: row-reverse; }
html[dir="rtl"] .contact-link { flex-direction: row-reverse; }
html[dir="rtl"] .page-back::before { content: '→'; }
html[dir="rtl"] .page-back { direction: rtl; }

.admin-panel__drawer.open {
  max-height: 680px;
  overflow-y: auto;
}


.admin-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-panel__header strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.admin-panel__header span {
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-panel__close {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.admin-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}

.admin-toggle {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
}

.admin-toggle--wide { grid-column: span 2; }

.admin-toggle label:first-child {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.admin-segment {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-segment button {
  flex: 1;
  min-width: 60px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-segment button.active,
.admin-segment button:hover {
  background: rgba(124,58,237,0.25);
  border-color: rgba(124,58,237,0.5);
  color: #fff;
}

.admin-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  align-self: flex-end;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch__slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 28px;
  cursor: pointer;
  transition: 0.3s;
}

.switch__slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .switch__slider {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.switch input:checked + .switch__slider::before {
  transform: translateX(24px);
}

.admin-panel__actions {
  padding: 0 24px 20px;
  display: flex;
  justify-content: flex-end;
}

/* Mobile bottom nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  z-index: 150;
  background: rgba(8,8,14,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 4px;
  overflow-x: auto;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-nav::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
  .mobile-nav { display: none !important; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition: color 0.2s;
  min-width: 0;
}

.mobile-nav__item.active { color: var(--primary-light); }

.mobile-nav__icon { font-size: 1.2rem; }

/* Lang toggle in header */
.lang-toggle {
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-toggle:hover { background: rgba(124,58,237,0.15); }

.nav a.active {
  color: #6D28D9;
  font-weight: 600;
}

.nav a.active::after { transform: scaleX(1); }

/* Page hero for subpages */
.page-hero {
  padding: 140px 0 60px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124,58,237,0.12), transparent),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 20px;
  transition: color 0.2s;
}

.page-back:hover { color: var(--primary-light); }

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Home page menu cards */
.menu-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 80px 0;
}

.menu-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
}

.menu-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124,58,237,0.35);
  box-shadow: var(--glow);
}

.menu-card__icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.menu-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.menu-card p {
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
  margin-bottom: 16px;
}

.menu-card__arrow {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
}

/* Mobile preview mode */
.mobile-preview-frame {
  min-height: 100vh;
}

body.mobile-preview {
  background: #1a1a2e;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 24px 100px;
}

body.mobile-preview .mobile-preview-frame {
  width: 390px;
  max-width: 100%;
  min-height: 844px;
  padding-bottom: 120px;
  background: var(--bg);
  border-radius: 40px;
  border: 8px solid #222;
  box-shadow: 0 0 0 2px #444, 0 40px 100px rgba(0,0,0,0.6);
  overflow: hidden;
  overflow-y: auto;
  position: relative;
  transform: translateZ(0);
  isolation: isolate;
}

body.mobile-preview .mobile-preview-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #222;
  border-radius: 0 0 16px 16px;
  z-index: 300;
}

body.mobile-preview .mobile-nav {
  display: grid !important;
  left: 0;
  right: 0;
  bottom: 56px;
  border-radius: 0;
}

body.mobile-preview .whatsapp-btn,
body.mobile-preview .sticky-quote {
  display: none !important;
}

/* Simulate mobile breakpoints inside the phone frame (media queries use viewport width) */
body.mobile-preview .burger {
  display: flex !important;
}

body.mobile-preview .header__actions {
  display: none !important;
}

body.mobile-preview .header .burger {
  margin-left: auto;
}

body.mobile-preview .nav {
  position: absolute;
  top: calc(var(--header-h, 72px) + 8px);
  left: 8px;
  right: 8px;
  bottom: auto;
  max-height: min(65vh, calc(100% - var(--header-h, 72px) - 24px));
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 200;
}

body.mobile-preview .nav.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

body.mobile-preview .nav a {
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  text-align: left;
}

body.mobile-preview .nav a::after {
  display: none;
}

body.mobile-preview .corp-hero__grid {
  grid-template-columns: 1fr !important;
  min-height: auto;
  padding: 48px 0 40px;
}

body.mobile-preview .corp-hero__visual {
  max-width: 100%;
  margin: 0 auto;
}

body.mobile-preview .corp-macbook {
  transform: none !important;
  animation: none !important;
}

body.mobile-preview .corp-float {
  display: none;
}

body.mobile-preview .corp-hero__features {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  padding-top: 24px !important;
}

body.mobile-preview .corp-stats {
  flex-wrap: wrap;
  gap: 20px;
}

body.mobile-preview .corp-stat {
  flex: 0 0 45%;
}

body.mobile-preview .corp-stat__sep {
  display: none;
}

body.mobile-preview .corp-process {
  grid-template-columns: 1fr !important;
}

body.mobile-preview .corp-process--timeline::before {
  display: none;
}

body.mobile-preview .corp-trust-brands__grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

body.mobile-preview .corp-services--five,
body.mobile-preview .corp-pricing,
body.mobile-preview .corp-reviews,
body.mobile-preview .corp-guarantee {
  grid-template-columns: 1fr !important;
}

body.mobile-preview .corp-payment-shell {
  grid-template-columns: 1fr !important;
}

body.mobile-preview .portfolio-grid {
  grid-template-columns: 1fr !important;
}

/* Internal menu pages inside phone preview */
body.mobile-preview .page-hero__grid,
body.mobile-preview .about-split,
body.mobile-preview .about-value-grid,
body.mobile-preview .contact-grid,
body.mobile-preview .services-grid,
body.mobile-preview .page-process,
body.mobile-preview .about-showcase,
body.mobile-preview .pricing-grid,
body.mobile-preview .reviews-grid--page,
body.mobile-preview .form-row {
  grid-template-columns: 1fr !important;
}

body.mobile-preview .page-trustbar__inner {
  flex-wrap: nowrap;
  overflow-x: auto;
  justify-content: flex-start;
}

body.mobile-preview .page-hero__visual {
  max-width: 100%;
  min-height: 200px;
}

body.mobile-preview .about-mosaic {
  grid-template-rows: 100px 100px;
}

body.mobile-preview .about-stats-panel {
  grid-template-columns: repeat(2, 1fr) !important;
}

body.mobile-preview .trust-grid {
  grid-template-columns: 1fr !important;
}

body.mobile-preview .payment-groups,
body.mobile-preview .payment-grid {
  grid-template-columns: 1fr !important;
}

body.mobile-preview .legal-docs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.mobile-preview .page-banner--contact {
  min-height: 180px;
}

body.mobile-preview .reviews-filter {
  flex-wrap: wrap;
  gap: 8px;
}

body.mobile-preview .page-cta-band__inner {
  flex-direction: column;
  text-align: center;
}

body.mobile-preview .footer__grid {
  grid-template-columns: 1fr !important;
  text-align: center;
}

body.mobile-preview .admin-panel {
  left: 50%;
  transform: translateX(-50%);
  width: 390px;
  max-width: 100%;
}

/* Light theme */
body[data-theme="light"] {
  --bg: #f8f9fc;
  --bg-2: #eef0f6;
  --bg-3: #fff;
  --card: rgba(255,255,255,0.9);
  --card-hover: #fff;
  --text: #0f0f1a;
  --muted: #5a5a72;
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --shadow: 0 24px 80px rgba(0,0,0,0.1);
  --glow: 0 0 60px rgba(124,58,237,0.08);
}

body[data-theme="light"]:not([data-page="home"]) .header.scrolled {
  background: rgba(248,249,252,0.9);
}

body[data-theme="light"] .admin-panel__bar {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,249,252,0.98));
  border-top-color: rgba(124,58,237,0.2);
}

body[data-theme="light"] .form-group input,
body[data-theme="light"] .form-group select,
body[data-theme="light"] .form-group textarea {
  background: rgba(0,0,0,0.03);
}

/* Font sizes */
body[data-font="sm"] { font-size: 14px; }
body[data-font="md"] { font-size: 16px; }
body[data-font="lg"] { font-size: 18px; }

/* Compact mode */
body.compact .section { padding: 60px 0; }
body.compact .hero { min-height: auto; padding-bottom: 0; }

/* High contrast */
body.high-contrast {
  --border: rgba(255,255,255,0.25);
  --border-light: rgba(255,255,255,0.4);
  --muted: #aaa;
}

body.high-contrast[data-theme="light"] {
  --border: rgba(0,0,0,0.3);
  --text: #000;
}

/* No animations */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

body.no-animations .reveal {
  opacity: 1;
  transform: none;
}

/* Body padding only when preview panel is shown */
body.has-admin-panel {
  padding-bottom: 56px;
}

@media (max-width: 768px) {
  .admin-panel__grid {
    grid-template-columns: 1fr;
  }

  .admin-toggle--wide { grid-column: span 1; }

  .menu-cards { grid-template-columns: 1fr; }

  .header__phone { display: none; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}
