/* ==========================================================================
   Custom styles — Mohammad Mohsin Portfolio
   Tailwind (via CDN) handles utility classes; this file covers everything
   Tailwind's default config doesn't: fonts, scrollbar, smooth scroll,
   transitions for JS-driven states, and a couple of small polish details.
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
button,
.font-montserrat {
  font-family: 'Montserrat', sans-serif;
}

/* Custom scrollbar to match the brand orange */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #ff6600;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #e55c00;
}

/* Magnetic-style button press feedback */
.btn-magnetic {
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), background-color 0.3s ease;
}
.btn-magnetic:hover {
  transform: scale(1.05);
}
.btn-magnetic:active {
  transform: scale(0.95);
}

/* Skill bars animate their width in via JS (script.js) by reading data-level */
.skill-bar {
  width: 0%;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Navbar background/shadow transition when scrolled (toggled via JS) */
#navbar {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
#navbar.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
#navbar.nav-scrolled a.text-black,
#navbar.nav-scrolled span.text-black {
  color: #000;
}

/* Mobile menu open state (toggled via JS) */
#mobileMenu.menu-open {
  opacity: 1;
  pointer-events: auto;
}
#mobileMenu.menu-open #mobileMenuPanel {
  transform: translateX(0);
}

/* Simple fade/slide-up entrance for sections as they scroll into view */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Active nav link underline is toggled via JS by swapping classes,
   this just ensures the underline element transitions smoothly */
nav a span.bg-orange-500 {
  transition: opacity 0.3s ease;
}

/* Contact form focus/validity polish */
.form-input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

/* Toast notification for the contact form (created dynamically by script.js) */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: #1a1a1a;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
#toast.toast-visible {
  transform: translateY(0);
  opacity: 1;
}
#toast.toast-error {
  background: #dc2626;
}
