/* Modern Portfolio Enhancements */
:root {
  --primary-color: #39b1ff; /* Brighter accent blue */
  --secondary-color: #ffffff;
  --accent-color: #39b1ff;
  --bg-light: #f4f7f6;
  --glass-bg: rgba(0, 0, 0, 0.45);
  --glass-border: rgba(255, 255, 255, 0.2);
}

/* Typography Refinement */
body {
  font-family: 'Poppins', sans-serif;
  color: #272829;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
}

/* Section Titles */
.section-title h2 {
  font-size: 32px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  position: relative;
  color: var(--secondary-color);
}

.section-title h2::after {
  content: "";
  position: absolute;
  display: block;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
  bottom: 0;
  left: 0;
}

/* Global Section Visibility */
.section-title h2 {
  font-size: 42px !important;
  margin-bottom: 20px !important;
  text-shadow: 0 4px 15px rgba(0,0,0,0.8) !important;
  color: #ffffff !important;
}

.section-title p {
  color: #ffffff !important; /* Pure white */
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  background: rgba(0, 0, 0, 0.4) !important; /* Subtle dark backing for text */
  padding: 15px 25px !important;
  border-radius: 12px !important;
  display: inline-block !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(5px) !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

/* Portfolio Filters Visibility */
.portfolio-filters li {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.1) !important;
  padding: 8px 20px !important;
  border-radius: 50px !important;
  margin: 5px !important;
  transition: all 0.3s ease !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.portfolio-filters li:hover, .portfolio-filters li.filter-active {
  color: #000000 !important;
  background: #39b1ff !important;
  border-color: #39b1ff !important;
}

/* High-Contrast Glass Items */
.glass-item {
  background: rgba(255, 255, 255, 0.07) !important; /* Frosted look */
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 24px !important;
  padding: 40px !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.glass-item h4 {
  color: var(--primary-color) !important;
  font-size: 24px !important;
  margin-bottom: 12px !important;
  text-transform: none !important;
}

.glass-item h5 {
  background: var(--primary-color) !important;
  color: #000000 !important;
  padding: 5px 15px !important;
  display: inline-block !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  margin-bottom: 15px !important;
}

.glass-item p, .glass-item li, .glass-item span {
  color: #ffffff !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  opacity: 1 !important;
}

.glass-item i {
  color: var(--primary-color) !important;
}

.glass-item:hover {
  transform: translateY(-8px) !important;
  border-color: var(--primary-color) !important;
}

/* Floating Services Styling */
.floating-service {
  padding: 20px;
  transition: all 0.3s ease;
}

.floating-service:hover {
  transform: translateX(10px);
}

.floating-service .icon i {
  font-size: 36px;
  color: var(--primary-color);
  text-shadow: 0 0 20px rgba(57, 177, 255, 0.4);
}

.floating-service .title a {
  color: #ffffff !important;
  font-size: 22px;
  font-weight: 700;
}

.floating-service .description {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 15px;
}

/* Resume Timeline Fix */
.resume-item {
  border-left: 2px solid var(--primary-color) !important;
  position: relative;
  padding-left: 25px;
  margin-bottom: 30px;
}

.resume-item::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: -10px;
  top: 0;
  background: #040b14;
  border: 2px solid #149ddd;
}

/* Performance Scroll Progress */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--primary-color);
  z-index: 10001;
  box-shadow: 0 0 15px rgba(57, 177, 255, 0.7);
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  visibility: hidden;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #000000;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 1199px) {
  .header {
    background: rgba(0, 0, 0, 0.95) !important;
  }
}

@media (max-width: 768px) {
  body {
    zoom: 100% !important; /* Disable zoom on small screens for better layout */
  }

  /* Optimize Storytelling Background for Mobile Performance */
  .storytelling-wrapper {
    background-attachment: scroll !important; /* Fixed background lag on mobile */
  }

  /* Adjust Glass Items for Small Screens */
  .glass-item {
    padding: 20px !important;
    margin-bottom: 20px !important;
    border-radius: 15px !important;
  }

  .glass-item h4 {
    font-size: 20px !important;
  }

  /* Fix Section Titles on Mobile */
  .section-title h2 {
    font-size: 32px !important;
  }

  .section-title p {
    font-size: 16px !important;
    padding: 15px !important;
  }

  /* Floating Services Mobile Layout */
  .floating-service {
    padding: 10px !important;
  }

  .floating-service:hover {
    transform: none !important; /* Disable hover movement on touch */
  }

  /* Stats Section Mobile */
  .stats .stats-item {
    padding: 20px 0 !important;
  }

  /* Navigation Toggle Position */
  .header .header-toggle {
    top: 10px !important;
    right: 10px !important;
    width: 35px !important;
    height: 35px !important;
    font-size: 18px !important;
  }
}

/* Touch Device Refinements */
@media (hover: none) {
  .glass-item:hover, .floating-service:hover {
    transform: none !important;
  }
}
