/* ...existing code... */

/* Viewport and section improvements */
.view-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateZ(0);
  will-change: opacity, visibility;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.view-section.active {
  opacity: 1;
  visibility: visible;
}

/* Loading improvements */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Prevent body scroll during transitions */
body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  touch-action: manipulation; /* Improve touch performance */
}

/* Contact section specific styles */
#contact {
  justify-content: space-between;
  background-color: #f3f4f6; /* Match Contact.html background */
}

.contact-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  min-height: calc(100dvh - 200px);
  padding: 4rem 0; /* Add vertical padding */
}

/* Footer section */
.footer-section {
  margin-top: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.footer-section.active {
  opacity: 1;
}

/* Progress Bar Styles */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(156, 163, 175, 0.3); /* Gray background */
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1f2937 0%, #374151 50%, #1f2937 100%); /* Black to gray gradient */
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Progress indicators */
.progress-indicators {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.progress-indicators:hover {
  opacity: 1;
}

.progress-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(156, 163, 175, 0.5);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  border: 2px solid transparent;
}

.progress-indicator.active {
  background-color: #1f2937;
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.2);
}

.progress-indicator.completed {
  background-color: #374151;
  transform: scale(1.1);
}

.progress-indicator:hover {
  transform: scale(1.2);
  background-color: #4b5563;
}

.progress-indicator::after {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.progress-indicator:hover::after {
  opacity: 1;
}

/* Navigation Background - Base styles (desktop has no background by default) */
.nav-container {
  z-index: 1100;
}

/* Mobile Navigation Background */
.mobile-nav-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1100;
}

/* Mobile Brand Background */
.mobile-brand-container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 1100;
}

/* UGNN Emboss Effect */
.nav-brand,
.mobile-nav-brand {
  background: linear-gradient(135deg, #29292a 0%, #000000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 700;
  letter-spacing: -0.025em;
  position: relative;
}

.nav-brand::before,
.mobile-nav-brand::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 -1px 0 rgba(0, 0, 0, 0.2),
    1px 0 0 rgba(0, 0, 0, 0.1),
    -1px 0 0 rgba(255, 255, 255, 0.5);
  filter: brightness(1.1);
  z-index: -1;
}

/* Contact grid layout */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.github-full-width {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.github-full-width .contact-link {
  max-width: 50%;
}

/* Mobile optimizations (up to 768px) */
@media (max-width: 768px) {
  .view-section {
    padding-top: 70px; /* Space for mobile brand with background */
    padding-bottom: 110px; /* Space for mobile nav with background */
  }
  
  .contact-content {
    min-height: calc(100vh - 260px);
    min-height: calc(100dvh - 260px);
    padding: 2rem 1rem;
  }
  
  /* Mobile brand gets background */
  .lg\:hidden.fixed.top-3 {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 20px !important;
    padding: 8px 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    z-index: 1100 !important;
  }
  
  /* Mobile navigation gets enhanced background */
  .lg\:hidden.fixed.bottom-4 {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    z-index: 1100 !important;
  }
  
  /* Hide progress indicators on mobile */
  .progress-indicators {
    display: none !important;
  }
  
  .progress-indicator {
    display: none !important;
  }
  
  .progress-container {
    height: 3px;
  }
  
  /* Mobile contact grid - stack vertically */
  .contact-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .github-full-width {
    grid-column: unset !important;
    display: block !important;
    margin-top: 0 !important;
  }
  
  .github-full-width .contact-link {
    max-width: none !important;
  }
}

@media (max-width: 480px) {
  .view-section {
    padding-top: 65px;
    padding-bottom: 95px;
  }
  
  .contact-content {
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
    padding: 1.5rem 1rem;
  }
  
  /* Hide progress indicators on small mobile */
  .progress-indicators {
    display: none !important;
  }
  
  .progress-indicator {
    display: none !important;
  }
  
  .progress-container {
    height: 2px;
  }
}

/* Landscape phone optimizations */
@media (max-width: 896px) and (orientation: landscape) and (max-height: 500px) {
  .view-section {
    padding-top: 55px;
    padding-bottom: 70px;
  }
  
  .contact-content {
    min-height: calc(100vh - 170px);
    min-height: calc(100dvh - 170px);
    padding: 1rem;
  }
  
  /* Hide progress indicators on landscape mobile */
  .progress-indicators {
    display: none !important;
  }
  
  .progress-indicator {
    display: none !important;
  }
}

/* Tablet optimizations (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .view-section {
    padding-top: 90px; /* Space for tablet navbar with background */
    padding-bottom: 20px;
  }
  
  .contact-content {
    min-height: calc(100vh - 180px);
    padding: 3rem 2rem;
  }
  
  /* Show navbar on tablet with background */
  .nav-container {
    display: flex !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    z-index: 1100 !important;
  }
  
  /* Hide mobile navigation on tablet */
  .lg\:hidden {
    display: none !important;
  }
  
  /* Show progress indicators on tablet */
  .progress-indicators {
    display: flex !important;
    right: 15px;
    gap: 10px;
  }
  
  .progress-indicator {
    display: block !important;
    width: 11px;
    height: 11px;
  }
}

/* Desktop - show progress indicators, no navbar background */
@media (min-width: 1025px) {
  .view-section {
    padding-top: 90px; /* Space for desktop navbar */
    padding-bottom: 20px;
  }
  
  /* Desktop navbar - no background by default */
  .nav-container {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
  }
  
  .progress-indicators {
    display: flex !important;
  }
  
  .progress-indicator {
    display: block !important;
  }
}

/* Large tablet and small desktop */
@media (min-width: 1025px) and (max-width: 1280px) {
  .progress-indicators {
    right: 18px;
    gap: 11px;
  }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
  .progress-indicators {
    right: 40px;
    gap: 16px;
  }
  
  .progress-indicator {
    width: 14px;
    height: 14px;
  }
  
  .progress-indicator::after {
    right: 25px;
    font-size: 14px;
    padding: 6px 10px;
  }
}

/* Hide progress indicators during loading */
.progress-indicators.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Touch feedback */
.mobile-nav-link:active,
.nav-link:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Prevent text selection during navigation */
.nav-link,
.mobile-nav-link {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Loading state improvements */
.view-section:not(.active) .loading {
  display: flex;
}

.view-section.active .loading {
  display: none;
}

/* Contact link hover effects */
.contact-links-container a:hover {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}

.contact-links-container a:hover .w-6 {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* Improved scrollbar styling */
.view-section::-webkit-scrollbar {
  width: 6px;
}

.view-section::-webkit-scrollbar-track {
  background: transparent;
}

.view-section::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.view-section::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Prevent momentum scrolling issues on iOS */
@media (max-width: 768px) {
  .view-section {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
  .progress-indicator {
    padding: 4px;
    margin: -4px;
  }
}

/* Modal improvements for mobile */
.fixed.inset-0.bg-black.bg-opacity-50 {
  z-index: 9999 !important; /* Ensure modal backdrop is on top */
}

.fixed.inset-0.flex.items-center.justify-center > div {
  z-index: 10000 !important; /* Ensure modal content is on top */
  max-height: 90vh !important;
  overflow-y: auto !important;
}

/* Mobile modal fixes */
@media (max-width: 768px) {
  /* Ensure modal appears above everything on mobile */
  .fixed.inset-0.bg-black.bg-opacity-50 {
    z-index: 9999 !important;
    position: fixed !important;
  }
  
  /* Modal content adjustments for mobile */
  .fixed.inset-0.flex.items-center.justify-center > div {
    z-index: 10000 !important;
    margin: 1rem !important;
    max-width: calc(100vw - 2rem) !important;
    max-height: calc(100vh - 2rem) !important;
    overflow-y: auto !important;
  }
  
  /* Hide navigation and progress when modal is open */
  body.modal-open .lg\:hidden {
    z-index: 40 !important;
  }
  
  body.modal-open .progress-container {
    z-index: 40 !important;
  }
  
  body.modal-open .progress-indicators {
    z-index: 40 !important;
  }
  
  /* Prevent background scroll on mobile when modal is open */
  body.modal-open {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  
  /* Adjust view section when modal is open */
  body.modal-open .view-section {
    overflow: hidden !important;
  }
}

/* Enhanced touch targets for mobile contact button */
@media (max-width: 768px) {
  button[id="contactInfoBtn"] {
    min-height: 48px !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    touch-action: manipulation !important;
  }
}

