/*
 * Portfolio Website - Enhanced CSS
 * Author: Vishnu Vardhan Putta
 */

/* --------------------------
   CSS Variables
   -------------------------- */
:root {
  /* Dark Mode Colors (Default) */
  --primary: #0078d4;
  --primary-dark: #0064b0;
  --primary-light: #3a9beb;
  --secondary: #9932cc;
  --secondary-dark: #7b1fa2;
  --secondary-light: #ba68c8;
  --dark: #121212;
  --darker: #090909;
  --light: #f0f0f0;
  --accent: #ff3366;
  --accent-dark: #e6194b;
  --text: #ffffff;
  --text-muted: #dddddd;
  --card-bg: rgba(18, 18, 18, 0.9);
  --card-border: rgba(0, 120, 212, 0.3);
  --glass-bg: rgba(18, 18, 18, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* Light Mode Colors */
  --primary-light-mode: #0078d4;
  --primary-dark-light-mode: #005ea6;
  --primary-light-light-mode: #3a9beb;
  --secondary-light-mode: #8a2be2;
  --secondary-dark-light-mode: #6a1fc0;
  --secondary-light-light-mode: #b05aff;
  --dark-light-mode: #ffffff;
  --darker-light-mode: #f5f5f5;
  --light-light-mode: #121212;
  --accent-light-mode: #e6194b;
  --accent-dark-light-mode: #c2003d;
  --text-light-mode: #222222;
  --text-muted-light-mode: #444444;
  --card-bg-light-mode: #ffffff;
  --card-border-light-mode: rgba(0, 120, 212, 0.3);
  --glass-bg-light-mode: rgba(255, 255, 255, 0.9);
  --glass-border-light-mode: rgba(0, 0, 0, 0.1);
  --glass-shadow-light-mode: 0 8px 32px rgba(0, 0, 0, 0.1);

  /* Other variables */
  --transition-slow: 0.5s;
  --transition-medium: 0.3s;
  --transition-fast: 0.2s;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.625rem;
  --radius-lg: 1.25rem;
  --radius-xl: 3rem;
  --radius-circle: 50%;
}

/* Light mode class */
body.light-mode {
  --primary: var(--primary-light-mode);
  --primary-dark: var(--primary-dark-light-mode);
  --primary-light: var(--primary-light-light-mode);
  --secondary: var(--secondary-light-mode);
  --secondary-dark: var(--secondary-dark-light-mode);
  --secondary-light: var(--secondary-light-light-mode);
  --dark: var(--dark-light-mode);
  --darker: var(--darker-light-mode);
  --light: var(--light-light-mode);
  --accent: var(--accent-light-mode);
  --accent-dark: var(--accent-dark-light-mode);
  --text: var(--text-light-mode);
  --text-muted: var(--text-muted-light-mode);
  --card-bg: var(--card-bg-light-mode);
  --card-border: var(--card-border-light-mode);
  --glass-bg: var(--glass-bg-light-mode);
  --glass-border: var(--glass-border-light-mode);
  --glass-shadow: var(--glass-shadow-light-mode);
}

/* --------------------------
   Global Styles
   -------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 5rem;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--darker);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  background-image: radial-gradient(
      circle at 20% 70%,
      rgba(138, 43, 226, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(0, 120, 212, 0.1) 0%,
      transparent 50%
    ),
    linear-gradient(to right, rgba(0, 120, 212, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 120, 212, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 2.5rem 2.5rem, 2.5rem 2.5rem;
  background-attachment: fixed;
  transition: background-color var(--transition-medium) ease,
    color var(--transition-medium) ease;
}

/* Remove focus outlines for buttons */
button:focus,
a:focus,
.filter-btn:focus,
.btn:focus,
.theme-toggle-fixed:focus,
.back-to-top:focus,
.nav-item:focus {
  outline: none;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  position: relative;
  z-index: 1;
}

/* --------------------------
   Animations
   -------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes glitch {
  0% {
    text-shadow: 2px 0 0 rgba(255, 0, 100, 0.7), -2px 0 0 rgba(0, 255, 255, 0.7);
  }
  25% {
    text-shadow: -2px 0 0 rgba(255, 0, 100, 0.7), 2px 0 0 rgba(0, 255, 255, 0.7);
  }
  50% {
    text-shadow: 4px 0 0 rgba(255, 0, 100, 0.7), -4px 0 0 rgba(0, 255, 255, 0.7);
  }
  75% {
    text-shadow: -4px 0 0 rgba(255, 0, 100, 0.7), 4px 0 0 rgba(0, 255, 255, 0.7);
  }
  100% {
    text-shadow: 2px 0 0 rgba(255, 0, 100, 0.7), -2px 0 0 rgba(0, 255, 255, 0.7);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes float-particle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  25% {
    opacity: 0.4;
  }
  50% {
    transform: translateY(-300px) translateX(50px);
    opacity: 0.2;
  }
  75% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-600px) translateX(-50px);
    opacity: 0;
  }
}

@keyframes logo-glow {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.pulse {
  animation: pulse 2s infinite ease-in-out;
}
.floating {
  animation: float 6s infinite ease-in-out;
}
.rotate {
  animation: rotate 20s linear infinite;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
  animation: gradient-shift 5s ease infinite;
}

/* --------------------------
   Enhanced Logo
   -------------------------- */
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.25rem;
  text-decoration: none;
  position: relative;
  transition: all var(--transition-fast) ease;
}

.logo-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 2;
}

.code-tag {
  color: var(--accent);
  font-weight: 900;
  position: relative;
  z-index: 2;
}

.accent {
  color: var(--accent);
  font-weight: 700;
  position: relative;
  z-index: 2;
}

/* --------------------------
   Particles Effect
   -------------------------- */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  animation: float-particle 20s infinite linear;
}

/* --------------------------
   Glass Effect
   -------------------------- */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* --------------------------
   Theme Toggle Button
   -------------------------- */
.theme-toggle-fixed {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  cursor: pointer;
  z-index: 98;
  transition: all var(--transition-medium) ease;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
}

.theme-toggle-fixed:hover {
  transform: rotate(30deg);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.light-mode #darkIcon {
  display: none;
}

.light-mode #lightIcon {
  display: block;
}

#lightIcon {
  display: none;
}

#darkIcon {
  display: block;
}

/* --------------------------
   Header & Navigation
   -------------------------- */
header {
  padding: var(--space-sm) 0;
  position: fixed;
  width: 100%;
  z-index: 100;
  transition: all var(--transition-medium) ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Navigation menu */
.nav-links {
  display: flex;
  gap: 1.875rem;
  align-items: center;
}

/* Navigation items with highlight instead of underline */
.nav-item {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast) ease;
  padding: 0.5rem 1rem;
  position: relative;
  border-radius: 2rem;
  background: transparent;
}

/* Active state with background highlight */
.nav-item.active {
  background: rgba(0, 120, 212, 0.1);
  color: var(--primary-light);
}

/* Hover effect */
.nav-item:hover:not(.active) {
  background: rgba(0, 120, 212, 0.05);
  color: var(--primary-light);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
  z-index: 120;
}

.hamburger .line {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  margin: 5px 0;
  transition: all var(--transition-medium) ease;
  border-radius: 1000px;
  display: block;
}

.hamburger.active .line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --------------------------
   Main Content
   -------------------------- */
main {
  padding-top: 4rem;
  position: relative;
}

.section-padding {
  padding: var(--space-xl) 0;
  position: relative;
}

/* --------------------------
   Hero Section
   -------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Left-aligned hero content with consistent width */
.hero-content {
  width: 100%;
  max-width: 70rem;
  animation: fadeIn 0.6s ease;
  position: relative;
  z-index: 2;
  text-align: left;
}

.hero-title,
.hero-subtitle,
.hero-description {
  max-width: 70rem; /* Ensure consistent width for all elements */
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 1.875rem;
  color: var(--text-muted);
}

.hero-description {
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* --------------------------
   CTAs & Buttons
   -------------------------- */
/* Default for large screens - left-aligned */
.cta-buttons {
  display: flex;
  gap: 1.25rem;
  justify-content: flex-start; /* Left align buttons */
}

.btn {
  padding: 0.75rem 1.875rem;
  border-radius: 3.125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-medium) ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border: none;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: width 0.3s ease;
  z-index: 0;
}

.btn:hover::before,
.btn:focus::before {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 120, 212, 0.4);
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 120, 212, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 0.125rem solid var(--primary);
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.1);
}

.btn-outline:hover,
.btn-outline:focus {
  background: rgba(0, 120, 212, 0.1);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 120, 212, 0.2);
}

/* --------------------------
   Section Titles
   -------------------------- */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.9375rem;
  color: var(--primary);
}

.section-title::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 5rem;
  height: 0.1875rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-circle);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-medium) ease;
  z-index: 99;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  transform: translateY(-5px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.3);
}

/* --------------------------
   About Section
   -------------------------- */
.about {
  display: flex;
  gap: 3.125rem;
  align-items: center;
}

.about-image {
  flex: 1;
  max-width: 25rem;
  position: relative;
}

.image-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.3);
  transform: perspective(1000px) rotateY(5deg);
  transition: transform var(--transition-medium) ease;
}

.image-wrapper:hover {
  transform: perspective(1000px) rotateY(0);
}

.image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-medium) ease;
}

.image-wrapper:hover img {
  transform: scale(1.05);
}

/* Decorative elements */
.circle-decoration {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-circle);
  top: -20px;
  left: -20px;
  z-index: -1;
  opacity: 0.7;
}

.square-decoration {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 2px solid var(--secondary);
  bottom: -20px;
  right: -20px;
  z-index: -1;
  opacity: 0.7;
  transform: rotate(15deg);
}

.about-content {
  flex: 1;
}

.about-description {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 1rem;
}

.about-description:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

/* --------------------------
   Skills Section
   -------------------------- */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.skill-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  width: calc(33.33% - 1.25rem);
  border: 1px solid var(--card-border);
  transition: all var(--transition-medium) ease;
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.light-mode .skill-card {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  border: 1px solid var(--card-border);
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, transparent 100%);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-medium) ease;
}

.skill-card:hover {
  transform: translateY(-0.625rem);
  border-color: var(--primary);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

.skill-card:hover::before {
  opacity: 0.1;
}

.skill-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(0, 120, 212, 0.1);
  border-radius: var(--radius-circle);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.skill-icon-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  opacity: 0.2;
  transition: opacity var(--transition-medium) ease;
}

.skill-card:hover .skill-icon-container::before {
  opacity: 0.5;
}

.skill-icon {
  font-size: 1.75rem;
  color: var(--primary);
  position: relative;
  z-index: 1;
  transition: all var(--transition-medium) ease;
}

.skill-card:hover .skill-icon {
  transform: scale(1.2);
  color: var(--text);
}

.skill-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
  position: relative;
}

.skill-title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-medium) ease;
}

.skill-card:hover .skill-title::after {
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.skill-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.skill-list {
  list-style: none;
  margin-top: 1.25rem;
}

.skill-list li {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

.skill-list li:before {
  content: '▹';
  color: var(--primary);
  margin-right: 0.5rem;
  transition: all var(--transition-medium) ease;
}

.skill-card:hover .skill-list li:before {
  color: var(--accent);
  transform: scale(1.2);
}

.skill-highlight {
  position: relative;
  z-index: 1;
  transition: all var(--transition-medium) ease;
}

.skill-card:hover .skill-highlight {
  color: var(--primary-light);
}

/* --------------------------
   Project Filter
   -------------------------- */
.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 0.7rem 1.3rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-fast) ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}

.filter-btn.active {
  color: white;
  border-color: transparent;
}

.filter-btn.active::before {
  opacity: 1;
}

/* Fix filter buttons in light mode */
.light-mode .filter-btn {
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}

.light-mode .filter-btn:hover,
.light-mode .filter-btn:focus {
  background: rgba(0, 120, 212, 0.1);
  color: var(--text);
}

.light-mode .filter-btn.active {
  color: white;
  border-color: transparent;
}

/* --------------------------
   Projects Section
   -------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-medium) ease;
  border: 1px solid var(--card-border);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Make sure card border is visible in light mode */
.light-mode .project-card {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  border: 1px solid var(--card-border);
}

.project-card:hover {
  transform: translateY(-0.625rem) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.2), 0 0 0.5rem var(--primary-dark);
}

.project-image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow) ease;
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-medium) ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.project-title::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--transition-medium) ease;
}

.project-card:hover .project-title::after {
  width: 100%;
}

/* Make project description containers equal height */
.project-description-container {
  flex: 1;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.project-description {
  font-size: 1rem;
  color: var(--text);
}

/* Fix contrast in light mode */
.light-mode .project-description {
  color: var(--text);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.project-tech span {
  background: rgba(0, 120, 212, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text);
  border: 1px solid rgba(0, 120, 212, 0.2);
  transition: all var(--transition-fast) ease;
}

.project-card:hover .project-tech span {
  background: rgba(0, 120, 212, 0.2);
  color: var(--primary-light);
  border-color: rgba(0, 120, 212, 0.4);
}

/* Fix GitHub and Demo links - more visible in both modes */
.project-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.project-link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 120, 212, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  transition: all var(--transition-medium) ease;
}

.project-link:hover,
.project-link:focus {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Hide projects not matching the selected filter */
.project-card.hidden {
  display: none;
}

/* --------------------------
   Grid lines decoration for sections
   -------------------------- */
.section-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      to right,
      rgba(0, 120, 212, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(0, 120, 212, 0.05) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  opacity: 0.5;
}

/* --------------------------
   Contact Section
   -------------------------- */
.contact-info {
  max-width: 37.5rem;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  position: relative;
  z-index: 1;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Fix for light mode contact section */
.light-mode .contact-info {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
  border: 1px solid var(--card-border);
}

.contact-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 120, 212, 0.1) 0%,
    rgba(138, 43, 226, 0.1) 100%
  );
  z-index: -1;
}

.contact-description {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text);
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-medium) ease;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 120, 212, 0.05);
  border: 1px solid var(--card-border);
}

.contact-item:hover {
  transform: translateX(10px);
  background: rgba(0, 120, 212, 0.1);
  border-color: var(--primary);
}

.contact-icon-container {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 120, 212, 0.1);
  border-radius: var(--radius-circle);
  transition: all var(--transition-medium) ease;
}

.contact-item:hover .contact-icon-container {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.contact-icon {
  font-size: 1.25rem;
  color: var(--primary);
  transition: all var(--transition-medium) ease;
}

.contact-item:hover .contact-icon {
  color: var(--text);
  transform: scale(1.2);
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  transition: color var(--transition-medium) ease;
  flex: 1;
}

.contact-item:hover .contact-link {
  color: var(--primary-light);
}

/* Decoration elements */
.contact-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.circle-large {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: var(--radius-circle);
  border: 1px solid rgba(0, 120, 212, 0.2);
  top: -150px;
  right: -150px;
  opacity: 0.6;
}

.circle-small {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: var(--radius-circle);
  border: 1px solid rgba(138, 43, 226, 0.2);
  bottom: -100px;
  left: -100px;
  opacity: 0.6;
}

/* --------------------------
   Footer
   -------------------------- */
footer {
  background-color: var(--dark);
  padding: 2rem 0;
  text-align: center;
  position: relative;
  margin-top: var(--space-lg);
}

.footer-text {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-note .fa-heart {
  color: var(--accent);
}

/* --------------------------
   Loader
   -------------------------- */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--darker);
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.loader-hidden {
  opacity: 0;
  visibility: hidden;
}

/* --------------------------
   Responsive Styles
   -------------------------- */
@media (max-width: 75rem) {
  /* 1200px */
  html {
    font-size: 15px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 62rem) {
  /* 992px */
  html {
    font-size: 14px;
  }

  .about {
    flex-direction: column;
  }

  .about-image {
    max-width: 70%;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .skill-card {
    width: calc(50% - 1.25rem);
  }

  .project-filter {
    flex-wrap: wrap;
    justify-content: center;
  }

  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 48rem) {
  /* 768px */
  .nav-links {
    position: fixed;
    top: 4rem;
    right: -100%;
    width: 60%;
    height: calc(100vh - 4rem);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    transition: right var(--transition-medium) ease;
    z-index: 98;
    border-left: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
  }

  .nav-links.active {
    right: 0;
  }

  .hamburger {
    display: block;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .skill-card {
    width: 100%;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .project-filter {
    gap: 0.5rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .contact-info {
    padding: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 48rem) {
  /* 768px and below */
  .cta-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    max-width: none; /* No max-width to allow full span */
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 36rem) {
  /* 576px */
  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .contact-link {
    word-break: break-all;
  }

  .project-tech {
    justify-content: center;
  }

  .theme-toggle-fixed,
  .back-to-top {
    width: 2.5rem;
    height: 2.5rem;
    bottom: 1rem;
  }

  .theme-toggle-fixed {
    left: 1rem;
  }

  .back-to-top {
    right: 1rem;
  }

  .container {
    padding: 0 0.75rem;
  }
}

/* --------------------------
   Accessibility Improvements
   -------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .floating,
  .pulse,
  .rotate,
  .gradient-text,
  .particle {
    animation: none !important;
  }
}
