/* =============================================
   DARK THEME OVERRIDE (scoped to html.dark-theme)
   Portfolio — Deep navy with indigo/cyan accents
   ============================================= */

html.dark-theme {
  --dark-bg: #0a0a1a;
  --dark-surface: #12122a;
  --dark-surface-elevated: #1a1a3e;
  --dark-accent-1: #6366f1;
  --dark-accent-2: #22d3ee;
  --dark-text-primary: #e2e8f0;
  --dark-text-secondary: #94a3b8;
  --dark-text-muted: #64748b;
  --dark-border: rgba(99, 102, 241, 0.15);
  --dark-border-subtle: rgba(99, 102, 241, 0.08);
  --dark-glow-accent: rgba(99, 102, 241, 0.25);
  --dark-glow-cyan: rgba(34, 211, 238, 0.15);
  --dark-navbar-bg: rgba(18, 18, 42, 0.92);

  /* GitHub calendar overrides */
  --color-calendar-graph-day-bg: rgba(99, 102, 241, 0.1);
  --color-calendar-graph-day-L1-bg: #3730a3;
  --color-calendar-graph-day-L2-bg: #4f46e5;
  --color-calendar-graph-day-L3-bg: #6366f1;
  --color-calendar-graph-day-L4-bg: #818cf8;

  background-color: var(--dark-bg);
}

/* ---- Theme Toggle Button ---- */

.nad-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.nad-theme-toggle:hover {
  background: rgba(20, 20, 43, 0.08);
  transform: scale(1.1);
}

.nad-theme-toggle:active {
  transform: scale(0.95);
}

.nad-theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light mode: show moon, hide sun */
.nad-icon-moon {
  color: #14142b;
}

.nad-icon-sun {
  display: none;
}

/* Dark mode: show sun, hide moon */
html.dark-theme .nad-icon-moon {
  display: none;
}

html.dark-theme .nad-icon-sun {
  display: block;
  color: var(--dark-accent-2);
}

html.dark-theme .nad-theme-toggle:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* ---- Global ---- */

html.dark-theme body {
  background-color: var(--dark-bg) !important;
  color: var(--dark-text-secondary) !important;
}

html.dark-theme h1, html.dark-theme h2, html.dark-theme h3,
html.dark-theme h4, html.dark-theme h5, html.dark-theme h6,
html.dark-theme .hello h1, html.dark-theme .hello h3 {
  color: var(--dark-text-primary) !important;
}

html.dark-theme p, html.dark-theme .paragraph {
  color: var(--dark-text-secondary);
}

html.dark-theme strong {
  color: var(--dark-text-primary) !important;
}

html.dark-theme a {
  color: var(--dark-accent-1) !important;
}

html.dark-theme a:hover {
  color: var(--dark-accent-2) !important;
}

html.dark-theme ::selection {
  background: var(--dark-accent-1);
  color: #fff;
}

/* Custom scrollbar */
html.dark-theme ::-webkit-scrollbar {
  width: 8px;
}

html.dark-theme ::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

html.dark-theme ::-webkit-scrollbar-thumb {
  background: var(--dark-surface-elevated);
  border-radius: 4px;
}

html.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--dark-accent-1);
}

/* ---- Navbar ---- */

html.dark-theme .nad-nav-pill {
  background: var(--dark-navbar-bg) !important;
  border: 1px solid var(--dark-border) !important;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.12) !important;
}

html.dark-theme .nad-nav-pill:hover {
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.2) !important;
}

html.dark-theme .nad-nav-indicator {
  background: rgba(99, 102, 241, 0.2) !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15) !important;
}

html.dark-theme .nad-nav-link {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .nad-nav-link:hover {
  color: var(--dark-text-primary) !important;
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.3) !important;
}

html.dark-theme .nad-nav-link.w--current,
html.dark-theme .nad-nav-link[aria-current="page"] {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .nad-nav-toggle span {
  background: var(--dark-text-primary) !important;
}

@media (max-width: 767px) {
  html.dark-theme .nad-nav-menu {
    background: rgba(18, 18, 42, 0.95) !important;
    border: 1px solid var(--dark-border) !important;
    box-shadow: 0 14px 40px rgba(99, 102, 241, 0.2) !important;
  }
}

/* ---- Hero Section ---- */

html.dark-theme .section.hero-section {
  background-color: var(--dark-bg) !important;
}

html.dark-theme .title.subtitle {
  color: var(--dark-text-secondary) !important;
}

/* Hero heading shimmer — dark variant */
html.dark-theme .hero-left .title.home-hero {
  background: linear-gradient(
    90deg,
    var(--dark-text-primary) 0%,
    var(--dark-text-primary) 40%,
    var(--dark-accent-1) 50%,
    var(--dark-text-primary) 60%,
    var(--dark-text-primary) 100%
  ) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation:
    clipReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both,
    textShimmer 4s ease-in-out 1.5s infinite !important;
}

html.dark-theme .hero-left .title.subtitle {
  -webkit-text-fill-color: unset !important;
}

/* Hero image glow — dark variant */
html.dark-theme .image-wrapper.hero-image {
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0) !important;
}

/* ---- Buttons ---- */

html.dark-theme .button-primary {
  background-color: var(--dark-accent-1) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

html.dark-theme .button-primary:hover {
  background-color: var(--dark-surface-elevated) !important;
  color: var(--dark-accent-2) !important;
  box-shadow: 0 4px 25px rgba(34, 211, 238, 0.2) !important;
}

html.dark-theme .button-secondary {
  background-color: var(--dark-surface-elevated) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
}

html.dark-theme .button-secondary:hover {
  background-color: var(--dark-accent-1) !important;
  color: #fff !important;
  border-color: var(--dark-accent-1) !important;
}

/* ---- Cards (all variants) ---- */

html.dark-theme .card {
  background-color: var(--dark-surface) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 1px var(--dark-border) !important;
}

html.dark-theme .card.service-card {
  border: 1px solid var(--dark-border);
}

html.dark-theme .card.resume-card {
  border: 1px solid var(--dark-border);
}

html.dark-theme .card.resume-card strong {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .card.blog-card,
html.dark-theme .card.featured-blog-card {
  border-color: var(--dark-border) !important;
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .card.skill-card.center {
  border-right-color: var(--dark-border) !important;
  border-left-color: var(--dark-border) !important;
}

html.dark-theme .card.testimonial-card {
  background-color: var(--dark-surface) !important;
}

html.dark-theme .card.home-portfolio-card,
html.dark-theme .card.portfolio-card {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .card.checkout {
  border-color: var(--dark-border) !important;
}

/* ---- Section bg squares ---- */

html.dark-theme .bg.services-square,
html.dark-theme .bg.cert-square,
html.dark-theme .bg.resume-square,
html.dark-theme .bg.academic-square,
html.dark-theme .bg.testimonials-square {
  background-color: var(--dark-surface) !important;
  border: 1px solid var(--dark-border-subtle);
}

html.dark-theme .bg.post-bg-image {
  background-color: var(--dark-surface) !important;
}

/* ---- Dividers & Borders ---- */

html.dark-theme .divider {
  background-color: var(--dark-border) !important;
}

html.dark-theme .footer-content-bottom {
  border-top-color: var(--dark-border) !important;
}

/* ---- Footer ---- */

html.dark-theme .footer {
  background-color: var(--dark-bg);
  color: var(--dark-text-secondary);
}

html.dark-theme .footer-bottom-link {
  color: var(--dark-accent-1) !important;
}

/* ---- Back-to-Top ---- */

html.dark-theme .back-to-top {
  background: linear-gradient(10deg, var(--dark-accent-1) 50%, var(--dark-accent-2) 100%) !important;
}

html.dark-theme .back-to-top i {
  color: #fff !important;
}

html.dark-theme .back-to-top:hover {
  background: linear-gradient(10deg, var(--dark-accent-1) 70%, var(--dark-accent-1) 100%) !important;
}

/* ---- Preloader ---- */

html.dark-theme #preloader {
  background: var(--dark-bg) !important;
}

html.dark-theme #preloader:before {
  border-color: var(--dark-accent-1) !important;
  border-top-color: var(--dark-bg) !important;
}

/* ---- Form Inputs (Contact page) ---- */

html.dark-theme .input {
  background-color: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

html.dark-theme .input:hover {
  border-color: var(--dark-accent-1) !important;
}

html.dark-theme .input:focus,
html.dark-theme .input.-wfp-focus {
  border-color: var(--dark-accent-2) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 0 8px var(--dark-glow-cyan);
}

html.dark-theme .input.checkout,
html.dark-theme .input.discounts {
  background-color: var(--dark-surface) !important;
}

html.dark-theme .field-label {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .text-area {
  background-color: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

html.dark-theme .text-area:hover {
  border-color: var(--dark-accent-1) !important;
}

html.dark-theme .text-area:focus {
  border-color: var(--dark-accent-2) !important;
  color: var(--dark-text-primary) !important;
  box-shadow: 0 0 8px var(--dark-glow-cyan);
}

html.dark-theme .input::placeholder,
html.dark-theme .text-area::placeholder {
  color: var(--dark-text-muted) !important;
}

/* ---- FAQ Accordion (Contact page) ---- */

html.dark-theme .faq-item {
  border-bottom-color: var(--dark-border) !important;
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .faq-icon-wrapper {
  background-color: var(--dark-surface-elevated) !important;
}

html.dark-theme .faq-first-line,
html.dark-theme .faq-second-line {
  background-color: var(--dark-accent-1) !important;
}

html.dark-theme .title.faq-item-title {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .paragraph.faq-item-paragraph {
  color: var(--dark-text-secondary) !important;
}

/* ---- Achievements Sidebar ---- */

html.dark-theme .style-guide-content {
  background-color: var(--dark-surface) !important;
  box-shadow: 0 8px 22px 0 rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .style-guide-header {
  background-color: var(--dark-surface) !important;
}

html.dark-theme .style-guide-link {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .style-guide-link:hover,
html.dark-theme .style-guide-link.w--current {
  background-color: var(--dark-surface-elevated) !important;
  color: var(--dark-text-primary) !important;
}

html.dark-theme .style-guide-subheader {
  border-bottom-color: var(--dark-border) !important;
}

/* ---- Certificate Cards ---- */

html.dark-theme .cert-header {
  background-color: var(--dark-surface-elevated) !important;
}

html.dark-theme .cert-body {
  background-color: var(--dark-surface) !important;
}

html.dark-theme .cert-body-title {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .cert-body-subtitle {
  color: var(--dark-text-muted) !important;
}

html.dark-theme .content-overlay {
  background: rgba(10, 10, 26, 0.6) !important;
}

/* ---- Legacy Header / Mobile Nav ---- */

html.dark-theme #header {
  background: linear-gradient(10deg, rgba(18, 18, 42, 0.92) 85%, rgba(10, 10, 26, 1) 100%) !important;
}

html.dark-theme .navbar-mobile {
  background: linear-gradient(10deg, rgba(18, 18, 42, 0.9) 20%, rgba(10, 10, 26, 0.95) 100%) !important;
}

html.dark-theme .navbar-mobile ul {
  background: linear-gradient(10deg, rgba(18, 18, 42, 0.95) 85%, rgba(10, 10, 26, 1) 100%) !important;
}

html.dark-theme .navbar a,
html.dark-theme .navbar-mobile a {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .mobile-nav-toggle {
  color: var(--dark-text-primary) !important;
}

/* ---- Social Links ---- */

html.dark-theme .header-social-links a {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .header-social-links a:hover {
  color: var(--dark-accent-2) !important;
}

/* ---- Slider Arrows ---- */

html.dark-theme .slider-arrow {
  background-color: var(--dark-surface-elevated) !important;
  color: var(--dark-text-primary) !important;
}

html.dark-theme .slider-arrow:hover {
  background-color: var(--dark-accent-1) !important;
  color: #fff !important;
}

/* ---- Blockquotes ---- */

html.dark-theme blockquote {
  background-color: var(--dark-surface-elevated) !important;
  color: var(--dark-text-secondary) !important;
}

/* ---- Utility Background Classes ---- */

html.dark-theme .bg-neutral-100 { background-color: var(--dark-bg) !important; }
html.dark-theme .bg-neutral-200,
html.dark-theme .bg-neutral-300 { background-color: var(--dark-surface) !important; }
html.dark-theme .bg-neutral-400 { background-color: var(--dark-border) !important; }
html.dark-theme .bg-secondary-1,
html.dark-theme .bg-secondary-2,
html.dark-theme .bg-secondary-3,
html.dark-theme .bg-secondary-4 { background-color: var(--dark-surface-elevated) !important; }

/* ---- 404 / Utility Pages ---- */

html.dark-theme .utility-page-content,
html.dark-theme .utility-page-content-404 {
  background-color: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
}

html.dark-theme ._404-title {
  color: var(--dark-text-primary) !important;
}

/* ---- Sections ---- */

html.dark-theme .section {
  background-color: var(--dark-bg);
}

/* ---- Dropdown Menus (Legacy) ---- */

html.dark-theme .navbar .dropdown ul {
  background: linear-gradient(10deg, var(--dark-surface) 91%, var(--dark-surface-elevated) 100%) !important;
  box-shadow: 0 0 10px 1px rgba(99, 102, 241, 0.15) !important;
}

html.dark-theme .navbar .dropdown ul a:hover,
html.dark-theme .navbar .dropdown ul li:hover > a {
  color: var(--dark-accent-2) !important;
}

/* ---- Blog external link buttons ---- */

html.dark-theme .blog-category-link,
html.dark-theme .category-link {
  background-color: var(--dark-surface-elevated) !important;
  color: var(--dark-text-primary) !important;
  border: 1px solid var(--dark-border) !important;
}

html.dark-theme .blog-category-link:hover,
html.dark-theme .category-link:hover {
  background-color: var(--dark-accent-1) !important;
  color: #fff !important;
}

/* ---- Misc text overrides ---- */

html.dark-theme .text-center {
  color: var(--dark-text-secondary);
}

html.dark-theme .title.portfolio {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .title.service-title {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .title.home-about {
  color: var(--dark-text-primary) !important;
}

/* ---- Hero Floating Badges ---- */

html.dark-theme .hero-badge {
  background: var(--dark-surface) !important;
  border-color: var(--dark-surface-elevated) !important;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2) !important;
}

/* ---- Skills Marquee ---- */

html.dark-theme .skills-marquee-item {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .skills-marquee-item:hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15) !important;
}

html.dark-theme .skills-marquee-item span {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .skill-card-marquee {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .skill-card-marquee:hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15) !important;
}

html.dark-theme .skill-card-marquee h3 {
  color: var(--dark-text-primary) !important;
}

html.dark-theme .skill-card-marquee p {
  color: var(--dark-text-secondary) !important;
}

html.dark-theme .skill-card-marquee a {
  color: var(--dark-accent-2) !important;
}
