/* ===== MODERN RESPONSIVE DESIGN SYSTEM ===== */

/* Large Desktop (1440px+) */
@media screen and (min-width: 1440px) {
  .section__pic-container {
    width: 350px;
    height: 350px;
  }
  
  .title {
    font-size: var(--font-size-5xl);
  }
  
  section {
    padding: var(--space-20) 10%;
  }
}

/* Desktop (1024px - 1439px) */
@media screen and (max-width: 1439px) {
  section {
    padding: var(--space-16) var(--space-8);
  }
  
  .section__pic-container {
    width: 300px;
    height: 300px;
  }
}

/* Tablet (768px - 1023px) */
@media screen and (max-width: 1023px) {
  /* Navigation */
  #desktop-nav {
    padding: var(--space-3) var(--space-6);
  }
  
  .logo img {
    width: 80px;
  }
  
  .nav-links {
    gap: var(--space-6);
  }
  
  /* Sections */
  section {
    padding: var(--space-12) var(--space-6);
  }
  
  /* Profile Section */
  #profile {
    flex-direction: column;
    gap: var(--space-12);
    text-align: center;
  }
  
  .section__pic-container {
    width: 280px;
    height: 280px;
  }
  
  .title {
    font-size: var(--font-size-4xl);
  }
  
  .section__text__p2 {
    font-size: var(--font-size-lg);
  }
  
  /* About Section - Keep side by side */
  .about-containers {
    gap: var(--space-6);
  }
  
  .details-container {
    padding: var(--space-6);
  }
  
  /* Experience Section */
  .article-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
  }
  
  article {
    padding: var(--space-4);
  }
  
  /* Contact Section */
  .contact-info-upper-container {
    gap: var(--space-6);
  }
  
  .contact-info-container {
    padding: var(--space-4);
  }
}

/* Mobile Large (481px - 767px) */
@media screen and (max-width: 767px) {
  /* Navigation */
  #desktop-nav {
    display: none;
  }
  
  #hamburger-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
  }
  
  .logo img {
    width: 70px;
  }
  
  /* Sections */
  section {
    padding: var(--space-10) var(--space-4);
    min-height: auto;
  }
  
  /* Fix section-container for mobile */
  .section-container {
    flex-direction: column !important;
    gap: var(--space-6) !important;
    text-align: center !important;
  }
  
  /* Profile Section */
  #profile {
    flex-direction: column;
    gap: var(--space-8);
    text-align: center;
  }
  
  .section__pic-container {
    width: 250px;
    height: 250px;
  }
  
  .title {
    font-size: var(--font-size-3xl);
  }
  
  .section__text__p1 {
    font-size: var(--font-size-base);
  }
  
  .section__text__p2 {
    font-size: var(--font-size-lg);
  }
  
  /* Buttons */
  .btn-container {
    flex-direction: column;
    gap: var(--space-3);
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    padding: var(--space-3) var(--space-4);
  }
  
  /* About Section - Keep side by side but smaller */
  .about-containers {
    gap: var(--space-4);
  }
  
  .details-container {
    padding: var(--space-4);
    font-size: var(--font-size-sm);
  }
  
  .details-container h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
  }
  
  /* Experience Section */
  .article-container {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  article {
    padding: var(--space-4);
  }
  
  article h3 {
    font-size: var(--font-size-base);
  }
  
  article p {
    font-size: var(--font-size-xs);
  }
  
  /* Projects Section */
  .color-container {
    padding: var(--space-6);
  }
  
  .project-img {
    height: 220px;
  }
  
  /* Optimize projects for tablet */
  #projects .about-containers {
    gap: var(--space-6);
  }
  
  #projects .details-container {
    max-width: 300px;
    margin: 0 auto;
  }
  
  .project-title {
    font-size: var(--font-size-lg);
  }
  
  .project-btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
  }
  
  /* Fix projects layout for mobile */
  #projects .about-containers {
    flex-direction: column !important;
    gap: var(--space-6) !important;
    align-items: center !important;
  }
  
  #projects .details-container {
    width: 100% !important;
    max-width: 350px !important;
    margin: 0 auto !important;
  }
  
  .project-title {
    font-size: var(--font-size-lg) !important;
    margin: var(--space-3) 0 !important;
  }
  
  .project-btn {
    width: 100% !important;
    max-width: 140px !important;
    margin: var(--space-1) !important;
    padding: var(--space-2) var(--space-3) !important;
    font-size: var(--font-size-sm) !important;
  }
  
  /* Contact Section */
  .contact-info-upper-container {
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
  }
  
  .contact-info-container {
    padding: var(--space-3);
    width: 100%;
    max-width: 300px;
  }
  
  /* Social Icons */
  #socials-container {
    justify-content: center;
  }
}

/* Mobile Small (320px - 480px) */
@media screen and (max-width: 480px) {
  /* Navigation */
  #hamburger-nav {
    padding: var(--space-2) var(--space-3);
  }
  
  .logo img {
    width: 60px;
  }
  
  /* Sections */
  section {
    padding: var(--space-8) var(--space-3);
  }
  
  /* Fix section-container for small mobile */
  .section-container {
    flex-direction: column !important;
    gap: var(--space-4) !important;
    text-align: center !important;
  }
  
  /* Profile Section */
  .section__pic-container {
    width: 220px;
    height: 220px;
  }
  
  .title {
    font-size: var(--font-size-2xl);
  }
  
  .section__text__p2 {
    font-size: var(--font-size-base);
  }
  
  /* About Section - Stack on very small screens */
  .about-containers {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .details-container {
    padding: var(--space-3);
  }
  
  .details-container h3 {
    font-size: var(--font-size-base);
  }
  
  /* Buttons */
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }
  
  /* Projects */
  .project-img {
    height: 180px;
  }
  
  /* Enhanced projects layout for small mobile */
  #projects .about-containers {
    flex-direction: column !important;
    gap: var(--space-4) !important;
    align-items: center !important;
  }
  
  #projects .details-container {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    padding: var(--space-4) !important;
  }
  
  .project-title {
    font-size: var(--font-size-base) !important;
    margin: var(--space-2) 0 !important;
  }
  
  .project-btn {
    width: 100% !important;
    max-width: 120px !important;
    margin: var(--space-1) !important;
    padding: var(--space-2) !important;
    font-size: var(--font-size-xs) !important;
  }
  
  #projects .btn-container {
    flex-direction: row !important;
    justify-content: center !important;
    gap: var(--space-2) !important;
  }
  
  /* Contact */
  .contact-info-container {
    padding: var(--space-2);
    font-size: var(--font-size-sm);
  }
  
  .contact-icon {
    width: 24px;
    height: 24px;
  }
  
  /* Footer fixes */
  footer .nav-links {
    flex-direction: column !important;
    gap: var(--space-2) !important;
  }
}

/* Extra Small Mobile (max 320px) */
@media screen and (max-width: 320px) {
  .section__pic-container {
    width: 200px;
    height: 200px;
  }
  
  .title {
    font-size: var(--font-size-xl);
  }
  
  .carousel-controls span {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-base);
  }
}

/* Landscape Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  section {
    min-height: auto;
    padding: var(--space-6) var(--space-4);
  }
  
  #profile {
    flex-direction: row;
    gap: var(--space-8);
  }
  
  .section__pic-container {
    width: 200px;
    height: 200px;
  }
  
  .title {
    font-size: var(--font-size-2xl);
  }
}

/* High DPI Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
  .logo img,
  .carousel-inner img,
  .project-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  .carousel-controls,
  #hamburger-nav,
  #desktop-nav,
  .btn-container,
  #socials-container {
    display: none !important;
  }
  
  .section__pic-container {
    border: 2px solid black;
  }
  
  section {
    page-break-inside: avoid;
  }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus,
  .nav-links a:focus,
  .carousel-controls span:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
  }
}

/* Dark Mode Specific Adjustments */
@media (prefers-color-scheme: dark) {
  .carousel-controls span {
    background: rgba(31, 41, 55, 0.9);
    color: var(--text-primary);
  }
  
  .nav-links a:hover {
    background-color: var(--primary-800);
  }
  
  .menu-links a:hover {
    background-color: var(--primary-800);
  }
}