:root {
  --primary-color: #4F46E5;
  --secondary-color: #10B981;
  --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #eef2ff 100%);
  --bs-body-bg: #ffffff;
  --bs-body-color: #212529;
}

[data-bs-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --bs-body-bg: #0f172a;
  --bs-body-color: #e2e8f0;
}

/* ===============================
   BASE
================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===============================
   SCROLL REVEAL
================================ */
.reveal-hidden {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.9s ease-out;
  visibility: hidden;
}

.reveal-hidden.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* ===============================
   NAVBAR
================================ */
.navbar {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.4s ease;
  padding: 15px 0;
  position: fixed;
  width: 100%;
  z-index: 999;
}

[data-bs-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.85);
}

.navbar.scrolled {
  padding: 8px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--primary-color) !important;
  position: relative;
}

.navbar-brand:hover {
  color: var(--secondary-color) !important;
}

.navbar-brand::after {
  content: "";
  position: absolute;
  inset: -6px;
  background: radial-gradient(circle, rgba(79,70,229,0.25), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar-brand:hover::after {
  opacity: 1;
}

.nav-link {
  font-weight: 500;
  margin: 0 12px;
  position: relative;
  color: var(--bs-body-color);
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary-color);
}

.navbar-toggler {
  border: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

[data-bs-theme="dark"] .navbar-toggler-icon {
  filter: invert(1);
}

@media (max-width: 991px) {
  .navbar-collapse {
    background: var(--bs-body-bg);
    padding: 20px;
    border-radius: 20px;
    margin-top: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  }

  .nav-link {
    padding: 12px 0;
    font-size: 1.1rem;
  }
}

/* ===============================
   HERO SECTION
================================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-gradient);
  padding-top: 80px;
}

#typewriter {
  min-height: 1.2em;
  display: inline-block;
}

.cursor-blink {
  border-right: 3px solid var(--primary-color);
  animation: blink 0.75s step-end infinite;
}

[data-bs-theme="dark"] .cursor-blink {
  border-right-color: var(--secondary-color);
}

@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary-color); }
}

/* ===============================
   PROFILE IMAGE
================================ */
.img-wrapper {
  position: relative;
  display: inline-block;
}

.profile-img {
  max-width: 400px;
  max-height: 400px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  border: 10px solid rgb(60, 167, 255);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  animation: morph 8s ease-in-out infinite, floatHero 6s ease-in-out infinite;
  transition: all 0.3s ease;
}

[data-bs-theme="dark"] .profile-img {
  border-color: #3b82f6;
}

@keyframes morph {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
  }
}

@keyframes floatHero {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* ===============================
   CARDS & COMPONENTS
================================ */
.skill-card,
.project-card {
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(79,70,229,0.15);
}

[data-bs-theme="dark"] .skill-card:hover,
[data-bs-theme="dark"] .project-card:hover {
  box-shadow: 0 15px 30px rgba(79,70,229,0.25);
  background-color: rgba(79,70,229,0.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,70,229,0.8), rgba(16,185,129,0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  border-radius: 15px;
}

.project-card:hover .project-overlay {
  opacity: 1;
  transform: translateY(0);
}

.project-overlay .btn {
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.project-card:hover .project-overlay .btn {
  transform: translateY(0);
}

.project-overlay .btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(255,255,255,0.3);
}

/* Hover effect for position-relative images */
.position-relative img {
  border-radius: 15px;
  max-width: 100%;
  max-height: 400px;
  transition: filter 0.4s ease, transform 0.4s ease;
}

.position-relative:hover img {
  filter: brightness(0.85);
  transform: scale(1.03);
}

/* ===============================
   FILTER BUTTONS
================================ */
.filter-btn {
  position: relative;
  transition: all 0.3s ease;
  color: var(--primary-color);
  background-color: #e0e7ff;
  border: 1px solid var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.filter-btn:hover {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.25);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
  transform: translateY(-2px);
}

/* ===============================
   BADGES & FORMS
================================ */
.bg-primary-subtle {
  background-color: rgba(79,70,229,0.1) !important;
  color: var(--primary-color);
}

.form-control {
  transition: all 0.3s ease;
}

.form-control:focus {
  background-color: var(--bs-body-bg) !important;
  border: 1px solid var(--primary-color) !important;
  box-shadow: 0 0 0 0.25rem rgba(79,70,229,0.1);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] ::placeholder {
  color: #adb5bd;
  opacity: 1;
}

/* ===============================
   CONTACT SECTION
================================ */
#contact {
  transition: all 0.3s ease;
  padding: 80px 0;
}

#contact h5,
#contact h2,
#contact h4,
#contact h6,
#contact .text-body,
#contact .text-secondary {
  transition: color 0.3s ease;
}

#contact .card {
  background-color: #ffffff;
  border-color: #dee2e6;
  transition: all 0.3s ease;
}

#contact .form-control {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

#contact .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(79,70,229,0.2);
  background-color: #ffffff;
}

#contact .follow-journey {
  border-top: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

#contact .follow-journey h6 {
  color: #212529;
}

#contact .follow-journey .social-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #212529;
  color: #212529;
  transition: all 0.3s ease;
  text-decoration: none;
}

#contact .follow-journey .social-icon:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff !important;
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

[data-bs-theme="dark"] #contact {
  background-color: #0f172a;
}

[data-bs-theme="dark"] #contact h5,
[data-bs-theme="dark"] #contact h2,
[data-bs-theme="dark"] #contact h4,
[data-bs-theme="dark"] #contact h6 {
  color: #f8f9fa;
}

[data-bs-theme="dark"] #contact .text-body {
  color: #f1f5f9;
}

[data-bs-theme="dark"] #contact .text-secondary {
  color: #adb5bd;
}

[data-bs-theme="dark"] #contact .card {
  background-color: #1e293b;
  border-color: #334155;
}

[data-bs-theme="dark"] #contact .form-control {
  background-color: #0f172a;
  color: #f8f9fa;
  border: 1px solid #475569;
}

[data-bs-theme="dark"] #contact .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(79,70,229,0.4);
  background-color: #1e293b;
}

[data-bs-theme="dark"] #contact .follow-journey {
  border-color: #475569;
}

[data-bs-theme="dark"] #contact .follow-journey h6 {
  color: #f8f9fa;
}

[data-bs-theme="dark"] #contact .follow-journey .social-icon {
  border-color: #f8f9fa;
  color: #f8f9fa;
}

/* ===============================
   FOOTER SECTION
================================ */
.footer-section {
  transition: all 0.3s ease;
  padding: 60px 0;
  background-color: #212529;
  color: #fff;
}

.footer-section h5,
.footer-section p,
.footer-section .footer-link,
.footer-section .text-secondary,
.footer-section .text-white {
  transition: color 0.3s ease;
  text-decoration: none;
}

.footer-section .footer-link {
  color: #ffffff;
  transition: color 0.3s ease;
}

.footer-section .footer-link:hover {
  color: var(--primary-color);
}

.footer-section .social-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #ffffff;
  color: #ffffff;
  transition: all 0.3s ease;
  text-decoration: none;
}

.footer-section .social-icon:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff !important;
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.footer-section .subscribe-form input {
  background-color: #212529;
  color: #fff;
  border: 1px solid #495057;
  transition: all 0.3s ease;
}

.footer-section .subscribe-form input::placeholder {
  color: #adb5bd;
}

.footer-section .subscribe-form button {
  transition: all 0.3s ease;
}

/* DARK MODE FOOTER */
[data-bs-theme="dark"] .footer-section {
  background-color: #0f172a;
}

[data-bs-theme="dark"] .footer-section h5,
[data-bs-theme="dark"] .footer-section p,
[data-bs-theme="dark"] .footer-section .footer-link,
[data-bs-theme="dark"] .footer-section .text-white {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .footer-section .text-secondary {
  color: #94a3b8;
}

[data-bs-theme="dark"] .footer-section .social-icon {
  border-color: #f8f9fa;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .footer-section .subscribe-form input {
  background-color: #1e293b;
  color: #f8f9fa;
  border-color: #475569;
}

[data-bs-theme="dark"] .footer-section .subscribe-form input::placeholder {
  color: #94a3b8;
}

[data-bs-theme="dark"] .footer-section .subscribe-form button {
  background-color: var(--primary-color);
  color: #fff;
}

/* ===============================
   GRADIENT TEXT
================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===============================
   MEDIA QUERIES
================================ */
@media (max-width: 768px) {
  .hero-section {
    padding-top: 60px;
  }

  .profile-img {
    max-width: 300px;
    max-height: 300px;
  }
}

#back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  display: none; /* hidden by default */
  width: 50px;
  height: 50px;
  z-index: 100;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

#back-to-top:hover {
  transform: translateY(-3px);
}
#back-to-top.show {
  display: flex;
}

/* Section Reveal */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal-hidden.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.navbar.scrolled {
    background-color: var(--bs-body-bg) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#lang-toggle {
    min-width: 90px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid #3b82f6;
}

#lang-img {
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

#lang-toggle:hover {
    transform: translateY(-2px);
}