/* =========================================================
   Tasavvuf Theme v2 — Professional enhancement layer
   ========================================================= */

body.theme-v2 {
  --v2-radius-lg: 12px;
  --v2-shadow-elevated: 0 12px 40px rgba(15, 46, 36, 0.12);
  --v2-border-ornament: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Visible v2 edition marker */
.v2-edition-badge {
  position: fixed;
  top: 5.5rem;
  right: 1rem;
  z-index: 999;
  padding: 0.35rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

html[dir="rtl"] .v2-edition-badge {
  right: auto;
  left: 1rem;
}

/* ── Global ornamental texture ── */
body.theme-v2::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%230f2e24' stroke-width='0.5'%3E%3Cpath d='M60 0 L120 60 L60 120 L0 60Z'/%3E%3Cpath d='M60 15 L105 60 L60 105 L15 60Z'/%3E%3Ccircle cx='60' cy='60' r='18'/%3E%3Cpath d='M60 30 L90 60 L60 90 L30 60Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}

body.theme-v2 #main-content {
  position: relative;
  z-index: 1;
}

/* ── Navbar v2 ── */
body.theme-v2 #navbar.scrolled {
  background: rgba(10, 31, 24, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gold-muted);
}

body.theme-v2 #nav-links a.active-link {
  color: var(--gold-light);
}

body.theme-v2 #nav-links a.active-link::after {
  width: 100%;
  background: var(--gold);
}

/* ── Hero v2 ── */
body.theme-v2 #hero {
  position: relative;
}

body.theme-v2 #hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--v2-border-ornament);
  opacity: 0.6;
}

body.theme-v2 .hero-inner {
  max-width: 1280px;
  gap: 3.5rem;
}

body.theme-bg-custom.theme-v2 .hero-inner {
  max-width: none !important;
  gap: 0 !important;
  column-gap: 0 !important;
}

body.theme-v2 .hero-avatar-wrap {
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
}

body.theme-v2 .hero-avatar::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(232, 212, 139, 0.35);
  pointer-events: none;
  z-index: 3;
}

body.theme-v2 .hero-scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  animation: v2PulseHint 2.5s ease-in-out infinite;
}

body.theme-v2 .hero-scroll-hint svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
}

@keyframes v2PulseHint {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(4px); }
}

/* ── Wisdom band v2 ── */
body.theme-v2 #wisdom {
  position: relative;
  padding: 4rem 0;
  background:
    linear-gradient(90deg, var(--green-dark) 0%, var(--green-mid) 50%, var(--green-dark) 100%);
  border-block: 3px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent) 1;
}

body.theme-v2 #wisdom .wisdom-quote p {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 2;
  max-width: 900px;
  margin-inline: auto;
}

body.theme-v2 #wisdom .wisdom-quote cite {
  display: block;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

/* ── Section frames & alternating bands ── */
body.theme-v2 section.section-v2 {
  position: relative;
}

body.theme-v2 section.section-v2 > .container,
body.theme-v2 section.section-v2 > .section-header-wrap {
  position: relative;
}

body.theme-v2 #about,
body.theme-v2 #projects,
body.theme-v2 #contact {
  background: var(--white);
}

body.theme-v2 #career,
body.theme-v2 #publications,
body.theme-v2 #courses {
  background: var(--cream);
}

body.theme-v2 #expertise {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

body.theme-v2 .section-header-wrap {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

body.theme-v2 .section-ornament-top {
  margin-bottom: 1.25rem;
}

body.theme-v2 .section-ornament-top svg {
  width: 56px;
  height: 56px;
}

body.theme-v2 .section-title {
  position: relative;
  display: inline-block;
}

body.theme-v2 .section-title::after {
  content: '';
  display: block;
  width: 60%;
  height: 2px;
  margin: 0.75rem auto 0;
  background: var(--v2-border-ornament);
}

body.theme-v2 .section-label {
  display: inline-block;
  padding: 0.35rem 1rem;
  border: 1px solid var(--gold-muted);
  border-radius: 4px;
  background: rgba(201, 162, 39, 0.06);
}

/* Corner ornaments on major sections */
body.theme-v2 .section-corners {
  position: absolute;
  inset: 1.5rem;
  pointer-events: none;
  z-index: 0;
}

body.theme-v2 .section-corners span {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: var(--gold-muted);
  border-style: solid;
  opacity: 0.5;
}

body.theme-v2 .section-corners span:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; }
body.theme-v2 .section-corners span:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; }
body.theme-v2 .section-corners span:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
body.theme-v2 .section-corners span:nth-child(4) { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

/* ── Cards & timeline v2 ── */
body.theme-v2 .info-card,
body.theme-v2 .expertise-card,
body.theme-v2 .project-card,
body.theme-v2 .course-card {
  border-radius: var(--v2-radius-lg);
  box-shadow: var(--v2-shadow-elevated);
  border: 1px solid rgba(201, 162, 39, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

body.theme-v2 .info-card:hover,
body.theme-v2 .expertise-card:hover,
body.theme-v2 .project-card:hover,
body.theme-v2 .course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(15, 46, 36, 0.14);
  border-color: var(--gold-muted);
}

body.theme-v2 .timeline-item {
  border-radius: var(--v2-radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--gold);
}

body.theme-v2 .pub-item {
  border-radius: var(--v2-radius-lg);
  border: 1px solid rgba(201, 162, 39, 0.12);
  transition: border-color 0.25s, box-shadow 0.25s;
}

body.theme-v2 .pub-item:hover {
  border-color: var(--gold-muted);
  box-shadow: var(--v2-shadow-elevated);
}

body.theme-v2 .pub-tabs {
  gap: 0.5rem;
  padding: 0.35rem;
  background: rgba(15, 46, 36, 0.06);
  border-radius: 50px;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
}

body.theme-v2 .pub-tab {
  border-radius: 50px;
  transition: all 0.25s ease;
}

body.theme-v2 .pub-tab.active {
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.25);
}

/* ── Highlight & quote blocks ── */
body.theme-v2 .highlight-item {
  border-radius: var(--v2-radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

body.theme-v2 .quote-block {
  border-radius: var(--v2-radius-lg);
  border: 1px solid var(--gold-muted);
  background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%);
  padding: 2rem;
  position: relative;
}

body.theme-v2 .quote-block::before {
  content: '﷽';
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--font-arabesque);
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.35;
}

html[dir="rtl"] body.theme-v2 .quote-block::before {
  right: auto;
  left: 1.25rem;
}

/* ── Profile cards v2 ── */
body.theme-v2 .profile-card {
  border-radius: var(--v2-radius-lg);
}

/* ── Section navigation (side dots) ── */
.section-nav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 997;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  background: rgba(15, 46, 36, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gold-muted);
  border-radius: 50px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.section-nav.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Show section nav sooner & brighter */
body.theme-v2 .section-nav {
  opacity: 1;
  visibility: visible;
  top: 50%;
  background: rgba(10, 31, 24, 0.92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

@media (max-width: 1100px) {
  body.theme-v2 .section-nav {
    display: none !important;
  }
}

.section-nav-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(232, 212, 139, 0.5);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  position: relative;
}

.section-nav-btn:hover,
.section-nav-btn.active {
  background: var(--gold);
  border-color: var(--gold-light);
  transform: scale(1.25);
}

.section-nav-btn::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  background: var(--green-dark);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid var(--gold-muted);
}

.section-nav-btn:hover::after,
.section-nav-btn:focus-visible::after {
  opacity: 1;
}

html[dir="rtl"] .section-nav {
  right: auto;
  left: 1.25rem;
}

html[dir="rtl"] .section-nav-btn::after {
  right: auto;
  left: calc(100% + 10px);
}

/* ── Footer v2 ── */
body.theme-v2 footer {
  position: relative;
  background: linear-gradient(180deg, var(--green-dark) 0%, #0a1f18 100%);
}

body.theme-v2 footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--v2-border-ornament);
}

body.theme-v2 .footer-motto {
  font-family: var(--font-arabesque);
  font-size: 1.1rem;
}

/* ── Dark mode v2 ── */
body.theme-v2.theme-dark {
  background: #0d1a14;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201, 162, 39, 0.06), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='0.3' opacity='0.2'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40Z'/%3E%3C/g%3E%3C/svg%3E");
}

body.theme-v2.theme-dark #about,
body.theme-v2.theme-dark #projects,
body.theme-v2.theme-dark #contact {
  background: #142820;
}

body.theme-v2.theme-dark #career,
body.theme-v2.theme-dark #publications,
body.theme-v2.theme-dark #courses {
  background: #111f19;
}

body.theme-v2.theme-dark .info-card,
body.theme-v2.theme-dark .timeline-item,
body.theme-v2.theme-dark .pub-item {
  background: #1a2e26;
  border-color: rgba(201, 162, 39, 0.2);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  body.theme-v2 .hero-scroll-hint { animation: none; }
  body.theme-v2 .info-card:hover,
  body.theme-v2 .expertise-card:hover { transform: none; }
}

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

@media (max-width: 768px) {
  body.theme-v2 .section-corners { display: none; }
}

@media print {
  .section-nav { display: none !important; }
  body.theme-v2 .hero-scroll-hint { display: none; }
}
