/**
* Template Name: iPortfolio - v3.7.0
* Template URL: https://bootstrapmade.com/iportfolio-bootstrap-portfolio-websites-template/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
*/

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
:root {
  /* Colors with fallbacks */
  --primary-color: #4f46e5;
  --secondary-color: #818cf8;
  --text-color: #334155;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --heading-color: #1e293b;
  --border-color: #e2e8f0;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Typography */
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Containers */
  --container-max-width: 1200px;
  --container-padding: 1rem;
  
  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 300ms;
  --transition-slow: 500ms;
  
  /* Enhanced shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* Enhanced gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, #818cf8 100%);
  --gradient-text: linear-gradient(135deg, var(--primary-color) 0%, #818cf8 100%);
  
  /* Additional Colors */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.7;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Z-index */
  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;

  /* Responsive Design Improvements */
  --h1-font-size: clamp(2rem, 5vw, 3.5rem);
  --h2-font-size: clamp(1.6rem, 4vw, 2.5rem);
  --p-font-size: clamp(0.9rem, 2vw, 1.1rem);

  /* Typography and Spacing */
  --spacing-xs: 0.25rem;    /* 4px */
  --spacing-sm: 0.5rem;     /* 8px */
  --spacing-md: 0.75rem;    /* 12px - reduced from 1rem */
  --spacing-lg: 1rem;       /* 16px - reduced from 1.5rem */
  --spacing-xl: 1.5rem;     /* 24px - reduced from 2rem */
  --spacing-2xl: 2rem;      /* 32px - reduced from 4rem */
  --line-height-tight: 1.2;
  --line-height-normal: 1.4;  /* Reduced from 1.6 */
  --line-height-relaxed: 1.6; /* Reduced from 1.8 */

  /* Update spacing variables for more compact layout */
  --section-spacing: 1.5rem;      /* Reduced from 2rem */
  --section-spacing-mobile: 1rem;  /* Reduced from 1.5rem */
}

/* Dark mode variables */
.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --text-color: #e2e8f0;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --heading-color: #f1f5f9;
  --border-color: #334155;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: all var(--transition-speed) ease;
  overflow-x: hidden;
  scroll-behavior: smooth;
  letter-spacing: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  color: var(--heading-color);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

p {
  margin-bottom: 0.75rem;
  line-height: var(--line-height-normal);
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

/*--------------------------------------------------------------
# Back to top button
--------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 996;
  background: #149ddd;
  width: 40px;
  height: 40px;
  border-radius: 50px;
  transition: all 0.4s;
}
.back-to-top i {
  font-size: 28px;
  color: #fff;
  line-height: 0;
}
.back-to-top:hover {
  background: #2eafec;
  color: #fff;
}
.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
#header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  transition: all 0.3s ease;
  z-index: 997;
  padding: 0;
  background: linear-gradient(180deg, #040b14 0%, #0a1a2f 100%) !important;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

@media (max-width: 1199px) {
  #header {
    left: -300px;
  }
  
  .mobile-nav-active #header {
    left: 0;
  }
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  position: fixed;
  right: 15px;
  top: 15px;
  z-index: 9998;
  border: 0;
  font-size: 24px;
  transition: all 0.4s;
  outline: none !important;
  background-color: var(--primary-color);
  color: #fff;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.mobile-nav-toggle:hover {
  background-color: var(--secondary-color);
}

@media (max-width: 1199px) {
  .mobile-nav-toggle {
    display: flex;
  }
  
  .nav-menu ul {
    padding: 0 20px;
  }
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 320px;
  z-index: 9998;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.sidebar-toggle i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.sidebar-toggle:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.sidebar-toggle.collapsed {
  left: 20px;
}

.sidebar-toggle.collapsed i {
  transform: rotate(180deg);
}

#header .profile {
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  margin: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

#header .profile:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

#header .profile img {
  margin: 15px auto;
  display: block;
  width: 140px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#header .profile img:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

#header .profile h1 {
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-bold);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin: 15px 0 5px;
  padding: 0;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#header .profile h1 a {
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
}

#header .profile h1 a:hover {
  color: var(--primary-color);
}

#header .profile h2 {
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-medium);
  font-size: 1rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.8);
  margin: 10px 0;
  padding: 0;
  text-align: center;
}

#header .profile .social-links {
  margin-top: 15px;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

#header .profile .social-links a {
  font-size: 18px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  line-height: 1;
  padding: 12px 0;
  margin-right: 4px;
  border-radius: 50%;
  text-align: center;
  width: 42px;
  height: 42px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

#header .profile .social-links a:hover {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.1) rotate(360deg);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

#header .profile .social-links a i {
  font-size: 18px;
  transition: all 0.3s ease;
}

#header .profile .social-links a:hover i {
  transform: scale(1.1);
}

/* Special styles for specific social icons */
#header .profile .social-links a.linkedin:hover {
  background: #0077b5;
}

#header .profile .social-links a.twitter:hover {
  background: #1DA1F2;
}

#header .profile .social-links a.instagram:hover {
  background: #E4405F;
}

#header .profile .social-links a.github:hover {
  background: #333;
}

#header .profile .social-links a.devpost:hover {
  background: #003E54;
}

#header .profile .social-links a.gcp:hover {
  background: #4285F4;
}

#header .profile .social-links a.x-twitter {
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#header .profile .social-links a.x-twitter i {
  font-size: 20px;
  font-weight: 700;
}

#header .profile .social-links a.x-twitter:hover {
  background: #000000;
  color: #fff;
  transform: scale(1.1) rotate(360deg);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

/* Remove old twitter styles */
#header .profile .social-links a.twitter:hover {
  background: #000000;
}

.nav-menu {
  padding: 1rem 1rem 0 1rem;
}

.nav-menu ul {
  padding: 0;
  margin: 0;
  list-style: none;
  width: 100%;  /* Ensure the list takes full width */
}

.nav-menu a,
.nav-menu a:focus {
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* Align items to start for better icon placement */
  padding: 0.5rem 1rem;  /* Slightly increased horizontal padding */
  margin: 0 0 0.375rem 0;  /* Remove auto margins */
  width: 100%;  /* Take full width */
  max-width: none;  /* Remove max-width restriction */
  transition: all 0.3s ease;
  border-radius: 8px;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.nav-menu a i {
  margin-right: 12px;  /* Slightly increased for better spacing */
  font-size: 20px;
  min-width: 25px;
  text-align: center;
  color: var(--primary-color);
}

.nav-menu a:hover,
.nav-menu .active,
.nav-menu .active:focus,
.nav-menu li:hover > a {
  color: #fff;
  background: var(--primary-color);
  transform: translateX(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .nav-menu {
    padding: 0.75rem 0.75rem 0 0.75rem;  /* Slightly reduced padding for mobile */
  }
  
  .nav-menu a,
  .nav-menu a:focus {
    padding: 0.5rem 1rem;
    width: 100%;
  }
}

#main {
  margin-left: 300px;
  min-height: 100vh;
  padding: 40px 30px 30px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

#main.expanded {
  margin-left: 0;
}

@media (max-width: 1400px) {
  .container {
    max-width: 1140px;
  }
}

@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }

  #header {
    left: -300px;
  }

  #main {
    margin-left: 0;
    padding: 30px 20px;
  }

  .mobile-nav-active #header {
    left: 0;
  }

  .skills .row {
    grid-template-columns: repeat(4, 1fr); /* 4 items per row on medium screens */
    gap: 15px;
  }

  .section-title h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }

  #hero h1 {
    font-size: 2.8rem;
  }

  #hero p {
    font-size: 1.2rem;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .skills .row {
    grid-template-columns: repeat(3, 1fr); /* 3 items per row on mobile */
    gap: 12px;
  }

  .about .content {
    padding: 20px;
  }

  .resume .resume-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 540px;
    padding: 0 15px;
  }

  #main {
    padding: 20px 15px;
  }

  #hero {
    height: auto;
    min-height: 100vh;
  }

  #hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  #hero p {
    font-size: 1.1rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  .skills .row {
    grid-template-columns: repeat(3, 1fr); /* 3 items per row on mobile */
    gap: 12px;
  }

  .skill-item {
    padding: 10px;
  }

  .skill-item img {
    width: 24px;
    height: 24px;
  }

  .skill-item p {
    font-size: 12px;
  }

  .contact .col-md-6 {
    flex: 0 0 100%;
    padding-right: 0;
    margin-bottom: 15px;
  }

  .about .content ul li {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume .resume-item {
    padding-left: 15px;
    margin-bottom: 15px;
  }

  .resume .resume-item h4 {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .container {
    max-width: 100%;
    padding: 0 15px;
  }

  #hero h1 {
    font-size: 2.2rem;
  }

  #hero p {
    font-size: 1rem;
  }

  .section-title h2 {
    font-size: 1.6rem;
  }

  .skills .row {
    grid-template-columns: repeat(2, 1fr); /* 2 items per row on very small screens */
    gap: 10px;
  }

  .skill-item {
    width: calc(50% - 10px);
    padding: 10px;
  }

  .skill-item img {
    max-width: 35px;
  }

  .modern-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.875rem;
  }

  .about .content {
    padding: 15px;
  }

  .resume .resume-item h4 {
    font-size: 0.9rem;
  }

  .resume .resume-item h5 {
    font-size: 0.85rem;
  }
}

/* Ensure proper spacing and sizing */
.section-padding {
  padding: 60px 0;
}

@media (max-width: 992px) {
  .section-padding {
    padding: 40px 0;
  }
}

@media (max-width: 768px) {
  .section-padding {
    padding: 30px 0;
  }
}

/* Consistent font sizes */
:root {
  --h1-font-size: clamp(2rem, 5vw, 3.5rem);
  --h2-font-size: clamp(1.6rem, 4vw, 2.5rem);
  --p-font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* Use fluid typography */
#hero h1 {
  font-size: var(--h1-font-size);
}

.section-title h2 {
  font-size: var(--h2-font-size);
}

p, .content p {
  font-size: var(--p-font-size);
}

/* Ensure proper image scaling */
img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* Consistent spacing */
.row {
  margin-left: -15px;
  margin-right: -15px;
}

[class*="col-"] {
  padding-left: 15px;
  padding-right: 15px;
}

/* Prevent content overflow */
* {
  max-width: 100%;
  box-sizing: border-box;
}

/* Improve text readability */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.6;
  }
}

/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/* Desktop Navigation */
.nav-menu {
  padding: 1rem 1rem 0 1rem;
}
.nav-menu * {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-menu > ul > li {
  position: relative;
  white-space: nowrap;
}
.nav-menu a, .nav-menu a:focus {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  transition: all var(--transition-speed) var(--transition-timing);
  border-radius: 8px;
  font-weight: var(--font-weight-medium);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-primary);
  letter-spacing: 0.01em;
}
.nav-menu a i {
  font-size: 20px;
  margin-right: 10px;
  color: var(--primary-color);
}
.nav-menu a:hover, .nav-menu .active, .nav-menu .active:focus, .nav-menu li:hover > a {
  color: #fff;
  background: var(--primary-color);
  transform: translateX(3px);
}
.nav-menu a:hover i, .nav-menu .active i, .nav-menu .active:focus i, .nav-menu li:hover > a i {
  color: #fff;
}

/* Mobile Navigation */
@media (max-width: 1199px) {
  .mobile-nav-toggle {
    display: block;
    position: fixed;
    right: 15px;
    top: 15px;
    z-index: 9999;
    background: var(--primary-color);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .mobile-nav-toggle i {
    font-size: 24px;
    transition: transform 0.3s ease;
  }

  .mobile-nav-toggle:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
  }

  .mobile-nav-active .mobile-nav-toggle i {
    transform: rotate(180deg);
  }

  #header {
    left: -300px;
    transition: all 0.3s ease-in-out;
  }

  .mobile-nav-active #header {
    left: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  }

  .nav-menu {
    padding: 20px 0;
  }

  .nav-menu * {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nav-menu > ul > li {
    position: relative;
    white-space: nowrap;
  }

  .nav-menu a,
  .nav-menu a:focus {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    transition: 0.3s;
    border-radius: 8px;
  }

  .nav-menu a i,
  .nav-menu a:focus i {
    font-size: 20px;
    margin-right: 15px;
    color: rgba(255, 255, 255, 0.7);
  }

  .nav-menu a:hover,
  .nav-menu .active,
  .nav-menu .active:focus,
  .nav-menu li:hover > a {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
  }

  .nav-menu a:hover i,
  .nav-menu .active i,
  .nav-menu .active:focus i,
  .nav-menu li:hover > a i {
    color: var(--primary-color);
  }
}

/* Prevent body scroll when menu is open */
.mobile-nav-active {
  overflow: hidden;
}

.mobile-nav-active body {
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Improve header scrolling on mobile */
#header {
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-active #header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.languages {
  margin-bottom: 0; /* Remove bottom margin */
  padding-bottom: 0; /* Remove bottom padding */
}

.extracurricular {
  margin-bottom: 0; /* Remove bottom margin */
  padding-bottom: 0; /* Remove bottom padding */
}

/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
#hero {
  width: 100%;
  height: 100vh;
  background: url("../img/sf.jpg") top center;
  background-size: cover;
  position: relative;
  padding: 0;
  margin-top: 0;
  z-index: 1;
}
#hero:before {
  content: "";
  background: rgba(5, 13, 24, 0.3);
  position: absolute;
  bottom: 0;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
}
#hero .hero-container {
  position: relative;
  z-index: 2;
  min-width: 300px;
  padding: 0 30px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#hero h1 {
  margin: 0 0 10px 0;
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-bold);
  font-size: 3.5rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #ffffff !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
#hero p {
  color: #fff;
  margin-bottom: 50px;
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  opacity: 0.95;
}
#hero p span {
  color: #fff;
  padding-bottom: 4px;
  letter-spacing: 1px;
  border-bottom: 3px solid green;
}

.modern-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white !important;
  background: var(--gradient-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.modern-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.95;
  color: white !important;
  text-decoration: none;
}

.modern-button.outline {
  background: transparent;
  border: 2px solid white;
  color: white !important;
}

.modern-button.outline:hover {
  background: white;
  color: var(--primary-color) !important;
}

/* Dark mode specific button styles */
.dark-mode .modern-button.outline {
  border-color: white;
  color: white !important;
}

.dark-mode .modern-button.outline:hover {
  background: white;
  color: var(--primary-color) !important;
}

@media (min-width: 1024px) {
  #hero {
    background-attachment: fixed;
  }
}
@media (max-width: 768px) {
  #hero h1 {
    font-size: 28px;
    line-height: 36px;
  }
  #hero h2 {
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 30px;
  }
}

/*--------------------------------------------------------------
# Sections General
--------------------------------------------------------------*/
section {
  padding: var(--section-spacing) 0;
  overflow: hidden;
  position: relative;
}

.section-bg {
  background: var(--bg-color);
}

.section-title {
  text-align: center;
  padding-bottom: 0.5rem;
  position: relative;
  margin-bottom: 1rem;  /* Reduced from 3rem */
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  padding-bottom: 15px;
  position: relative;
  color: var(--heading-color);
}

.section-title h2::after {
  content: "";
  position: absolute;
  display: block;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
  bottom: 0;
  left: calc(50% - 25px);
  transition: width 0.3s ease;
}

.section-title:hover h2::after {
  width: 100px;
  left: calc(50% - 50px);
}

.section-title p {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.9;
  margin-bottom: var(--spacing-lg);
}

/*--------------------------------------------------------------
# About
--------------------------------------------------------------*/
.about {
  padding-top: var(--section-spacing);
}

.about .modern-card {
  height: 100%;
  min-height: 400px;
}

.about .modern-card.p-0 {
  aspect-ratio: 3/4;
  height: auto;
}

.about .modern-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.about .content {
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-xl);
}

.about .content h3 {
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  margin-bottom: 0.75rem;
}
.about .content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0.75rem;
}
.about .content ul li {
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  line-height: var(--line-height-normal);
}
.about .content ul strong {
  margin-right: 10px;
}
.about .content ul i {
  font-size: 16px;
  margin-right: 5px;
  color: green;
  line-height: 0;
}
.about .content p:last-child {
  margin-bottom: 0;
}

/*--------------------------------------------------------------
# Skills
--------------------------------------------------------------*/
.skills {
  padding: var(--section-spacing) 0;
  background: var(--bg-color);
  position: relative;
  z-index: 2;
}

.skills .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.skills .row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  padding: 0;
}

.skill-item {
  width: 100%;
  aspect-ratio: 1;
  padding: 15px;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
}

.skill-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;  /* Ensure block display */
  max-width: 100%;  /* Ensure image doesn't overflow */
  margin: 0 auto;  /* Center the image */
}

.skill-item p {
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.2;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .skill-item img {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 992px) {
  .skill-item img {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 768px) {
  .skill-item img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 576px) {
  .skill-item img {
    width: 18px;
    height: 18px;
  }
}

/* Remove all other conflicting skill-related media queries */
// ... existing code ...

/* Improved Scrollbar */
#header::-webkit-scrollbar {
  width: 5px;
}

#header::-webkit-scrollbar-track {
  background: transparent;
}

#header::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Mobile Navigation Overlay */
.mobile-nav-active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 996;
  backdrop-filter: blur(3px);
}

/* Touch Device Optimizations */
@media (hover: none) {
  .skill-item:hover {
    transform: none;
  }

  .sidebar-toggle:hover {
    transform: none;
  }
}

/* Prevent Body Scroll When Mobile Nav is Active */
.mobile-nav-active {
  overflow: hidden;
}

/* Dark mode specific styles for skill icons */
.dark-mode .skill-item img {
  filter: brightness(1); /* Reset any filters */
  background: transparent;
}

/* Dark mode card styles */
.dark-mode .skill-item {
  background: var(--card-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dark-mode .skill-item:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.dark-mode .modern-card {
  background: var(--card-bg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
  .skills .row {
    grid-template-columns: repeat(6, 1fr);  /* 6 items per row */
    gap: 0.3rem;
  }
}

@media (max-width: 992px) {
  .skills .row {
    grid-template-columns: repeat(5, 1fr);  /* 5 items per row */
    gap: 0.25rem;
  }
}

@media (max-width: 768px) {
  .skills .row {
    grid-template-columns: repeat(4, 1fr);  /* 4 items per row */
    gap: 0.25rem;
  }

  .skill-item {
    padding: 0.3rem;
  }

  .skill-item img {
    width: 18px;  /* Even smaller on mobile */
    height: 18px;
  }

  .skill-item p {
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .skills .row {
    grid-template-columns: repeat(3, 1fr);  /* 3 items per row on very small screens */
    gap: 0.2rem;
  }
}

/* Dark mode styles for skills */
.dark-mode .skill-item {
  background: var(--card-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dark-mode .skill-item:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/*--------------------------------------------------------------
# Resume
--------------------------------------------------------------*/
.resume {
  position: relative;
  z-index: 2;
  padding: var(--section-spacing) 0;
}

.resume .resume-title {
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  font-size: 26px;
  margin-top: 20px;
  margin-bottom: 1.5rem;  /* Increased from var(--spacing-lg) */
  line-height: 1.4;  /* Added line height */
}
.resume .resume-item {
  padding: 0 0 1.25rem 1.25rem;  /* Increased bottom padding */
  margin-bottom: 1.25rem;  /* Increased margin */
  border-left: 2px solid var(--primary-color);
  position: relative;
}
.resume .resume-item h4 {
  line-height: 1.4;  /* Increased from 18px */
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  font-family: var(--font-secondary);
  color: var(--heading-color);
  margin-bottom: 0.5rem;  /* Added more space after heading */
}
.resume .resume-item h5 {
  font-size: 16px;
  background: rgba(20, 157, 221, 0.1);
  color: var(--text-color);
  padding: 5px 15px;
  display: inline-block;
  font-weight: var(--font-weight-medium);
  margin-bottom: 1rem;  /* Increased from 0.5rem */
  line-height: 1.4;  /* Added line height */
}
.resume .resume-item ul {
  padding-left: 20px;
  color: var(--text-color);
  margin-top: 0.75rem;  /* Increased from 0.5rem */
  margin-bottom: 0.75rem;  /* Increased from 0.5rem */
}
.resume .resume-item ul li {
  padding-bottom: 0.75rem;  /* Increased from 0.5rem */
  line-height: 1.6;  /* Increased from var(--line-height-normal) */
  margin-bottom: 0.5rem;  /* Added margin between list items */
}
.resume .resume-item ul li:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
}
.resume .resume-item p {
  line-height: 1.6;  /* Added line height for paragraphs */
  margin-bottom: 1rem;  /* Added margin for paragraphs */
}

/* Adjust spacing for mobile */
@media (max-width: 768px) {
  .resume .resume-item {
    padding: 0 0 1rem 1rem;  /* Slightly reduced padding */
    margin-bottom: 1rem;  /* Slightly reduced margin */
  }
  
  .resume .resume-item ul li {
    padding-bottom: 0.5rem;  /* Slightly reduced padding */
    line-height: 1.5;  /* Slightly reduced line height */
  }
}

.publication-btn {
  border: 2px solid black;
  background-color: white;
  color: black;
  padding: 3px 7px;
  font-size: 16px;
  cursor: pointer;
}

.public {
  border-color: #04AA6D;
  color: green;
}

.public:hover {
  background-color: #04AA6D;
  color: white;
}

.resume .publication-btn {
  border: 2px solid black;
  background-color: white;
  color: black;
  padding: 3px 7px;
  font-size: 16px;
  cursor: pointer;
}

.resume .publication-btn.public {
  border-color: #04AA6D;
  color: green;
}

.resume .publication-btn.public:hover {
  background-color: #04AA6D;
  color: white;
}

/*--------------------------------------------------------------
# Projects
--------------------------------------------------------------*/
.portfolio .portfolio-item {
  margin-bottom: 30px;
}
.portfolio #portfolio-flters {
  padding: 0;
  margin: 0 auto 35px auto;
  list-style: none;
  text-align: center;
  background: var(--card-bg);
  border-radius: 50px;
  padding: 2px 15px;
}
.portfolio #portfolio-flters li {
  cursor: pointer;
  display: inline-block;
  padding: 10px 15px 8px 15px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-color);
  margin-bottom: 5px;
  transition: all 0.3s ease-in-out;
}
.portfolio #portfolio-flters li:hover, .portfolio #portfolio-flters li.filter-active {
  color: green;
}
.portfolio #portfolio-flters li:last-child {
  margin-right: 0;
}
.portfolio .portfolio-wrap {
  transition: 0.3s;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.portfolio .portfolio-wrap::before {
  content: "";
  background: rgba(255, 255, 255, 0.5);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transition: all ease-in-out 0.3s;
  z-index: 2;
  opacity: 0;
}
.portfolio .portfolio-wrap .portfolio-links {
  opacity: 1;
  left: 0;
  right: 0;
  bottom: -60px;
  z-index: 3;
  position: absolute;
  transition: all ease-in-out 0.3s;
  display: flex;
  justify-content: center;
}
.portfolio .portfolio-wrap .portfolio-links a {
  color: #fff;
  font-size: 28px;
  text-align: center;
  background: rgba(20, 157, 221, 0.75);
  transition: 0.3s;
  width: 50%;
}
.portfolio .portfolio-wrap .portfolio-links a:hover {
  background: rgba(20, 157, 221, 0.95);
}
.portfolio .portfolio-wrap .portfolio-links a + a {
  border-left: 1px solid green;
}
.portfolio .portfolio-wrap:hover::before {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 1;
}
.portfolio .portfolio-wrap:hover .portfolio-links {
  opacity: 1;
  bottom: 0;
}

@-webkit-keyframes animate-loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes animate-loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/*--------------------------------------------------------------
# Contact
--------------------------------------------------------------*/
.contact {
  position: relative;
  z-index: 2;
  padding: var(--section-spacing) 0;
}

.contact .info {
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  height: 100%;
  margin-bottom: 1rem;
}

.contact .info i {
  font-size: 20px;
  color: var(--primary-color);
  float: left;
  width: 44px;
  height: 44px;
  background: rgba(79, 70, 229, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.contact .info h4 {
  padding: 0 0 0 60px;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--heading-color);
}

.contact .info p {
  padding: 0 0 0 60px;
  margin-bottom: 0.75rem;
  font-size: 14px;
  color: var(--text-color);
}

.contact .info .email p {
  padding-top: 5px;
}

.contact .info .social-links {
  padding-left: 60px;
}

.contact .info .social-links a {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #fff;
  line-height: 1;
  margin: 0 5px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: all 0.3s ease;
}

.contact .info .social-links a:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

.contact .php-email-form {
  width: 100%;
  padding: 30px;
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  border-radius: 16px;
}

.contact .php-email-form .form-group {
  padding-bottom: 8px;
}

.contact .php-email-form .validate {
  display: none;
  color: red;
  margin: 0 0 15px 0;
  font-weight: 400;
  font-size: 13px;
}

.contact .php-email-form .error-message {
  display: none;
  color: #fff;
  background: #ed3c0d;
  text-align: left;
  padding: 15px;
  font-weight: 600;
}

.contact .php-email-form .error-message br+br {
  margin-top: 25px;
}

.contact .php-email-form .sent-message {
  display: none;
  color: #fff;
  background: #18d26e;
  text-align: center;
  padding: 15px;
  font-weight: 600;
}

.contact .php-email-form .loading {
  display: none;
  background: #fff;
  text-align: center;
  padding: 15px;
}

.contact .php-email-form .loading:before {
  content: "";
  display: inline-block;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  margin: 0 10px -6px 0;
  border: 3px solid #18d26e;
  border-top-color: transparent;
  animation: animate-loading 1s linear infinite;
}

.contact .php-email-form .form-group {
  margin-bottom: 15px;
}

.contact .php-email-form label {
  padding-bottom: 8px;
}

.contact .php-email-form input,
.contact .php-email-form textarea {
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.contact .php-email-form input {
  height: 44px;
}

.contact .php-email-form textarea {
  padding: 10px 15px;
}

.contact .php-email-form button[type=submit] {
  background: #149ddd;
  border: 0;
  padding: 10px 24px;
  color: #fff;
  transition: 0.4s;
  border-radius: 4px;
}

.contact .php-email-form button[type=submit]:hover {
  background: #37b3ed;
}

@keyframes animate-loading {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/*--------------------------------------------------------------
# Breadcrumbs
--------------------------------------------------------------*/
.breadcrumbs {
  padding: 20px 0;
  background: #f9f9f9;
}
.breadcrumbs h2 {
  font-size: 26px;
  font-weight: 300;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
}
.breadcrumbs ol li + li {
  padding-left: 10px;
}
.breadcrumbs ol li + li::before {
  display: inline-block;
  padding-right: 10px;
  color: #0e2442;
  content: "/";
}
@media (max-width: 768px) {
  .breadcrumbs .d-flex {
    display: block !important;
  }
  .breadcrumbs ol {
    display: block;
  }
  .breadcrumbs ol li {
    display: inline-block;
  }
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
#footer {
  padding: 20px 0;
  background: #040b14;
  color: #fff;
  text-align: center;
  position: relative;
  margin-top: 0;
  z-index: 3;
}
#footer .copyright {
  text-align: center;
}
#footer .credits {
  padding-top: 5px;
  text-align: center;
  font-size: 13px;
  color: #eaebf0;
}
@media (max-width: 1199px) {
  #footer {
    position: relative;
    width: 100%;
    left: 0;
  }
}

/* Add this CSS for smaller screens like mobile devices */
@media (max-width: 768px) {
  .skills .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Align items in the center */
  }
  .skills .col-sm {
    flex: 0 0 50%; /* Make each column take up half of the container width */
    max-width: 50%; /* Ensure each column takes up half of the container width */
    text-align: center; /* Align text in the center */
  }
}

/* Theme Toggle Button Styles */
.theme-toggle {
  margin: 20px 0;
  padding: 0 15px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.theme-toggle button {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 200px;
  height: 44px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .theme-toggle {
    margin: 15px auto;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .theme-toggle button {
    width: auto;
    min-width: 160px;
    margin: 0 auto;
    padding: 10px 20px;
  }
}

.theme-toggle i {
  font-size: 16px;
  transition: all 0.3s ease;
}

/* Dark mode transition */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode specific styles */
.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --text-color: #e2e8f0;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --heading-color: #f1f5f9;
  --border-color: #334155;
}

.dark-mode .theme-toggle button {
  border-color: var(--text-color);
  color: var(--text-color);
}

.dark-mode .theme-toggle button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Ensure smooth transitions for all color changes */
*, *::before, *::after {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Dark mode specific component styles */
.dark-mode .modern-card,
.dark-mode .about .content,
.dark-mode .contact .info,
.dark-mode .contact-form {
  background: var(--card-bg);
  border-color: var(--border-color);
}

.dark-mode .skill-item {
  background: var(--card-bg);
  border-color: var(--border-color);
}

.dark-mode .nav-menu a {
  color: rgba(255, 255, 255, 0.9);
}

.dark-mode .nav-menu a:hover,
.dark-mode .nav-menu .active {
  background: var(--primary-color);
  color: #fff;
}

.dark-mode #header {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
}

.dark-mode .form-control {
  background: var(--bg-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

.dark-mode .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Modern Animations and Transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Apply animations to sections */
section {
  animation: fadeIn 0.5s ease-out forwards;
}

.resume .resume-item {
  animation: slideIn 0.5s ease-out forwards;
  animation-delay: calc(var(--item-index, 0) * 0.1s);
}

.skills .col-sm {
  animation: scaleIn 0.5s ease-out forwards;
  animation-delay: calc(var(--item-index, 0) * 0.1s);
}

/* Modern Card Styles */
.modern-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: var(--card-padding);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.modern-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Enhanced Skills Section */
.skills .col-sm {
  padding: 20px;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.skills .col-sm:hover {
  transform: translateY(-3px);
}

.skills .col-sm img {
  transition: transform 0.3s ease;
}

.skills .col-sm:hover img {
  transform: scale(1.1);
}

/* Enhanced Resume Timeline */
.resume .resume-item {
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.resume .resume-item:hover {
  transform: translateX(5px);
}

.resume .resume-item::before {
  transition: all 0.3s ease;
}

.resume .resume-item:hover::before {
  transform: scale(1.2);
  box-shadow: 0 0 15px var(--primary-color);
}

/* Modern Button Styles */
.modern-button {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  background: var(--gradient-primary);
  color: white !important;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.modern-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.95;
}

.modern-button.outline {
  background: transparent;
  border: 2px solid white;
  color: white !important;
}

.modern-button.outline:hover {
  background: white;
  color: var(--primary-color) !important;
}

/* Enhanced Section Titles */
.section-title h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.section-title h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  background: var(--primary-color);
  width: 50px;
  margin: 0 auto;
}

.section-title:hover h2::after {
  width: 100px;
}

/* Glass Morphism Effects */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
}

.dark-mode .glass-effect {
  background: rgba(0, 0, 0, 0.2);
}

/* Enhanced Contact Form Styles */
.contact .php-email-form input,
.contact .php-email-form textarea {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.contact .php-email-form input:focus,
.contact .php-email-form textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(20, 157, 221, 0.1);
  outline: none;
}

.contact .php-email-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: var(--font-weight-medium);
  font-size: 14px;
}

.contact .php-email-form .form-group {
  margin-bottom: 20px;
}

.contact .php-email-form button[type=submit] {
  background: var(--primary-color);
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
  width: auto;
  min-width: 150px;
  margin-top: 20px;
}

.contact .php-email-form button[type=submit]:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Form validation styles */
.contact .php-email-form input.error,
.contact .php-email-form textarea.error {
  border-color: #dc3545;
}

.contact .php-email-form .error-message {
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
}

.contact .php-email-form .sent-message {
  background: #28a745;
  color: #fff;
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  background: rgba(16, 185, 129, 0.1);
}

/* Form loading state */
.contact-form.loading button[type="submit"] {
  opacity: 0.7;
  cursor: not-allowed;
}

.contact-form.loading button[type="submit"]::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: form-spinner 0.6s linear infinite;
}

@keyframes form-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Responsive Contact Form */
@media (max-width: 768px) {
  .contact-form {
    padding: 20px;
  }
  
  .contact-form .row {
    margin: 0 -10px;
  }
  
  .contact-form .form-group {
    padding: 0 10px;
    margin-bottom: 15px;
  }
  
  .contact-form button[type="submit"] {
    width: 100%;
    margin-top: 15px;
  }
}

/* Optimize sidebar scrollbar */
#header::-webkit-scrollbar {
  width: 5px;
}

#header::-webkit-scrollbar-track {
  background: transparent;
}

#header::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

/* Optimize navigation menu transitions */
.nav-menu a, 
.nav-menu a:focus {
  transition: all 0.15s ease;
  will-change: transform, background-color;
}

/* Reduce animation complexity */
.nav-menu a:hover,
.nav-menu .active,
.nav-menu .active:focus,
.nav-menu li:hover > a {
  transform: translateX(3px);
}

/* Optimize reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.2s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .skills .skill-item:hover,
  .nav-menu a:hover,
  .modern-card:hover {
    transform: none;
  }
  
  /* Disable animations on mobile */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* Loading Optimizations */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Reduce Reflow */
.skills .row {
  contain: content;
}

/* Contact Form Styling */
.contact-form {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  width: 100%;
}

.contact-form:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
}

.contact-form .form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  transition: all 0.3s ease;
}

.contact-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.contact-form textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.contact-form button[type="submit"] {
  background: var(--primary-color);
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
  width: auto;
  min-width: 150px;
  margin-top: 20px;
}

.contact-form button[type="submit"]:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Form validation styles */
.contact-form .form-control.error {
  border-color: var(--error-color);
}

.contact-form .error-message {
  color: var(--error-color);
  font-size: 13px;
  margin-top: 5px;
}

.contact-form .sent-message {
  color: var(--success-color);
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  background: rgba(16, 185, 129, 0.1);
}

/* Form loading state */
.contact-form.loading button[type="submit"] {
  opacity: 0.7;
  cursor: not-allowed;
}

.contact-form.loading button[type="submit"]::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: form-spinner 0.6s linear infinite;
}

@keyframes form-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Responsive Contact Form */
@media (max-width: 768px) {
  .contact-form {
    padding: 20px;
  }
  
  .contact-form .row {
    margin: 0 -10px;
  }
  
  .contact-form .form-group {
    padding: 0 10px;
    margin-bottom: 15px;
  }
  
  .contact-form button[type="submit"] {
    width: 100%;
    margin-top: 15px;
  }
}

/* Dark mode form styles */
.dark-mode .contact-form {
  background: var(--card-bg);
}

.dark-mode .contact-form .form-control {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.dark-mode .contact-form .form-control:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
}

/* Form validation styles */
.contact-form .form-control.error {
  border-color: var(--error-color);
}

.contact-form .error-message {
  color: var(--error-color);
  font-size: 13px;
  margin-top: 5px;
}

.contact-form .success-message {
  color: var(--success-color);
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  background: rgba(16, 185, 129, 0.1);
}

/* Form loading state */
.contact-form.loading button[type="submit"] {
  opacity: 0.7;
  cursor: not-allowed;
}

.contact-form.loading button[type="submit"]::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: form-spinner 0.6s linear infinite;
}

@keyframes form-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Responsive Contact Form */
@media (max-width: 768px) {
  .contact-form {
    padding: 20px;
  }
  
  .contact-form .row {
    margin: 0 -10px;
  }
  
  .contact-form .form-group {
    padding: 0 10px;
    margin-bottom: 15px;
  }
  
  .contact-form button[type="submit"] {
    width: 100%;
    margin-top: 15px;
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  #header {
    width: 100%;
    background: linear-gradient(180deg, #040b14 0%, #0a1a2f 100%);
    position: fixed;
    padding: 20px;
  }

  #header .profile img {
    width: 150px;
    height: 150px;
    margin: 15px auto;
  }

  .contact-form input,
  .contact-form textarea {
    width: 100% !important;
    margin-bottom: 15px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
  }

  .contact-form .form-group {
    margin-bottom: 20px;
    width: 100%;
  }

  .contact-form .row {
    margin: 0;
  }

  .contact-form {
    padding: 20px;
  }
}

/* Tablet Responsive Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  #header {
    width: 250px;
  }

  #main {
    margin-left: 250px;
  }

  .theme-toggle button {
    max-width: 180px;
  }

  #header .profile {
    padding: 20px;
  }

  #header .profile img {
    width: 110px;
  }
}

/* Ensure proper dark mode on mobile */
@media (max-width: 768px) {
  .dark-mode #header {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  }

  .dark-mode .mobile-nav-toggle {
    background: var(--primary-color);
    color: #fff;
  }

  .dark-mode .theme-toggle button {
    border-color: var(--text-color);
    background: transparent;
  }

  .dark-mode .nav-menu a {
    background: rgba(255, 255, 255, 0.05);
  }

  .dark-mode .nav-menu a:hover,
  .dark-mode .nav-menu .active {
    background: var(--primary-color);
  }
}

/* Improve touch targets and spacing */
@media (max-width: 768px) {
  .nav-menu a,
  .theme-toggle button,
  .social-links a,
  .modern-button {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu a i,
  .social-links a i {
    font-size: 18px;
  }

  /* Improve spacing between elements */
  .section-title {
    padding: 0 15px;
  }

  .container {
    padding: 0 15px;
  }

  /* Better form handling on mobile */
  .contact-form {
    padding: 20px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  /* Adjust grid layouts for mobile */
  .skills .row {
    grid-template-columns: repeat(3, 1fr); /* 3 items per row on mobile */
    gap: 12px;
  }

  .skill-item {
    padding: 10px;
  }

  .skill-item img {
    width: 24px;
    height: 24px;
  }

  .skill-item p {
    font-size: 12px;
  }
}

/* Improve header collapse behavior */
@media (max-width: 768px) {
  #header.collapsed {
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  #header.collapsed.show {
    transform: translateY(0);
  }

  .mobile-nav-active #header {
    transform: translateY(0);
  }
}

/* Ensure smooth transitions */
@media (max-width: 768px) {
  #header,
  #main,
  .nav-menu a,
  .theme-toggle button {
    transition: all 0.3s ease;
  }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
  #header {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    padding: 15px;
    z-index: 9999;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(4, 11, 20, 0.95);
  }

  #header .profile {
    padding: 15px;
    margin: 0;
    text-align: center;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #header .profile img {
    width: 80px;
    height: 80px;
    margin: 10px auto;
    object-fit: cover;
  }

  #header .profile h1 {
    font-size: 1.5rem;
    margin: 10px 0 5px;
  }

  #header .profile h2 {
    font-size: 0.9rem;
  }

  .nav-menu {
    padding: 10px 0;
    display: flex;
    justify-content: center;
  }

  .nav-menu ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0;
  }

  .nav-menu a {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    margin: 0;
  }

  #main {
    margin-left: 0;
    padding: 20px 15px 80px;
  }

  /* Enhanced Hero Section for Mobile */
  #hero {
    height: 100vh;
    padding: 0 20px;
  }

  #hero h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.2;
  }

  #hero p {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  /* Improved Skills Grid */
  .skills .row {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    padding: 15px;
  }

  .skill-item {
    padding: 12px;
    min-height: 80px;
  }

  .skill-item img {
    width: 28px;
    height: 28px;
  }

  .skill-item p {
    font-size: 12px;
    margin-top: 8px;
  }

  /* Better Form Elements */
  .contact-form input,
  .contact-form textarea {
    font-size: 16px;
    padding: 12px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  /* Improved Card Layout */
  .modern-card {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
  }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  #header {
    width: 250px;
  }

  #main {
    margin-left: 250px;
  }

  .skills .row {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .modern-card {
    padding: 20px;
  }
}

/* Large Screen Enhancements */
@media (min-width: 1025px) {
  .container {
    max-width: 1200px;
    padding: 0 30px;
  }

  .skills .row {
    grid-template-columns: repeat(6, 1fr); /* Exactly 6 items per row */
    gap: 20px;
  }

  .modern-card {
    padding: 30px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) {
  .skill-item:hover,
  .modern-card:hover,
  .nav-menu a:hover {
    transform: none !important;
  }

  .nav-menu a,
  .modern-button,
  .skill-item {
    transition: background-color 0.3s ease;
  }
}

/* High DPI Screen Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Improved Accessibility */
:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced Touch Targets */
button,
.nav-menu a,
.social-links a {
  min-height: 44px;
  min-width: 44px;
  padding: 12px;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Performance Optimizations */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Improved Typography */
body {
  font-size: clamp(14px, 1vw + 12px, 16px);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 1rem;
}

/* Better Spacing */
section {
  padding: var(--section-spacing) 0;
}

.section-title {
  margin-bottom: 1.5rem;  /* Reduced from 3rem */
}

/* Enhanced Animations */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .reveal.active {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print Styles */
@media print {
  #header,
  .back-to-top,
  .mobile-nav-toggle {
    display: none !important;
  }

  #main {
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    color: #000 !important;
    background: #fff !important;
  }
}

/* Remove any auto-fit styles */
@media (min-width: 1025px) {
  .skills .row {
    grid-template-columns: repeat(6, 1fr); /* Maintain 6 items per row on large screens */
    gap: 20px;
  }
}

/* Improved Mobile Header */
@media (max-width: 768px) {
  #header {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    padding: 15px;
    text-align: center;
    background: var(--bg-color);
    box-shadow: 0 -1px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: var(--z-fixed);
  }

  #header .profile {
    margin: 0;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  #header .profile img {
    width: 50px;
    height: 50px;
    margin: 0;
  }

  #header .profile h1 {
    font-size: 1.2rem;
    margin: 0;
  }

  #header .profile h2 {
    font-size: 0.9rem;
    margin: 0;
  }

  .nav-menu {
    padding: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-menu ul {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .nav-menu a {
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    font-size: 0.9rem;
  }

  #main {
    margin-left: 0;
    padding: 20px;
    margin-bottom: 80px;
  }

  /* Improved Skills Section */
  .skills .row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 10px;
  }

  .skill-item {
    padding: 12px;
    height: auto;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
  }

  .skill-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
  }

  .skill-item p {
    font-size: 0.8rem;
    margin: 8px 0 0;
    text-align: center;
  }

  /* Enhanced Button Styles */
  .modern-button {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Improved Hero Section */
  #hero {
    height: 100vh;
    padding: 20px;
    margin-bottom: 60px;
  }

  #hero h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    margin-bottom: 1rem;
  }

  #hero p {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  /* Better Form Elements */
  .contact-form input,
  .contact-form textarea {
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  /* Improved Cards */
  .modern-card {
    padding: 20px;
    border-radius: 12px;
    height: auto;
  }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  #header {
    width: 250px;
  }

  #main {
    margin-left: 250px;
  }

  .skills .row {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .modern-card {
    padding: 25px;
  }
}

/* Desktop Refinements */
@media (min-width: 1025px) {
  .container {
    max-width: 1140px;
    margin: 0 auto;
  }

  .skills .row {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
  }

  .modern-card {
    padding: 30px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
}

/* Touch Device Optimizations */
@media (hover: none) {
  .skill-item:hover,
  .modern-card:hover,
  .modern-button:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .nav-menu a,
  .nav-menu a:hover {
    transition: none !important;
  }
}

/* High DPI Screen Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Accessibility Improvements */
:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Better Touch Targets */
button,
.nav-menu a,
.social-links a,
.modern-button {
  min-height: 44px;
  min-width: 44px;
}

/* Performance Optimizations */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base Improvements */
body {
  overscroll-behavior-y: contain;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 1rem;
}

section {
  padding: var(--section-spacing) 0;
}

.section-title {
  margin-bottom: 1.5rem;  /* Reduced from 3rem */
}

/* Animation Optimizations */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.active {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print Styles */
@media print {
  #header,
  .mobile-nav-toggle,
  .theme-toggle {
    display: none;
  }

  #main {
    margin: 0;
    padding: 0;
  }

  body {
    color: #000;
    background: #fff;
  }
}

/* Languages Section Spacing */
.languages {
  padding: var(--section-spacing) 0;
  margin-bottom: var(--section-spacing);
}

.languages ul {
  list-style: none;
  padding: 0;
  margin: var(--spacing-lg) 0;
}

.languages ul li {
  padding: var(--spacing-sm) 0;
  margin-bottom: var(--spacing-xs);
  line-height: var(--line-height-normal);
}

.languages ul li:last-child {
  border-bottom: none;
}

/* Mobile Responsiveness for Header */
@media (max-width: 1199px) {
  #header {
    left: -300px;
  }
  
  .mobile-nav-active #header {
    left: 0;
  }
  
  #main {
    margin-left: 0;
  }
}

/* Languages Section - More Compact */
.languages {
  padding: var(--section-spacing) 0;
  margin-bottom: 1rem;  /* Reduced from 2rem */
}

.languages ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;  /* Reduced from var(--spacing-lg) */
}

.languages ul li {
  padding: 0.35rem 0;  /* Reduced from var(--spacing-sm) */
  margin-bottom: 0.25rem;  /* Reduced from var(--spacing-xs) */
  line-height: 1.4;  /* Reduced from var(--line-height-normal) */
  border-bottom: 1px solid var(--border-color);
}

.languages ul li:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

@media (max-width: 768px) {
  .languages {
    padding: 1rem 0;  /* Even more compact on mobile */
  }
  
  .languages ul {
    margin: 0.25rem 0;
  }
  
  .languages ul li {
    padding: 0.25rem 0;
    margin-bottom: 0.15rem;
  }
}

/* Interactive Skill Items */
.skill-item {
  width: 100%;
  aspect-ratio: 1;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.skill-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.skill-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.skill-item:hover img {
  transform: scale(1.2) rotate(5deg);
}

.skill-item p {
  margin: 0;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  transition: all 0.3s ease;
}

.skill-item:hover p {
  color: var(--primary-color);
  font-weight: 500;
}

/* Fix Side Panel Navigation Alignment */
.nav-menu {
  padding: 1rem 1rem 0 1rem;  /* Added horizontal padding */
}

.nav-menu ul {
  padding: 0;
  margin: 0;
  list-style: none;
  width: 100%;  /* Ensure the list takes full width */
}

.nav-menu a,
.nav-menu a:focus {
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* Align items to start for better icon placement */
  padding: 0.5rem 1rem;  /* Slightly increased horizontal padding */
  margin: 0 0 0.375rem 0;  /* Remove auto margins */
  width: 100%;  /* Take full width */
  max-width: none;  /* Remove max-width restriction */
  transition: all 0.3s ease;
  border-radius: 8px;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.nav-menu a i {
  margin-right: 12px;  /* Slightly increased for better spacing */
  font-size: 20px;
  min-width: 25px;
  text-align: center;
  color: var(--primary-color);
}

.nav-menu a:hover,
.nav-menu .active,
.nav-menu .active:focus,
.nav-menu li:hover > a {
  color: #fff;
  background: var(--primary-color);
  transform: translateX(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .nav-menu {
    padding: 0.75rem 0.75rem 0 0.75rem;  /* Slightly reduced padding for mobile */
  }
  
  .nav-menu a,
  .nav-menu a:focus {
    padding: 0.5rem 1rem;
    width: 100%;
  }
}

/* Dark mode adjustments */
.dark-mode .skill-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .nav-menu a:hover,
.dark-mode .nav-menu .active,
.dark-mode .nav-menu .active:focus,
.dark-mode .nav-menu li:hover > a {
  background: var(--primary-color);
  color: #fff;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .nav-menu a,
  .nav-menu a:focus {
    margin: 0 0.375rem 0.375rem 0.375rem;
    padding: 0.375rem 1rem;
  }
  
  .skill-item:hover {
    transform: translateY(-3px);
  }
}

/* Mobile Navigation and Layout */
@media (max-width: 768px) {
  /* Header/Sidebar */
  #header {
    position: fixed;
    width: 100%;
    height: 100vh;
    left: -100%;
    top: 0;
    bottom: auto;
    transition: 0.3s ease-in-out;
    background: linear-gradient(180deg, #040b14 0%, #0a1a2f 100%) !important;
    z-index: 9997;
    padding: 20px;
    overflow-y: auto;
  }

  .mobile-nav-active #header {
    left: 0;
  }

  /* Main Content Area */
  #main {
    margin-left: 0;
    padding: 30px 20px;  /* Increased padding */
  }

  /* Navigation Menu */
  .nav-menu {
    padding: 20px 0;
  }

  .nav-menu ul {
    padding: 0;
    margin: 0;
  }

  .nav-menu a {
    padding: 12px 20px;  /* Increased padding */
    margin-bottom: 10px;  /* More space between items */
    font-size: 16px;  /* Larger font */
  }

  /* Skills Grid */
  .skills .row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
    padding: 10px;
  }

  .skill-item {
    padding: 12px;
    border-radius: 8px;
  }

  .skill-item img {
    width: 32px;
    height: 32px;
  }

  .skill-item p {
    font-size: 0.85rem;
    margin-top: 8px;
  }

  /* Section Spacing */
  section {
    padding: 40px 0;  /* More vertical space */
    margin-bottom: 30px;  /* Space between sections */
  }

  .section-title {
    margin-bottom: 30px;
  }

  /* Cards and Content */
  .modern-card {
    padding: 25px;  /* More internal spacing */
    margin-bottom: 25px;
  }

  .about .content {
    padding: 25px;
  }

  /* Text Spacing */
  p {
    margin-bottom: 1.2rem;  /* More space between paragraphs */
    line-height: 1.6;
  }

  h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.4;
  }

  /* Mobile Navigation Toggle */
  .mobile-nav-toggle {
    display: block;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 9999;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Prevent body scroll when menu is open */
  .mobile-nav-active {
    overflow: hidden;
  }

  .mobile-nav-active body {
    overflow: hidden;
  }

  /* Overlay when menu is open */
  .mobile-nav-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9996;
  }

  /* Resume Section Spacing */
  .resume .resume-item {
    padding: 0 0 20px 20px;
    margin-bottom: 20px;
  }

  .resume .resume-item h4 {
    margin-bottom: 12px;
  }

  .resume .resume-item h5 {
    margin-bottom: 12px;
  }

  .resume .resume-item ul li {
    margin-bottom: 10px;
  }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1199px) {
  #header {
    width: 300px;
    left: -300px;
  }

  .mobile-nav-active #header {
    left: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  }

  #main {
    margin-left: 0;
  }
}






