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

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
  :root {
    --container-max-width: 1320px;
    --spacing-xs: 0.75rem;
    --spacing-sm: 1.25rem;
    --spacing-md: 2rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3.5rem;
    --spacing-2xl: 5rem;
  }
  
  .hero-title {
    font-size: clamp(4rem, 10vw, 8rem);
  }
  
  .section-title {
    font-size: 3.5rem;
  }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .hero-content {
    gap: var(--spacing-xl);
  }
  
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Medium Devices (992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }
  
  .about-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }
  
  .contact-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .skills-categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
  .nav-menu {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .logo-image {
    height: 36px;
    max-width: 110px;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--spacing-lg);
    align-items: center;
    justify-items: center;
  }

  .hero-text {
    padding-left: 0; /* Remove left padding for centered layout */
  }

  .hero-actions {
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
  }

  .hero-visual {
    order: -1;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
  }
  
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  .skills-categories {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .hero-subtitle {
    margin-bottom: var(--spacing-md); /* Reduced from --spacing-xl to prevent overlap with scroll animation */
  }

  .section-title {
    font-size: 2.5rem;
  }
}

/* Extra Small Devices (576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
  .container {
    padding: 0 var(--spacing-sm);
  }

  .hero-text {
    padding-left: 0; /* Remove left padding for centered layout */
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .projects-filter {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }
  
  .filter-btn {
    flex: 1;
    min-width: 80px;
  }
  
  .hero-card {
    max-width: 400px;
  }
  
  .code-content {
    padding: var(--spacing-sm);
    font-size: 0.8rem;
  }
}

/* Mobile Devices (up to 575px) */
@media (max-width: 575px) {
  :root {
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --nav-height: 60px;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  /* Navigation */
  .nav-container {
    padding: 0 var(--spacing-sm);
  }
  
  .nav-logo .logo-link {
    height: 32px;
  }

  .logo-image {
    height: 32px;
    max-width: 100px;
  }
  
  /* Hero Section */
  .hero {
    min-height: 100vh;
    padding: var(--nav-height) 0 0;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) 0;
  }

  .hero-text {
    padding-left: 0; /* Remove left padding for centered layout */
  }

  .hero-title {
    font-size: clamp(2rem, 12vw, 3rem);
    margin-bottom: var(--spacing-sm);
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
  }
  
  .hero-actions {
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md); /* Add horizontal padding to prevent edge-to-edge buttons */
  }

  .btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .hero-card {
    max-width: calc(100% - var(--spacing-lg)); /* Reduce width to add side margins */
    transform: none;
    margin: 0 auto; /* Center the card */
  }
  
  .hero-card:hover {
    transform: scale(1.02);
  }
  
  .code-header {
    padding: var(--spacing-sm);
  }
  
  .code-content {
    padding: var(--spacing-sm);
    font-size: 0.75rem;
    min-height: 150px;
  }
  
  .code-title {
    font-size: 0.8rem;
  }
  
  /* Sections */
  .section-header {
    margin-bottom: var(--spacing-lg);
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
  }
  
  .section-subtitle {
    font-size: 1rem;
  }
  
  /* About Section */
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .about-paragraph {
    font-size: 1rem;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .stat-item {
    padding: var(--spacing-sm);
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .about-image {
    width: 250px;
    height: 300px;
  }
  
  /* Projects Section */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .projects-filter {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
  }
  
  .filter-btn {
    flex: 1;
    min-width: 70px;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
  }
  
  .project-image {
    height: 180px;
  }
  
  .project-content {
    padding: var(--spacing-md);
  }
  
  .project-title {
    font-size: 1.1rem;
  }
  
  .project-description {
    font-size: 0.9rem;
  }
  
  .tech-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  
  /* Skills Section */
  .skills-categories {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .skill-category {
    padding: var(--spacing-md);
  }
  
  .category-title {
    font-size: 1.2rem;
  }
  
  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .contact-item {
    margin-bottom: var(--spacing-md);
  }
  
  .contact-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .contact-form {
    padding: var(--spacing-md);
  }
  
  .form-group {
    margin-bottom: var(--spacing-md);
  }
  
  .form-group input,
  .form-group textarea {
    padding: var(--spacing-sm);
    font-size: 0.9rem;
  }
  
  .form-group textarea {
    min-height: 100px;
  }
  
  /* Components */
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: var(--spacing-xs);
  }
  
  .modal-header,
  .modal-body {
    padding: var(--spacing-md);
  }
  
  .card {
    padding: var(--spacing-md);
  }
  
  /* Cursor */
  .cursor {
    display: none;
  }
  
  body {
    cursor: auto;
  }
  
  /* Animations */
  .hero-word {
    animation-duration: 0.8s;
  }
  
  .fadeInUp {
    animation-duration: 0.8s;
  }
  
  /* Utilities */
  .text-center-mobile {
    text-align: center;
  }
  
  .hidden-mobile {
    display: none;
  }
  
  .full-width-mobile {
    width: 100%;
  }
}

/* Landscape Mobile Devices */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    padding: var(--spacing-sm) 0;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }
  
  .glass-card {
    backdrop-filter: blur(15px);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .cursor {
    display: none;
  }
  
  .hero-particles,
  .floating-shapes {
    display: none;
  }
}

/* Dark Mode Specific Responsive Adjustments */
@media (max-width: 768px) {
  [data-theme="dark"] .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
  }
  
  [data-theme="light"] .glass-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
  }
}
