/* Responsive Design Utilities */
/* =========================== */

/* Container Queries Support */
@supports (container-type: inline-size) {
  .container {
    container-type: inline-size;
  }
}

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-teal);
  color: var(--primary-navy);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}

/* Focus Indicators */
*:focus {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .header,
  .social,
  .email,
  .btn {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .section-heading,
  .hero-title {
    color: black !important;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  .project-description,
  .about-text {
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --primary-navy: #000000;
    --accent-teal: #00ffff;
    --lightest-slate: #ffffff;
    --slate: #cccccc;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-title,
  .hero-subtitle {
    animation: none !important;
  }
}

/* Dark Mode Support (if implementing theme toggle) */
@media (prefers-color-scheme: light) {
  .theme-auto {
    --primary-navy: #ffffff;
    --secondary-navy: #f8f9fa;
    --accent-teal: #0066cc;
    --lightest-slate: #333333;
    --light-slate: #666666;
    --slate: #999999;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
  }
}

/* Mobile-specific Styles */
@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.8rem;
  }
  
  .section-heading {
    font-size: 1.5rem;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  .project-description {
    font-size: 16px;
  }
}

/* Tablet-specific Styles */
@media (min-width: 481px) and (max-width: 768px) {
  .hero {
    padding: 0 40px;
  }
  
  .about,
  .experience,
  .projects,
  .other-projects,
  .contact {
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* Large Desktop Styles */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
  
  .hero-title,
  .hero-subtitle {
    font-size: 5rem;
  }
  
  .hero-description {
    font-size: 22px;
  }
}

/* Ultra-wide Screen Styles */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }
}

/* Mobile Menu Styles */
.menu-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 15px;
  z-index: 1001;
  position: relative;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
}

.menu-button span {
  width: 2rem;
  height: 0.25rem;
  background: var(--accent-teal);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

.menu-button.open span:first-child {
  transform: rotate(45deg);
}

.menu-button.open span:nth-child(2) {
  opacity: 0;
}

.menu-button.open span:nth-child(3) {
  transform: rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-button {
    display: flex;
  }
  
  .nav-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    width: 75vw;
    height: 100vh;
    background: var(--bg-secondary);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 100px 50px 50px;
    z-index: 1000;
    border-left: 1px solid var(--darkest-slate);
    box-shadow: var(--shadow-heavy);
  }
  
  .nav-wrapper.open {
    transform: translateX(0);
  }
  
  .nav {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  
  .nav-item {
    margin: 0;
    font-size: 18px;
  }
  
  .nav-link {
    padding: 10px 0;
  }
  
  .resume-link {
    margin-top: 2rem;
  }
}

/* Loading States */
.loading {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Effects for Touch Devices */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .project-card:hover,
  .other-project:hover {
    transform: none;
  }
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.slide-up {
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.6s ease forwards;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
  animation: slideInRight 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Focus Management */
.focus-trap {
  position: relative;
}

.focus-trap::before,
.focus-trap::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Error States */
.error {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.success {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid var(--accent-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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