/* ===== CSS Variables ===== */
:root {
  --primary: #6366f1; /* Premium indigo */
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bright: #a5b4fc; /* Brighter violet for dark mode */

  --secondary: #8b5cf6;
  --accent: #f59e0b;

  --dark: #0f172a; /* Rich dark blue */
  --darker: #020617;
  --light: #f8fafc;
  --lighter: #ffffff;

  --gray: #64748b;
  --gray-light: #cbd5e1;
  --gray-dark: #334155;

  --success: #10b981;
  --error: #ef4444;

  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);

  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 35px 60px -15px rgba(0, 0, 0, 0.3);

  --glow: 0 0 20px rgba(99, 102, 241, 0.4);
  --glow-secondary: 0 0 20px rgba(139, 92, 246, 0.4);

  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  --gradient-primary: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--secondary) 100%
  );
  --gradient-dark: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
  --gradient-card: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.8) 0%,
    rgba(15, 23, 42, 0.9) 100%
  );
}

/* Light theme variables - ENHANCED CONTRAST */
[data-theme="light"] {
  --primary: #2563eb; /* Premium blue for light theme */
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-bright: #60a5fa;

  --secondary: #7c3aed;
  --accent: #d97706;

  --dark: #ffffff;
  --darker: #f8fafc;
  --light: #0f172a;
  --lighter: #1e293b;

  --gray: #475569;
  --gray-light: #334155;
  --gray-dark: #cbd5e1;

  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(0, 0, 0, 0.15);

  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 35px 60px -15px rgba(0, 0, 0, 0.2);

  --glow: 0 0 20px rgba(37, 99, 235, 0.3);
  --glow-secondary: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* ===== Global Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--light);
  background: var(--gradient-dark);
  overflow-x: hidden;
  position: relative;
  font-weight: 400;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Animated background blobs */
.bg-blob {
  position: fixed;
  width: 600px;
  height: 600px;
  background: var(--gradient-primary);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: -1;
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
  transition: all 0.5s ease;
}

.blob-2 {
  width: 800px;
  height: 800px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  top: 20%;
  right: -200px;
  animation-delay: 7s;
  animation-duration: 25s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--accent) 100%
  );
  bottom: 10%;
  left: -100px;
  animation-delay: 3s;
  animation-duration: 18s;
}

[data-theme="light"] .bg-blob {
  opacity: 0.08;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  33% {
    transform: translate(30px, -30px) rotate(3deg) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) rotate(-2deg) scale(0.95);
  }
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  transition: color 0.5s ease;
}

h1 {
  font-size: 4rem;
  font-weight: 800;
}

h2 {
  font-size: 3rem;
  position: relative;
  display: inline-block;
}

h3 {
  font-size: 1.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--gray-light);
  font-weight: 400;
  transition: color 0.5s ease;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background 0.5s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-header h2 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: background 0.5s ease;
}

.section-header p {
  font-size: 1.2rem;
  color: var(--gray-light);
  margin-top: 1.5rem;
  font-weight: 400;
}

.text-center {
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  z-index: -1;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow), 0 15px 30px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--light);
  border: 2px solid var(--gray-dark);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

/* Enhanced hover colors for dark mode */
[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-bright) 0%, #a855f7 100%);
  box-shadow: 0 0 30px rgba(165, 180, 252, 0.6),
    0 15px 35px rgba(165, 180, 252, 0.4);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-bright);
  box-shadow: 0 0 25px rgba(165, 180, 252, 0.4);
}

[data-theme="dark"] .social-link:hover {
  background: linear-gradient(135deg, var(--primary-bright) 0%, #a855f7 100%);
  box-shadow: 0 0 25px rgba(165, 180, 252, 0.5);
}

[data-theme="dark"] .skill:hover {
  background: linear-gradient(135deg, var(--primary-bright) 0%, #a855f7 100%);
  box-shadow: 0 0 25px rgba(165, 180, 252, 0.4);
}

[data-theme="dark"] .project-card:hover {
  border-color: var(--primary-bright);
  box-shadow: 0 0 30px rgba(165, 180, 252, 0.4), var(--shadow-lg);
}

[data-theme="dark"] .contact-item:hover {
  border-color: var(--primary-bright);
  box-shadow: 0 0 25px rgba(165, 180, 252, 0.3);
}

[data-theme="dark"] .form-btn:hover {
  background: linear-gradient(135deg, var(--primary-bright) 0%, #a855f7 100%);
  box-shadow: 0 0 30px rgba(165, 180, 252, 0.5),
    0 15px 35px rgba(165, 180, 252, 0.3);
}

[data-theme="dark"] .back-to-top:hover {
  background: linear-gradient(135deg, var(--primary-bright) 0%, #a855f7 100%);
  box-shadow: 0 0 30px rgba(165, 180, 252, 0.5);
}

/* Light theme hover colors */
[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--secondary) 100%
  );
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4),
    0 15px 30px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .social-link:hover {
  background: var(--gradient-primary);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

[data-theme="light"] .skill:hover {
  background: var(--gradient-primary);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .project-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.3), var(--shadow-lg);
}

[data-theme="light"] .contact-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .form-btn:hover {
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--secondary) 100%
  );
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.4),
    0 15px 30px rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .back-to-top:hover {
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--secondary) 100%
  );
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.4);
}

/* ===== Header & Navbar ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

[data-theme="light"] header {
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

header.scrolled {
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] header.scrolled {
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--light);
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: 0.05em;
  transition: color 0.5s ease;
}

.logo span {
  color: var(--primary);
  font-weight: 700;
  margin-left: 4px;
  transition: color 0.5s ease;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 3rem;
}

.nav-link {
  font-weight: 500;
  color: var(--gray-light);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--light);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
}

.bar {
  width: 25px;
  height: 2px;
  background: var(--light);
  transition: var(--transition);
  border-radius: 2px;
}

.menu-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== Theme Toggle Styles ===== */
.theme-toggle-container {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 2rem;
}

.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  border: none;
  background: var(--card-bg);
  border-radius: 50px;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  border-color: var(--primary);
  box-shadow: var(--glow);
  transform: scale(1.05);
}

.toggle-track {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background: var(--gradient-primary);
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-icon {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.toggle-icon i {
  font-size: 0.8rem;
  transition: var(--transition);
  z-index: 1;
}

.toggle-icon .fa-sun {
  color: var(--accent);
  opacity: 0;
}

.toggle-icon .fa-moon {
  color: var(--primary-light);
  opacity: 1;
}

/* Toggle states for light theme */
[data-theme="light"] .toggle-track {
  transform: translateX(30px);
  background: var(--gradient-primary);
}

[data-theme="light"] .toggle-icon .fa-sun {
  opacity: 1;
  color: var(--accent);
}

[data-theme="light"] .toggle-icon .fa-moon {
  opacity: 0;
}

/* ===== HERO SECTION ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 100px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.5s ease;
}

[data-theme="light"] .hero-badge {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-text {
  padding-right: 2rem;
}

.greeting {
  display: block;
  font-size: 1.5rem;
  color: var(--gray-light);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.hero-text h1 {
  font-size: 4.5rem;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-text .title {
  font-size: 1.5rem;
  color: var(--primary-light);
  margin-bottom: 2rem;
  display: block;
  font-weight: 500;
}

.hero-text p {
  font-size: 1.3rem;
  margin-bottom: 3rem;
  max-width: 600px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* ADDED: Extra space after social links */
.hero-social-container {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--gray-light);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
}

.social-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.social-link:hover {
  color: white;
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--glow);
}

.social-link:hover::before {
  opacity: 1;
}

.hero-image {
  display: flex;
  justify-content: center;
  position: relative;
}

.image-container {
  position: relative;
  display: inline-block;
}

.image-frame {
  position: relative;
  border-radius: 30px;
  padding: 8px;
  background: var(--gradient-primary);
  animation: float 6s ease-in-out infinite;
}

.profile-img {
  width: 400px;
  height: 400px;
  object-fit: cover;
  border-radius: 25px;
  border: 4px solid var(--dark);
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.profile-img:hover {
  transform: scale(1.02);
}

.glow-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 420px;
  background: var(--gradient-primary);
  border-radius: 35px;
  filter: blur(40px);
  opacity: 0.3;
  z-index: 1;
  animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  0% {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-element {
  position: absolute;
  width: 50px;
  height: 50px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  animation: float-element 8s ease-in-out infinite;
  backdrop-filter: blur(10px);
  transition: all 0.5s ease;
}

.element-1 {
  top: 10%;
  left: -20px;
  animation-delay: 0s;
}

.element-2 {
  top: 70%;
  right: -10px;
  animation-delay: 2s;
}

.element-3 {
  bottom: 20%;
  left: -15px;
  animation-delay: 4s;
}

@keyframes float-element {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* ===== ABOUT SECTION ===== */
#about {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(20px);
}

[data-theme="light"] #about {
  background: rgba(226, 232, 240, 0.7);
}

.about-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  flex-direction: column;
}

.about-text {
  font-size: 1.3rem;
  line-height: 1.8;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: all 0.5s ease;
}

.about-text p {
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* ===== SKILLS SECTION ===== */
#skills-section {
  background: rgba(15, 23, 42, 0.3);
}

[data-theme="light"] #skills-section {
  background: rgba(226, 232, 240, 0.5);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.skill-category {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.skill-category:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--glow);
}

.skill-category h3 {
  color: var(--primary-light);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  text-align: center;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.skill {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  color: var(--gray-light);
  transition: var(--transition);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

[data-theme="light"] .skill {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.skill:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--glow);
  border-color: var(--primary);
}

/* ===== PROJECTS SECTION ===== */
#projects {
  background: rgba(15, 23, 42, 0.5);
}

[data-theme="light"] #projects {
  background: rgba(226, 232, 240, 0.5);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position: relative;
  height: fit-content;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: var(--glow), var(--shadow-lg);
}

.project-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

[data-theme="light"] .project-overlay {
  background: rgba(248, 250, 252, 0.9);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: white;
  transition: var(--transition);
  text-decoration: none;
}

.project-link:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: var(--glow);
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  color: var(--light);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.project-content p {
  color: var(--gray-light);
  margin-bottom: 1.2rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.3);
  transition: all 0.5s ease;
}

[data-theme="light"] .tech-tag {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ===== CONTACT SECTION ===== */
#contact {
  background: rgba(15, 23, 42, 0.3);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] #contact {
  background: rgba(226, 232, 240, 0.3);
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* UPDATED: Make contact items clickable */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 16px;
  background: var(--card-bg);
  transition: var(--transition);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.contact-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--glow);
}

.contact-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: var(--glow);
}

.contact-details h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--light);
}

.contact-details span {
  /* Changed 'a' to 'span' as the anchor tag is the contact-item itself */
  color: var(--gray-light);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1rem;
}

.contact-item:hover .contact-details span {
  color: var(--primary-light);
}

.contact-form {
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.form-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--light);
  text-align: center;
  font-weight: 600;
}

.form-group {
  margin-bottom: 2rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--light);
  font-size: 1rem;
}

.form-control {
  width: 100%;
  padding: 1.2rem 1.5rem;
  border: 2px solid var(--card-border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  transition: var(--transition);
  font-size: 1rem;
  font-family: inherit;
  color: var(--light);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .form-control {
  background: rgba(255, 255, 255, 0.8);
  color: var(--gray-light);
}

.form-control::placeholder {
  color: var(--gray);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .form-control:focus {
  background: rgba(255, 255, 255, 0.95);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.form-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  padding: 1.2rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
  box-shadow: var(--glow);
  position: relative;
  overflow: hidden;
  gap: 0.75rem;
}

.form-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow), 0 15px 30px rgba(99, 102, 241, 0.3);
}

.btn-loader {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.form-btn.loading .btn-text {
  opacity: 0;
}

.form-btn.loading .btn-loader {
  display: block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== FOOTER ===== */
footer {
  background: var(--darker);
  color: white;
  padding: 4rem 0 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.5s ease;
}

/* FIX: Set a darker background for light theme footer for visibility */
[data-theme="light"] footer {
  background: #e2e8f0; /* Slightly darker gray for contrast */
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
/* FIX: Change footer logo color in light mode to dark text */
[data-theme="light"] .footer-logo {
  color: var(--light); /* Uses the dark text color for light theme */
}
[data-theme="light"] .footer-logo span {
  color: var(--primary);
}
/* FIX: Change copyright text color in light mode to dark gray for visibility */
[data-theme="light"] .copyright {
  color: var(--gray); /* Uses dark gray for light theme */
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
/* FIX: Change footer link color in light mode to dark gray for visibility and increase size */
[data-theme="light"] .footer-links a {
  color: var(--gray);
}
[data-theme="light"] .footer-links a:hover {
  color: var(--primary);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
}

.footer-logo span {
  color: var(--primary);
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

/* ENHANCEMENT: Increase footer link size */
.footer-links a {
  color: var(--gray-light);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  font-size: 1.1rem; /* Increased size */
}

.footer-links a:hover {
  color: var(--primary-light);
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  color: var(--gray);
  font-size: 0.9rem;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: white; /* Changed color to white for better visibility */
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--glow), 0 10px 25px rgba(99, 102, 241, 0.4);
}

/* ===== Form Status Messages ===== */
.form-status {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.success-message {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.error-message {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== Performance Optimizations ===== */
/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hardware acceleration for smooth scrolling */
.smooth-render {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
  .container {
    max-width: 1000px;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .hero-content {
    gap: 3rem;
  }
}

@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-text {
    padding-right: 0;
    order: 2;
  }

  .hero-image {
    order: 1;
  }

  .about-content {
    flex-direction: column;
  }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .social-links {
    justify-content: center;
  }

  .hero-btns {
    justify-content: center;
    flex-wrap: wrap;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    height: calc(100vh - 100%);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4rem;
    gap: 2.5rem;
    transition: var(--transition);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
  }

  [data-theme="light"] .nav-links {
    background: rgba(248, 250, 252, 0.98);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-container {
    padding: 0 1rem;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .hero-text h1 {
    font-size: 2.8rem;
  }

  .profile-img {
    width: 300px;
    height: 300px;
  }

  .glow-effect {
    width: 320px;
    height: 320px;
  }

  .theme-toggle-container {
    margin-right: 1rem;
  }

  .theme-toggle {
    width: 50px;
    height: 26px;
  }

  .toggle-track {
    width: 22px;
    height: 22px;
  }

  [data-theme="light"] .toggle-track {
    transform: translateX(24px);
  }

  /* Optimize mobile performance */
  .bg-blob {
    filter: blur(60px);
    opacity: 0.1;
  }

  .floating-elements {
    display: none;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 1.5rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .section-header h2 {
    font-size: 2.2rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .hero-badge {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  .greeting {
    font-size: 1.2rem;
  }

  .hero-text .title {
    font-size: 1.2rem;
  }

  .hero-text p {
    font-size: 1.1rem;
  }

  .hero-btns {
    flex-direction: column;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .profile-img {
    width: 250px;
    height: 250px;
  }

  .glow-effect {
    width: 270px;
    height: 270px;
  }

  .social-links {
    justify-content: center;
    margin-top: 2rem;
  }

  .about-text {
    font-size: 1.1rem;
    padding: 2rem 1.5rem;
  }

  .skills-list {
    gap: 0.6rem;
  }

  .skill {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }

  .projects-grid {
    gap: 1.5rem;
  }

  .project-image {
    height: 180px;
  }

  .project-content {
    padding: 1.2rem;
  }

  .project-content h3 {
    font-size: 1.2rem;
  }

  .contact-item {
    padding: 1.5rem;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .contact-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .contact-details h3 {
    font-size: 1.1rem;
  }

  .form-control {
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
  }

  .form-btn {
    padding: 1rem 1.2rem;
    font-size: 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-content {
    gap: 2rem;
  }

  .theme-toggle-container {
    margin-right: 0.5rem;
  }

  /* Further mobile optimizations */
  .bg-blob {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .section {
    padding: 4rem 0;
  }

  .hero-text .title {
    font-size: 1.1rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .profile-img {
    width: 220px;
    height: 220px;
  }

  .glow-effect {
    width: 240px;
    height: 240px;
  }

  .skill {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }

  .tech-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    margin: 0 0.5rem;
  }

  .project-image {
    height: 160px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--darker);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
