/* ===================================
   RESPONSIVE STYLES
   Media Queries for All Breakpoints
   =================================== */

/* ========== MOBILE NAVIGATION ========== */
@media (max-width: 768px) {
  /* Header Adjustments */
  .header {
    height: var(--header-height-mobile);
  }

  .mobile-toggle {
    display: flex;
  }

  /* Mobile Navigation Menu */
  .nav {
    position: fixed;
    top: var(--header-height-mobile);
    right: -100%;
    width: 280px;
    height: calc(100vh - var(--header-height-mobile));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-base);
    z-index: var(--z-fixed);
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .nav.active {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
  }

  .nav__item {
    width: 100%;
  }

  .nav__link {
    display: block;
    width: 100%;
    padding: var(--spacing-sm);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-md);
  }

  .nav__link::after {
    display: none;
  }

  .nav__link.active,
  .nav__link:hover {
    background: var(--gradient-primary);
    color: var(--color-text-white);
  }

  /* Hero Section Mobile */
  .hero {
    padding-top: var(--header-height-mobile);
  }
}

/* ========== TABLET BREAKPOINT (768px - 1023px) ========== */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Container */
  .container {
    max-width: 720px;
  }

  /* Typography Scaling */
  .section-title {
    font-size: var(--font-size-2xl);
  }

  .section-subtitle {
    font-size: var(--font-size-md);
  }

  /* Projects Grid - 2 Columns */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* About Stats - 3 Columns */
  .about__stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========== DESKTOP BREAKPOINT (1024px+) ========== */
@media (min-width: 1024px) {
  /* Container */
  .container {
    max-width: 960px;
  }

  /* Projects Grid - 3 Columns */
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========== WIDE SCREEN (1440px+) ========== */
@media (min-width: 1440px) {
  /* Container */
  .container {
    max-width: var(--container-max-width);
  }

  /* Section Padding Increase */
  .hero,
  .about,
  .projects,
  .contact {
    padding-top: calc(var(--section-padding) + 2rem);
    padding-bottom: calc(var(--section-padding) + 2rem);
  }
}

/* ========== MOBILE SPECIFIC (max-width: 480px) ========== */
@media (max-width: 480px) {
  /* Typography */
  .section-title {
    font-size: var(--font-size-xl);
  }

  .section-subtitle {
    font-size: var(--font-size-base);
  }

  /* Spacing Reduction */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Hero */
  .hero__content {
    padding: var(--spacing-sm);
  }

  .hero__greeting {
    font-size: var(--font-size-md);
  }

  .hero__name {
    font-size: var(--font-size-2xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-base);
  }

  .hero__cta .btn {
    min-width: 100%;
    padding: 1rem 1.5rem;
    font-size: var(--font-size-base);
  }

  /* Skills - Single Column */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Stats - Single Column */
  .about__stats {
    grid-template-columns: 1fr;
  }

  /* Projects - Single Column */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  /* Filter Buttons */
  .project-filters {
    gap: var(--spacing-xs);
  }

  .filter-btn {
    padding: 0.5rem 0.875rem;
    font-size: var(--font-size-xs);
  }

  /* Contact Form */
  .contact-form {
    padding: var(--spacing-sm);
  }

  .form-input {
    font-size: var(--font-size-sm);
  }

  /* Social Links */
  .social-links {
    gap: var(--spacing-xs);
  }

  .social-link {
    width: 45px;
    height: 45px;
  }

  /* Back to Top */
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-height: 600px) and (orientation: landscape) {
  /* Hero Height Adjustment */
  .hero {
    min-height: auto;
    padding: calc(var(--header-height-mobile) + 2rem) 0 2rem;
  }

  .scroll-indicator {
    display: none;
  }

  /* Floating Shapes - Reduce Size */
  .floating-shape {
    display: none;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  /* Hide Non-Essential Elements */
  .header,
  .mobile-toggle,
  .scroll-progress,
  .back-to-top,
  .scroll-indicator,
  .floating-shape,
  .nav,
  .hero__cta,
  .project-filters,
  .contact-form,
  .footer {
    display: none !important;
  }

  /* Remove Animations */
  * {
    animation: none !important;
    transition: none !important;
  }

  /* Adjust Colors for Print */
  body {
    background: white;
    color: black;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .hero__background {
    display: none;
  }

  .hero__name,
  .hero__subtitle,
  .section-title {
    color: black;
  }

  /* Page Breaks */
  .about,
  .projects,
  .contact {
    page-break-before: always;
  }

  .project-card {
    page-break-inside: avoid;
  }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
  /* Increase Touch Targets */
  .btn,
  .nav__link,
  .filter-btn,
  .social-link {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove Hover Effects on Touch Devices */
  .project-card__overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(102, 126, 234, 0.95) 0%,
      rgba(118, 75, 162, 0.8) 50%,
      transparent 100%
    );
    justify-content: flex-end;
  }

  .project-card__title,
  .project-card__description,
  .project-card__tags,
  .project-card__links {
    transform: translateY(0);
  }

  /* Disable Parallax on Touch Devices */
  .floating-shape {
    animation-play-state: paused;
  }
}

/* ========== HIGH DPI DISPLAYS ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper Borders */
  .header,
  .glass-card,
  .form-input {
    border-width: 0.5px;
  }
}

/* ========== 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;
  }

  .floating-shape,
  .scroll-indicator {
    display: none;
  }
}

/* ========== DARK MODE PREFERENCE ========== */
@media (prefers-color-scheme: dark) {
  .header {
    background: rgba(26, 26, 46, 0.9);
  }

  .nav {
    background: rgba(26, 26, 46, 0.98);
  }

  .about {
    background: var(--color-bg-dark);
  }

  .projects {
    background: var(--color-bg-secondary);
  }
}