/* Modern CSS with enhanced styling, animations, and responsiveness */
:root {
  --primary: #4a8eff;
  --primary-light: #77aaff;
  --primary-dark: #3a7ae0;
  --secondary: #6c757d;
  --dark-bg: #121212;
  --darker-bg: #0a0a0a;
  --card-bg: #1e1e1e;
  --card-hover: #2c2c2c;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #8a8a8a;
  --border-color: rgba(255, 255, 255, 0.05);
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --transition: all 0.3s ease;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.2);
  --border-radius: 10px;
  --border-radius-sm: 5px;
  --border-radius-lg: 15px;
  --font-family: "Poppins", Arial, sans-serif;
  
  /* New variables for more consistent spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;
  
  /* Animation durations */
  --animation-fast: 0.2s;
  --animation-normal: 0.3s;
  --animation-slow: 0.5s;
}

/* Light theme variables with improved contrast */
.light-mode {
  --dark-bg: #f8f9fa;
  --darker-bg: #e9ecef;
  --card-bg: #ffffff;
  --card-hover: #f1f3f5;
  --text: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-color: rgba(0, 0, 0, 0.05);
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 80px; /* Account for fixed header */
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  background-color: var(--dark-bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color var(--animation-normal), color var(--animation-normal);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-light);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-family);
}

/* Improved focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Preloader with improved animation */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--darker-bg);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity var(--animation-normal);
}

.loader {
  display: flex;
  align-items: center;
}

.loader .circle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--primary);
  margin: 0 5px;
  animation: bounce 1.5s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.loader .circle:nth-child(1) {
  animation-delay: 0s;
}

.loader .circle:nth-child(2) {
  animation-delay: 0.2s;
}

.loader .circle:nth-child(3) {
  animation-delay: 0.4s;
}

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

/* Navigation with improved accessibility */
nav {
  background-color: rgba(18, 18, 18, 0.95);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--animation-normal);
}

.light-mode nav {
  background-color: rgba(248, 249, 250, 0.95);
}

nav.scrolled {
  padding: 10px 0;
  background-color: rgba(10, 10, 10, 0.98);
}

.light-mode nav.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: transform var(--animation-normal);
}

.logo:hover {
  transform: scale(1.05);
}

.logo-text {
  position: relative;
}

.text-primary {
  color: var(--primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-link i {
  font-size: 0.9rem;
  transition: transform var(--animation-normal);
}

.nav-link:hover i {
  transform: translateY(-2px);
}

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

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width var(--animation-normal) ease;
}

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

.theme-toggle {
  cursor: pointer;
  margin-left: var(--space-xl);
  font-size: 1.2rem;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.theme-toggle:hover {
  color: var(--primary);
  transform: rotate(30deg);
  background-color: rgba(74, 142, 255, 0.1);
}

.hamburger {
  display: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  transition: background-color var(--animation-normal);
}

.hamburger:hover {
  background-color: rgba(74, 142, 255, 0.1);
}

.hamburger div {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  margin: 2px;
  transition: var(--transition);
}

/* Header with enhanced animations */
header {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  color: var(--text);
  padding: 160px 0 80px;
  position: relative;
  overflow: hidden;
}

.light-mode header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(74, 142, 255, 0.1), transparent 70%);
  z-index: 2;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  z-index: 3;
}

.header-text {
  flex: 1;
}

.greeting {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: var(--space-md);
  position: relative;
  padding-left: 30px;
}

.greeting::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 2px;
  background-color: var(--primary);
  transform: translateY(-50%);
}

.header-image {
  position: relative;
}

.image-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(74, 142, 255, 0.3);
  animation: morphing 10s infinite ease-in-out;
  border: 4px solid var(--primary);
  transition: transform var(--animation-normal);
}

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

@keyframes morphing {
  0% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  25% {
    border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
  }
  75% {
    border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
  }
  100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

header h1 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  font-weight: 700;
  line-height: 1.2;
}

.typed-text {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: var(--space-xl);
  font-weight: 500;
  min-height: 2.5rem;
}

header p {
  font-size: 1.1rem;
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
  max-width: 600px;
}

.header-buttons {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.btn {
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Button hover effect with ripple */
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

.btn:hover::after {
  width: 300%;
  height: 300%;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(74, 142, 255, 0.3);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border: 2px solid var(--primary);
  position: relative;
  z-index: 1;
}

.btn-outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--primary);
  transition: width var(--animation-normal);
  z-index: -1;
}

.btn-outline:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(74, 142, 255, 0.3);
}

.btn-outline:hover::before {
  width: 100%;
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.scroll-down a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid var(--text);
  border-radius: 20px;
  position: relative;
  margin-bottom: var(--space-md);
}

.wheel {
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 1.5s infinite;
}

@keyframes scroll {
  0% {
    opacity: 1;
    top: 10px;
  }
  100% {
    opacity: 0;
    top: 30px;
  }
}

.scroll-text {
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
}

.arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(45deg);
  animation: arrow 1.5s infinite;
}

@keyframes arrow {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
  }
  50% {
    transform: rotate(45deg) translate(5px, 5px);
  }
}

/* Sections with improved spacing */
.section {
  padding: var(--space-xxl) 0;
  position: relative;
}

.section-alt {
  background-color: var(--darker-bg);
}

.light-mode .section-alt {
  background-color: var(--darker-bg);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-xxl);
  position: relative;
}

.subtitle {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: var(--space-md);
  padding: 5px 15px;
  background-color: rgba(74, 142, 255, 0.1);
  border-radius: 50px;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--text);
  margin-bottom: var(--space-xl);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 3px;
  background-color: var(--primary);
}

.title-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.02);
  text-transform: uppercase;
  z-index: -1;
  white-space: nowrap;
}

.light-mode .title-bg {
  color: rgba(0, 0, 0, 0.02);
}

/* About Section with improved layout */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 50px;
  align-items: center;
}

.about-image {
  position: relative;
}

.image-border {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.image-border:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.about-img {
  width: 100%;
  height: auto;
  display: block;
}

.experience-badge {
  position: absolute;
  bottom: 30px;
  right: 0;
  background-color: var(--primary);
  color: white;
  padding: 15px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform var(--animation-normal);
}

.experience-badge:hover {
  transform: translateY(-5px) scale(1.05);
}

.exp-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.exp-text {
  font-size: 0.9rem;
  text-align: center;
}

.about-text h3 {
  font-size: 1.8rem;
  margin-bottom: var(--space-xl);
  color: var(--primary);
}

.about-text p {
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
}

.info-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.info-item i {
  color: var(--primary);
  font-size: 1.2rem;
  margin-top: 3px;
}

.info-item strong {
  color: var(--text);
  margin-right: 5px;
}

.about-buttons {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* Skills Section with improved tabs */
.skills-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.tab-btn {
  padding: 10px 20px;
  background-color: var(--card-bg);
  border: none;
  border-radius: 50px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tab-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.tab-btn:hover::after {
  width: 300%;
  height: 300%;
}

.tab-btn:hover,
.tab-btn.active {
  background-color: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px;
}

.skill-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 25px;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(74, 142, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--animation-normal);
  z-index: -1;
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

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

.skill-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(74, 142, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  color: var(--primary);
  transition: transform var(--animation-normal);
}

.skill-card:hover .skill-icon {
  transform: scale(1.1);
}

.skill-card h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.skill-bar {
  height: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.light-mode .skill-bar {
  background-color: rgba(0, 0, 0, 0.1);
}

.skill-progress {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  border-radius: 10px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
}

.skill-percentage {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Experience Section with improved timeline */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 2px;
  background-color: rgba(255, 255, 255, 0.1);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

.light-mode .timeline::after {
  background-color: rgba(0, 0, 0, 0.1);
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
  margin-bottom: 30px;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--primary);
  border-radius: 50%;
  z-index: 1;
  top: 15px;
  transition: transform var(--animation-normal), box-shadow var(--animation-normal);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(74, 142, 255, 0.5);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -10px;
}

.timeline-date {
  position: absolute;
  top: 15px;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  transition: transform var(--animation-normal);
}

.timeline-item:hover .timeline-date {
  transform: translateY(-3px);
}

.timeline-item:nth-child(odd) .timeline-date {
  right: -150px;
}

.timeline-item:nth-child(even) .timeline-date {
  left: -150px;
}

.timeline-content {
  padding: 30px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(74, 142, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--animation-normal);
  z-index: -1;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.timeline-content:hover::before {
  opacity: 1;
}

.timeline-content h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--primary);
}

.company {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.timeline-list {
  margin-top: 15px;
}

.timeline-list li {
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.timeline-list li i {
  color: var(--primary);
  font-size: 1rem;
  margin-top: 3px;
}

/* Projects Section with improved filtering */
.projects-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.filter-btn {
  padding: 8px 20px;
  background-color: var(--card-bg);
  border: none;
  border-radius: 50px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.filter-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.filter-btn:hover::after {
  width: 300%;
  height: 300%;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary);
  color: white;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.project {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--animation-normal) cubic-bezier(0.1, 0.7, 0.1, 1);
  border: 1px solid var(--border-color);
  opacity: 1;
  transform: scale(1);
}

.project:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.project-img-container {
  position: relative;
  overflow: hidden;
  height: 200px;
  cursor: zoom-in;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-img-container:hover .project-img {
  transform: scale(1.2);
}

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

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

.project-overlay-content {
  text-align: center;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-link {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.project-link:hover {
  background-color: white;
  color: var(--primary);
  transform: translateY(-5px);
}

.project-content {
  padding: 20px;
}

.project h3 {
  color: var(--text);
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.project p {
  color: var(--text-secondary);
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tag {
  background-color: rgba(74, 142, 255, 0.1);
  color: var(--primary);
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  transition: transform var(--animation-normal), background-color var(--animation-normal);
}

.project:hover .project-tag {
  transform: translateY(-2px);
  background-color: rgba(74, 142, 255, 0.2);
}

/* Modal with improved accessibility */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity var(--animation-normal);
}

.modal.show {
  opacity: 1;
}

.modal-content {
  max-width: 90%;
  max-height: 80vh;
  margin: auto;
  display: block;
  border-radius: var(--border-radius);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#modalCaption {
  color: white;
  text-align: center;
  padding: 15px 0;
  font-size: 1.2rem;
}

.close {
  color: white;
  font-size: 35px;
  position: absolute;
  top: 15px;
  right: 25px;
  transition: var(--animation-normal);
}

.close:hover {
  color: var(--primary);
  transform: scale(1.2);
}
.close:focus {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

/* Stats Section with improved counters */
.stats-section {
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url("img/stats-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 80px 0;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  text-align: center;
}

.stat-item {
  padding: 30px;
  background-color: rgba(30, 30, 30, 0.7);
  border-radius: var(--border-radius);
  transition: var(--transition);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.stat-item:hover {
  transform: translateY(-10px);
  background-color: rgba(30, 30, 30, 0.9);
}

.stat-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
  transition: transform var(--animation-normal);
}

.stat-item:hover .stat-icon {
  transform: scale(1.2);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
}

.stat-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Contact Section with improved form */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.contact-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(74, 142, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--animation-normal);
  z-index: -1;
}

.contact-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.contact-card:hover::before {
  opacity: 1;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(74, 142, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
  transition: transform var(--animation-normal);
}

.contact-item:hover .contact-icon {
  transform: scale(1.1);
}

.contact-details h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.contact-details p,
.contact-details a {
  color: var(--text-secondary);
  transition: color var(--animation-normal);
}

.contact-details a:hover {
  color: var(--primary);
}

.social-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
  transition: var (--transition);
  border: 1px solid var(--border-color);
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.social-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(74, 142, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--animation-normal);
  z-index: -1;
}

.social-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.social-card:hover::before {
  opacity: 1;
}

.social-card h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

.social-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
  z-index: -1;
}

.social-link:hover {
  color: white;
  transform: translateY(-5px);
}

.social-link:hover::after {
  width: 150%;
  height: 150%;
}

.contact-form-container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.contact-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(74, 142, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--animation-normal);
  z-index: -1;
}

.contact-form-container:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.contact-form-container:hover::before {
  opacity: 1;
}

.form-header {
  margin-bottom: 30px;
}

.form-header h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.form-header p {
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.required {
  color: var(--danger);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--card-bg);
  color: var(--text);
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 142, 255, 0.2);
}

.btn-submit {
  margin-top: 10px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--card-bg);
  color: var(--text);
  border-radius: var(--border-radius);
  padding: 12px 15px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-info {
  border-left: 4px solid var(--info);
}

.toast-success i {
  color: var(--success);
}

.toast-error i {
  color: var(--danger);
}

.toast-info i {
  color: var(--info);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  margin-left: 10px;
  transition: color 0.3s ease;
}

.toast-close:hover {
  color: var(--text);
}

/* Footer with improved layout */
footer {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  color: var(--text);
  padding: 70px 0 20px;
  position: relative;
}

.light-mode footer {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--primary-light), transparent);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}

.footer-logo {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-logo p {
  color: var(--text-secondary);
}

.footer-links h3,
.footer-contact h3,
.footer-social h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-links h3::after,
.footer-contact h3::after,
.footer-social h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary);
  transition: width var(--animation-normal);
}

.footer-links:hover h3::after,
.footer-contact:hover h3::after,
.footer-social:hover h3::after {
  width: 60px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.footer-contact p {
  margin-bottom: 10px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-contact i {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
}

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

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-5px);
}

/* Animations with improved performance */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), 
              transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.fade-in.appeared {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.2s;
}

.delay-2 {
  transition-delay: 0.4s;
}

.delay-3 {
  transition-delay: 0.6s;
}

/* Responsive Design with improved mobile experience */
@media (max-width: 1200px) {
  html {
    font-size: 15px;
  }

  .image-wrapper {
    width: 250px;
    height: 250px;
  }

  .title-bg {
    font-size: 5rem;
  }
}

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

  .section {
    padding: 80px 0;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .greeting::before {
    left: -30px;
  }

  .header-buttons {
    justify-content: center;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-image {
    margin: 0 auto;
    max-width: 350px;
  }

  .info-item {
    justify-content: center;
  }

  .about-buttons {
    justify-content: center;
  }

  .timeline::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-item::after {
    left: 20px;
  }

  .timeline-item:nth-child(odd) .timeline-dot {
    right: auto;
    left: 20px;
  }

  .timeline-item:nth-child(even) .timeline-dot {
    left: 20px;
  }

  .timeline-item:nth-child(odd) .timeline-date {
    right: auto;
    left: 70px;
    top: -30px;
  }

  .timeline-item:nth-child(even) .timeline-date {
    left: 70px;
    top: -30px;
  }

  .contact-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    right: -100%;
    top: 70px;
    background-color: var(--card-bg);
    flex-direction: column;
    width: 100%;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    z-index: 999;
  }

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

  .nav-links li {
    margin: 15px 0;
  }

  .nav-link {
    justify-content: center;
  }

  .hamburger {
    display: flex;
  }

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

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

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

  .theme-toggle {
    margin-right: 20px;
  }

  header {
    padding: 120px 0 60px;
  }

  header h1 {
    font-size: 2.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo {
    align-items: center;
  }

  .footer-links h3::after,
  .footer-contact h3::after,
  .footer-social h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links ul {
    align-items: center;
  }

  .footer-contact p {
    justify-content: center;
  }
  
  .toast {
    min-width: auto;
    max-width: 90%;
  }
}

@media (max-width: 576px) {
  .section-title h2 {
    font-size: 2rem;
  }

  .title-bg {
    font-size: 3.5rem;
  }

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

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

  .stats-container {
    grid-template-columns: 1fr;
  }

  .contact-form-container {
    padding: 20px;
  }
  
  .modal-content {
    max-width: 95%;
  }
  
  .close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}

/* Accessibility improvements */
.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;
}

/* Print styles for better CV printing */
@media print {
  nav, 
  .back-to-top,
  .scroll-down,
  .btn-submit,
  .filter-btn,
  .tab-btn {
    display: none !important;
  }
  
  body {
    background-color: white !important;
    color: black !important;
  }
  
  .section {
    padding: 20px 0 !important;
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: none !important;
    color: black !important;
  }
  
  .project-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  
  .skills-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  
  .contact-container {
    grid-template-columns: 1fr 1fr !important;
  }
}