/* ═══════════════════════════════════════════
   DARK ROYAL HYBRID — palette override
   for Kelly Bootstrap Template
═══════════════════════════════════════════ */
:root {
  --background-color:              #0D0D12;
  --default-color:                 #E8E4F0;
  --heading-color:                 #C8C8D4;
  --accent-color:                  #7B5EA7;
  --surface-color:                 #1E1640;
  --contrast-color:                #E8E4F0;

  --nav-color:                     #9090A8;
  --nav-hover-color:               #7B5EA7;
  --nav-mobile-background-color:   #0D0D12;
  --nav-dropdown-background-color: #13111F;
  --nav-dropdown-color:            #E8E4F0;
  --nav-dropdown-hover-color:      #7B5EA7;
}

.light-background {
  --background-color: #13111F;
  --surface-color:    #1E1640;
}

.dark-background {
  --background-color: #0D0D12;
  --default-color:    #E8E4F0;
  --heading-color:    #C8C8D4;
  --surface-color:    #1E1640;
  --contrast-color:   #E8E4F0;
}

/* ── Logo ── */
.header .logo img,
.logo .logo-img {
  max-height: 90px;
  height: 90px;
  width: auto;
  mix-blend-mode: screen;
  filter: invert(1) brightness(1.1);
  display: block;
}

/* ── Header padding reduced ── */
.header {
  padding: 4px 0;
}

/* ── Language toggle ── */
.lang-btn {
  background: var(--accent-color);
  color: var(--contrast-color);
  border: none;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-inline-start: 10px;
  font-family: 'Poppins', sans-serif;
  transition: background 0.25s, transform 0.2s;
  white-space: nowrap;
}
.lang-btn:hover { background: #6b4d97; transform: scale(1.05); }

/* ── RTL / Persian font ── */
html[dir="rtl"] body,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
html[dir="rtl"] p, html[dir="rtl"] a, html[dir="rtl"] span,
html[dir="rtl"] li, html[dir="rtl"] button, html[dir="rtl"] input,
html[dir="rtl"] textarea, html[dir="rtl"] label {
  font-family: 'Vazirmatn', sans-serif !important;
}

/* ── Stats cards ── */
.stats .stats-item {
  background: var(--surface-color);
  border: 1px solid #2D2060;
  border-radius: 12px;
}

/* ── Skills progress track ── */
.skills .progress .progress-bar-wrap {
  background: #2D2060 !important;
  border-radius: 4px;
}

/* ── Portfolio filter buttons ── */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.portfolio-filters button {
  background: transparent;
  border: 1px solid #2D2060;
  color: var(--default-color);
  padding: 7px 22px;
  border-radius: 24px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s;
}
.portfolio-filters button:hover,
.portfolio-filters button.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.portfolio-item.hidden { display: none; }

/* ── Hero dark overlay ── */
.hero.dark-background {
  background-color: #0D0D12 !important;
}
.hero.dark-background img {
  opacity: 0.38 !important;
  mix-blend-mode: normal !important;
}
.hero h2,
.hero p,
.hero .btn-get-started {
  position: relative;
  z-index: 3;
  color: var(--heading-color) !important;
}

/* ── RTL mobile header fix ── */
@media (max-width: 1200px) {
  html[dir="rtl"] .header .container-fluid {
    flex-direction: row !important;
  }
  html[dir="rtl"] .header .logo {
    order: 3 !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    margin-inline-end: 0 !important;
    margin-inline-start: 0 !important;
  }
  html[dir="rtl"] .header .header-social-links {
    order: 2 !important;
    margin: 0 !important;
  }
  html[dir="rtl"] .header .navmenu {
    order: 1 !important;
    margin: 0 !important;
  }
}

/* ── Tech badges ── */
.tech-badge {
  display: inline-block;
  background: rgba(123,94,167,0.15);
  color: #9B7EC7;
  border: 1px solid rgba(123,94,167,0.35);
  padding: 3px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin: 3px 2px 0;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

/* ── Tablet (≤992px) ── */
@media (max-width: 992px) {
  .header .logo img,
  .logo .logo-img {
    max-height: 62px;
    height: 62px;
  }

  .resume .resume-item {
    padding: 0 0 20px 20px;
  }

  .portfolio-filters {
    gap: 6px;
  }
  .portfolio-filters button {
    padding: 6px 16px;
    font-size: 13px;
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .header .logo img,
  .logo .logo-img {
    max-height: 50px;
    height: 50px;
  }

  .header {
    padding: 2px 0;
  }

  /* Nav mobile overlay dark */
  .navmenu {
    background: var(--nav-mobile-background-color) !important;
  }
  .navmenu ul {
    background: var(--nav-mobile-background-color) !important;
  }
  .navmenu ul li a {
    color: var(--nav-color) !important;
    border-bottom: 1px solid var(--border, #2D2060) !important;
  }
  .navmenu ul li a:hover,
  .navmenu ul li a.active {
    color: var(--nav-hover-color) !important;
  }

  /* Hero — full fix for mobile */
  .hero {
    min-height: 100svh !important;
    padding: 80px 0 40px !important;
    display: flex !important;
    align-items: center !important;
  }
  .hero img {
    object-position: center top !important;
  }
  .hero h2 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 12px !important;
  }
  .hero p {
    font-size: 1rem !important;
    margin-bottom: 24px !important;
  }
  .hero .btn-get-started {
    padding: 10px 28px !important;
    font-size: 14px !important;
  }
  .hero .container {
    padding-top: 0 !important;
  }

  /* About section */
  .about .about-img {
    margin-bottom: 24px;
  }

  /* Skills */
  .skills .progress {
    margin-bottom: 16px;
  }

  /* Stats */
  .stats .stats-item {
    text-align: center;
    padding: 16px 10px;
  }

  /* Resume */
  .resume .row > [class*="col-"] {
    margin-bottom: 24px;
  }

  /* Services */
  .services .service-item {
    padding: 24px 16px;
  }

  /* Portfolio */
  .portfolio-filters {
    gap: 5px;
    margin-bottom: 24px;
  }
  .portfolio-filters button {
    padding: 5px 12px;
    font-size: 12px;
  }

  /* Contact */
  .contact .info-wrap {
    margin-bottom: 24px;
  }

  /* Footer */
  .footer {
    padding: 20px 0;
  }
  .footer .social-links {
    gap: 12px;
  }

  /* Lang btn */
  .lang-btn {
    padding: 4px 12px;
    font-size: 12px;
  }
}

/* ── Small mobile (≤480px) ── */
@media (max-width: 480px) {
  .header .logo img,
  .logo .logo-img {
    max-height: 42px;
    height: 42px;
  }

  .hero h2 {
    font-size: 1.65rem !important;
  }

  .section-title h2 {
    font-size: 1.6rem !important;
  }

  .stats .stats-item .purecounter {
    font-size: 2rem !important;
  }

  .portfolio-filters {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .contact .php-email-form button {
    width: 100%;
  }

  /* Header social icons hide on tiny screens */
  .header-social-links a {
    display: none;
  }
  .header-social-links .lang-btn {
    display: inline-flex;
  }
}
