/* =====================================================
   REDESIGN — Modern Academic Portfolio
   Aboul Hassane Cisse
   ===================================================== */

/* ---- 1. Variables ---- */
:root {
  --accent:        #bd5d38;
  --accent-dark:   #a04d2e;
  --accent-light:  #f0916a;
  --nav-bg:        rgba(10, 18, 36, 0.97);
  --nav-height:    64px;

  /* Light mode */
  --bg:            #f8fafc;
  --bg-alt:        #ffffff;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --heading:       #0f172a;
  --border:        #e2e8f0;
  --card-bg:       #ffffff;
  --card-shadow:   0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.04);
  --input-bg:      #ffffff;
  --tag-bg:        #f1f5f9;
  --tag-text:      #475569;
}

[data-theme="dark"] {
  --bg:            #0f172a;
  --bg-alt:        #1e293b;
  --text:          #e2e8f0;
  --text-muted:    #94a3b8;
  --heading:       #f1f5f9;
  --border:        #334155;
  --card-bg:       #1e293b;
  --card-shadow:   0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
  --input-bg:      #1e293b;
  --tag-bg:        #334155;
  --tag-text:      #cbd5e1;
}

/* ---- 2. Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  padding-left: 0 !important;
  padding-top: var(--nav-height);
  transition: background-color 0.3s ease, color 0.3s ease;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading) !important;
  font-family: 'Inter', sans-serif !important;
}

a { color: var(--accent); transition: color 0.2s; }
a:hover { color: var(--accent-dark); }
[data-theme="dark"] a { color: var(--accent-light); }
[data-theme="dark"] a:hover { color: #f4a98a; }

/* ---- 3. Kill old Bootstrap Resume layout ---- */
section.resume-section {
  display: block !important;
  padding: 0 !important;
  max-width: 100% !important;
  min-height: unset !important;
  align-items: unset !important;
}
section.resume-section .resume-section-content { width: 100%; }

/* ---- 4. Top Navbar ---- */
#sideNav.navbar {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: auto !important;
  width: 100% !important;
  height: var(--nav-height) !important;
  min-height: unset !important;
  flex-direction: row !important;
  padding: 0 2rem !important;
  background: var(--nav-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 2px 24px rgba(0,0,0,0.2);
  z-index: 1030;
}

#sideNav .navbar-brand {
  display: flex !important;
  align-items: center !important;
  margin: 0 1.5rem 0 0 !important;
  padding: 0 !important;
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: -0.02em;
  text-decoration: none;
}

#sideNav .navbar-brand .img-profile,
#sideNav .navbar-brand .d-none.d-lg-block { display: none !important; }

#sideNav .navbar-collapse {
  flex-grow: 1 !important;
  align-items: center !important;
  margin-bottom: 0 !important;
  width: auto !important;
  display: flex !important;
}

#sideNav .navbar-collapse .navbar-nav {
  flex: 1 !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

#sideNav .navbar-nav .nav-item .nav-link {
  font-weight: 500 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: rgba(255,255,255,0.7) !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s !important;
}

#sideNav .navbar-nav .nav-item .nav-link:hover,
#sideNav .navbar-nav .nav-item .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}

.nav-controls-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 1rem;
  flex-shrink: 0;
}

.nav-controls-wrap select {
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
}

.nav-controls-wrap select option { background: #1e293b; color: #fff; }

#theme-toggle {
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #fff !important;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0 !important;
  white-space: nowrap;
}

#theme-toggle:hover { background: rgba(255,255,255,0.2) !important; }
#theme-toggle .theme-icon { transition: transform 0.4s ease; }
[data-theme="dark"] #theme-toggle .theme-icon { transform: rotate(180deg); }

/* ---- Hamburger button ---- */
.navbar-toggler {
  border: none !important;
  background: transparent !important;
  padding: 0.4rem 0.5rem !important;
  outline: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
}
.navbar-toggler.open .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggler.open .hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar-toggler.open .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Backdrop overlay ---- */
#nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1045;
  opacity: 0;
  transition: opacity 0.3s;
}
#nav-backdrop.active { display: block; opacity: 1; }

/* ---- Drawer header (hidden on desktop) ---- */
.drawer-header { display: none; }
/* Nav icons hidden on desktop */
.nav-icon { display: none; }

/* ---- Mobile drawer ---- */
@media (max-width: 991px) {
  #sideNav.navbar { height: auto !important; padding: 0.7rem 1.25rem !important; }

  /* Force block even when Bootstrap adds collapse hide */
  #navbarResponsive,
  #navbarResponsive.collapse,
  #navbarResponsive.collapsing {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(285px, 88vw) !important;
    height: 100dvh !important;
    background: linear-gradient(160deg, #0d1b2e 0%, #162340 100%) !important;
    border-left: 1px solid rgba(255,255,255,0.07) !important;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5) !important;
    transform: translateX(100%) !important;
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1) !important;
    overflow-y: auto !important;
    padding: 0 !important;
    z-index: 1050 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    border-top: none !important;
    margin: 0 !important;
  }
  #navbarResponsive.drawer-open { transform: translateX(0) !important; }

  /* Drawer header */
  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
  }
  .drawer-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  #nav-drawer-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
    flex-shrink: 0;
  }
  #nav-drawer-close:hover { background: rgba(255,255,255,0.2); }

  /* Nav links in drawer */
  #sideNav .navbar-collapse .navbar-nav {
    flex: unset !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    width: 100%;
    gap: 0.2rem;
    padding: 0.9rem 0.8rem;
  }
  #sideNav .navbar-nav .nav-item { width: 100%; }
  #sideNav .navbar-nav .nav-item .nav-link {
    padding: 0.7rem 1rem !important;
    border-radius: 10px !important;
    font-size: 0.88rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
    letter-spacing: 0.02em;
  }
  #sideNav .navbar-nav .nav-item .nav-link::after { display: none !important; }
  .nav-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    font-size: 0.82rem;
    opacity: 0.65;
    flex-shrink: 0;
    transition: opacity 0.2s;
  }
  #sideNav .navbar-nav .nav-item .nav-link:hover .nav-icon,
  #sideNav .navbar-nav .nav-item .nav-link.active .nav-icon { opacity: 1; }

  /* Controls at drawer bottom */
  .nav-controls-wrap {
    margin: 0 !important;
    padding: 0.9rem 1.2rem 1.4rem !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    width: 100%;
  }
  .nav-controls-wrap select {
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
  #theme-toggle { width: 100% !important; justify-content: center !important; }
}

/* ---- 5. Hero ---- */
#about.hero-section {
  min-height: calc(100vh - var(--nav-height));
  background: linear-gradient(135deg, #0a1224 0%, #162340 55%, #0f1e30 100%);
  display: flex;
  align-items: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

#about.hero-section::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(189,93,56,0.12) 0%, transparent 65%);
  pointer-events: none;
}

#about.hero-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(56,189,189,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5rem;
  position: relative;
  z-index: 1;
}

.hero-photo-col { flex-shrink: 0; }

.hero-photo {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(189,93,56,0.5);
  box-shadow: 0 0 0 10px rgba(189,93,56,0.1), 0 24px 64px rgba(0,0,0,0.5);
}

.hero-text-col { flex: 1; color: #fff; }

.hero-greeting {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3.25rem) !important;
  font-weight: 800 !important;
  color: #fff !important;
  line-height: 1.1;
  margin-bottom: 0.75rem !important;
}

.hero-name .accent { color: var(--accent-light); }

.hero-role {
  font-size: 1.05rem;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.25rem;
}

.hero-bio {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.75);
  max-width: 540px;
  margin-bottom: 1rem;
}

.hero-location {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.75rem;
}

.hero-location i { margin-right: 0.35rem; color: var(--accent-light); }
.hero-location a { color: var(--accent-light); text-decoration: none; }
.hero-location a:hover { text-decoration: underline; }

.hero-socials {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  color: rgba(255,255,255,0.85) !important;
  font-size: 1rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.hero-socials a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  transform: translateY(-3px);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(189,93,56,0.4);
  color: #fff;
}

.download-status {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.5rem;
  min-height: 1.2em;
}

@media (max-width: 767px) {
  #about.hero-section { padding: 3.5rem 1.5rem 3rem; }
  .hero-inner { flex-direction: column; gap: 2rem; text-align: center; }
  .hero-photo { width: 160px; height: 160px; }
  .hero-socials { justify-content: center; }
  .hero-bio { margin-left: auto; margin-right: auto; }
}

/* ---- 6. Stats Strip ---- */
#stats-strip {
  background: var(--accent);
  padding: 2.25rem 2rem;
}

.stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.stat-item { text-align: center; color: #fff; }

.stat-num {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
  font-family: 'Inter', sans-serif;
}

.stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- 7. Page Sections ---- */
.page-section {
  padding: 5rem 2rem;
  background: var(--bg);
  transition: background 0.3s ease;
}

.page-section.alt { background: var(--bg-alt); }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  color: var(--heading) !important;
  margin-bottom: 2.5rem !important;
  position: relative;
  padding-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- 8. Publication cards (JS-generated) ---- */
#publications-list .d-flex,
#experience-list .d-flex,
#education-list .d-flex {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

#publications-list .d-flex:hover,
#experience-list .d-flex:hover,
#education-list .d-flex:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

#publications-list .d-flex {
  border-left: 3px solid var(--accent);
}

#publications-list h3,
#experience-list h3,
#education-list h3 {
  font-size: 1.25rem !important;
}

#publications-list h4 {
  font-size: 1rem !important;
  font-weight: 700 !important;
}

.text-primary { color: var(--accent) !important; }
[data-theme="dark"] .text-primary { color: var(--accent-light) !important; }

/* ---- 9. Subheading (JS-generated) ---- */
.subheading {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 600;
  text-transform: none !important;
  color: var(--accent) !important;
}

/* ---- 10. Skills tags ---- */
#skills-list .badge {
  background: var(--tag-bg) !important;
  color: var(--tag-text) !important;
  border-color: var(--border) !important;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem !important;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

#skills-list .badge:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* Dev icons row */
.dev-icons { font-size: 2.5rem; }
.dev-icons .list-inline-item { margin: 0.25rem 0.5rem; color: var(--text-muted); transition: color 0.2s; }
.dev-icons .list-inline-item:hover { color: var(--accent); }

/* ---- 11. Awards / Services ---- */
.fa-ul { color: var(--text); }
.fa-ul li { margin-bottom: 0.7rem; color: var(--text); font-size: 0.95rem; }
.fa-li { color: var(--accent) !important; }

/* ---- 12. Gallery ---- */
#gallery-list [class*="col-"] { margin-bottom: 0; }

.portfolio-box {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.portfolio-box img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}

.portfolio-box:hover img { transform: scale(1.05); }

.portfolio-box-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.portfolio-box:hover .portfolio-box-caption { transform: translateY(0); }

/* ---- 13. Map ---- */
#map-container.map-box {
  width: 100%;
  height: 450px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

/* ---- 14. Contact ---- */
.contact-wrap { max-width: 600px; }

.contact-form label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  display: block;
}

.contact-form .form-control {
  background: var(--input-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}

.contact-form .form-control:focus {
  background: var(--input-bg) !important;
  color: var(--text) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(189,93,56,0.15) !important;
}

.contact-form .form-control::placeholder { color: var(--text-muted); }

/* ---- 15. Footer (fixed at bottom) ---- */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(8, 17, 31, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 0.65rem 1.5rem;
  font-size: 0.82rem;
}

.site-footer p { margin: 0; }
.site-footer a { color: rgba(255,255,255,0.55); }
.site-footer a:hover { color: var(--accent-light); }

/* Push page content above the fixed footer */
body { padding-bottom: 44px; }

/* ---- 16. Dark mode misc ---- */
[data-theme="dark"] .alert-success {
  background-color: #14532d; border-color: #166534; color: #bbf7d0;
}
[data-theme="dark"] .alert-danger {
  background-color: #7f1d1d; border-color: #991b1b; color: #fecaca;
}
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] hr { border-color: var(--border); opacity: 0.5; }

/* ---- 17. Skip link ---- */
.skip-link {
  position: absolute;
  left: -999px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-weight: bold;
}
.skip-link:focus { left: 0; top: 0; width: auto; height: auto; }

/* ---- 18. Scroll fade-in ---- */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ---- 19. Hero section quick-links ---- */
.hero-section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.hero-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75) !important;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.hero-section-link i {
  font-size: 0.75rem;
  color: var(--accent-light);
}

.hero-section-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  transform: translateY(-2px);
}

.hero-section-link:hover i { color: #fff; }

@media (max-width: 767px) {
  .hero-section-links { justify-content: center; }
}

/* ---- 20. Scroll-to-top button ---- */
#scroll-top {
  position: fixed;
  bottom: 3.75rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(189,93,56,0.4);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s;
  z-index: 999;
}

#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scroll-top:hover {
  background: var(--accent-dark);
  box-shadow: 0 6px 20px rgba(189,93,56,0.55);
}

/* ---- 22. Focus ---- */
:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}

/* =====================================================
   IMPROVEMENTS — Round 2
   ===================================================== */

/* --- #1 Navbar scroll shrink --- */
#sideNav.navbar {
  transition: height 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}
#sideNav.navbar.scrolled {
  height: 52px !important;
  box-shadow: 0 4px 32px rgba(0,0,0,0.35) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* --- #2 Active nav link highlight --- */
#sideNav .navbar-nav .nav-item .nav-link.active {
  color: #fff !important;
  background: rgba(189,93,56,0.2) !important;
}
#sideNav .navbar-nav .nav-item .nav-link.active::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 2px auto 0;
}

/* --- #3 Rotating photo ring --- */
.hero-photo-ring {
  position: relative;
  width: 238px;
  height: 238px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(
    from 0deg,
    var(--accent) 0%,
    var(--accent-light) 25%,
    transparent 45%,
    transparent 55%,
    var(--accent-light) 75%,
    var(--accent) 100%
  );
  animation: ring-spin 5s linear infinite;
  box-shadow: 0 0 0 8px rgba(189,93,56,0.1), 0 24px 64px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.hero-photo {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover;
  display: block;
  border: 3px solid #0a1224 !important;
  box-shadow: none !important;
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- #4 Staggered fade-up --- */
.fade-up { transition-delay: var(--stagger, 0ms); }

/* --- #5 Skills category headers --- */
#skills-list .skill-category-block { padding: 0.5rem 0; }
#skills-list .skill-category-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.dev-icons .list-inline-item i {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}
.dev-icons .list-inline-item i:hover {
  color: var(--accent);
  transform: scale(1.15);
}

/* --- #6 Hero highlights (replaces quick-links) --- */
.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-highlight {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  flex: 1;
  min-width: 160px;
  transition: background 0.2s, border-color 0.2s;
}

.hero-highlight:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(189,93,56,0.4);
}

.hero-highlight > i {
  font-size: 1.2rem;
  color: var(--accent-light);
  flex-shrink: 0;
}

.hero-highlight > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hl-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.hl-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

@media (max-width: 767px) {
  .hero-highlights { justify-content: center; }
  .hero-highlight { min-width: 140px; }
}

/* Hero quick-nav */
.hero-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.hero-quick-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55) !important;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.hero-quick-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}

.hero-quick-link + .hero-quick-link::before {
  content: '·';
  margin-right: 0.4rem;
  color: rgba(255,255,255,0.25);
}

@media (max-width: 767px) {
  .hero-quick-nav { justify-content: center; }
}

/* --- Publication filter tabs --- */
.pub-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.pub-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.pub-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pub-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* pub-card hover lift */
.pub-card {
  border-radius: 10px;
  padding: 1rem;
  transition: background 0.2s, transform 0.2s;
}
.pub-card:hover {
  background: var(--card-bg);
  transform: translateY(-2px);
}
.read-more-link {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* --- #7 Publication cards --- */
.pub-type-group { border-left: 3px solid rgba(189,93,56,0.3); padding-left: 1.2rem; }
.pub-title { font-size: 1rem !important; font-weight: 600; line-height: 1.4; }
.pub-contributors { color: var(--text-muted); }
.pub-contributors .fa-users { color: var(--accent); margin-right: 0.35rem; }
.pub-keywords { color: var(--text-muted); font-style: italic; }
.pub-date-badge {
  display: inline-block;
  background: rgba(189,93,56,0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(189,93,56,0.25);
  white-space: nowrap;
}

.pub-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(189,93,56,0.1);
  border: 1px solid rgba(189,93,56,0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: inline-block;
}

.copy-cite-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.copy-cite-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.copy-cite-btn.copied {
  background: #198754;
  color: #fff;
  border-color: #198754;
}

/* Interests rendered from JSON */
.interests-category {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.interests-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.interests-list li::before {
  content: '→ ';
  color: var(--accent);
  font-weight: 600;
}

.abstract-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- #8 Contact split layout --- */
.contact-split {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.75rem !important;
}

.contact-info > p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  color: var(--text);
}

.contact-info-item i {
  width: 20px;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-info-item a { color: var(--text); }
.contact-info-item a:hover { color: var(--accent); }

.contact-info-socials {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.contact-info-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text) !important;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.contact-info-socials a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  transform: translateY(-2px);
}

@media (max-width: 767px) {
  .contact-split { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- #9 Footer redesign --- */
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-socials a {
  color: rgba(255,255,255,0.4);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-socials a:hover { color: var(--accent-light); }

.site-footer p { margin: 0; }

/* --- #11 Hero adapts to light mode --- */
[data-theme="light"] #about.hero-section {
  background: linear-gradient(135deg, #1a2d4a 0%, #2d4a6e 50%, #1e3a55 100%);
}

/* --- #12 Mobile hero improvements --- */
@media (max-width: 480px) {
  .hero-photo-ring {
    width: 140px;
    height: 140px;
  }
  .hero-name { font-size: 1.75rem !important; }
  .hero-role { font-size: 0.9rem; }
  .hero-highlight { min-width: 120px; padding: 0.5rem 0.75rem; }
  .hl-value { font-size: 0.8rem; }
}

/* =====================================================
   ADDITIONS — Round 3
   ===================================================== */

/* --- Reading progress bar --- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 2000;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* --- Section progress dots --- */
#section-dots {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.3rem;
  background: rgba(0,0,0,0.15);
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

#section-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s, height 0.2s;
  position: relative;
}

#section-dots .dot:hover { transform: scale(1.4); }

#section-dots .dot.active {
  background: var(--accent);
  border-color: var(--accent);
  height: 20px;
  border-radius: 4px;
}

#section-dots .dot::before {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,23,42,0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#section-dots .dot:hover::before { opacity: 1; }

[data-theme="light"] #section-dots {
  background: rgba(255,255,255,0.25);
}

[data-theme="light"] #section-dots .dot {
  background: rgba(0,0,0,0.2);
  border-color: rgba(0,0,0,0.3);
}

[data-theme="light"] #section-dots .dot::before {
  background: rgba(15,23,42,0.85);
}

@media (max-width: 767px) { #section-dots { display: none; } }

/* --- Toast notifications --- */
#toast-container {
  position: fixed;
  bottom: 4.5rem;
  left: 1.5rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-msg {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border-left: 3px solid var(--accent);
  pointer-events: auto;
  animation: toast-in 0.3s ease forwards;
  max-width: 280px;
}

.toast-msg.toast-success { border-left-color: #22c55e; }
.toast-msg.toast-error   { border-left-color: #ef4444; }
.toast-msg.toast-out     { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-20px); } }

/* --- Lightbox --- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}

#lightbox-caption {
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  margin: 0;
  text-align: center;
}

#lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
#lightbox-close:hover { color: #fff; }

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#lightbox-prev { left: 1.5rem; }
#lightbox-next { right: 1.5rem; }
#lightbox-prev:hover,
#lightbox-next:hover { background: rgba(255,255,255,0.25); }

/* --- Typewriter cursor --- */
.typewriter-cursor {
  display: inline-block;
  color: var(--accent-light);
  animation: blink 0.75s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Last updated badge --- */
.hero-actions-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.last-updated-badge {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.last-updated-badge i { color: var(--accent-light); }

/* --- Copy email button --- */
.copy-email-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-left: 0.35rem;
  line-height: 1;
}
.copy-email-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Skeleton loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-alt) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-block { height: 1rem; margin-bottom: 0.6rem; }
.skeleton-block.wide { width: 85%; }
.skeleton-block.medium { width: 60%; }
.skeleton-block.narrow { width: 35%; }
.skeleton-title { height: 1.4rem; width: 50%; margin-bottom: 1rem; }

/* ---- Social Stats ---- */
.social-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.social-stat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  text-decoration: none !important;
  color: var(--text) !important;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.social-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  border-color: var(--sc, var(--accent));
}

.social-stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: var(--sc, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.social-stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.social-stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.social-stat-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.social-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .social-stats-grid { grid-template-columns: 1fr; }
}

/* ---- Quran verse ---- */
.hero-bio-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.hero-bio-row .hero-bio {
  flex: 1;
  margin-bottom: 0;
}

.quran-verse {
  flex: 0 0 auto;
  width: 270px;
  margin: 0;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid #d4a853;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.quran-translation {
  font-size: 0.83rem;
  font-style: italic;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  margin: 0;
}

.quran-arabic {
  font-size: 1rem;
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', serif;
  direction: rtl;
  text-align: right;
  color: #d4a853;
  line-height: 2;
  margin: 0;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(212,168,83,0.25);
}

.quran-ref {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-style: normal;
  display: block;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .hero-bio-row {
    flex-direction: column;
    gap: 1rem;
  }
  .quran-verse {
    width: 100%;
  }
}
