/* ==========================================================================
   Responsive Stylesheet - Md Imtiaz Portfolio (320px - 1920px Support)
   ========================================================================== */

/* Large Displays (>= 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* Medium Displays & Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.25rem;
  }

  .site-header {
    width: 95%;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-bio {
    max-width: 100%;
  }

  .hero-avatar-card {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .path-card {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Smartphone & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  /* Floating Pill Navbar on Mobile */
  .site-header {
    top: 0.85rem;
    width: 94%;
    padding: 0.55rem 1rem;
    border-radius: 999px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    background: #070913;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2.5rem 1.5rem;
    gap: 1.4rem;
    transition: right var(--transition-normal);
    box-shadow: -15px 0 35px rgba(0, 0, 0, 0.85);
    z-index: 999;
    border-left: 1px solid var(--border-glass);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-link {
    font-size: 1.05rem;
    font-weight: 600;
    width: 100%;
    padding: 0.4rem 0;
  }

  .nav-icon {
    display: inline-block;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    z-index: 1000;
  }

  body.menu-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 998;
  }

  /* Hero Section Mobile Tuning */
  .hero-section {
    padding: 6.5rem 0 3rem 0;
  }

  .hero-name {
    font-size: clamp(2.1rem, 7.5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }

  .hero-title-typing {
    font-size: 1.05rem;
    min-height: 2.5rem;
    justify-content: center;
    text-align: center;
  }

  .hero-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    min-height: 48px;
  }

  .hero-social-row {
    justify-content: center;
    gap: 0.6rem;
  }

  .hero-social-row a {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .hero-avatar-card {
    max-width: 320px;
    padding: 1rem;
    border-radius: 20px;
    margin-top: 1rem;
  }

  /* Statistics Counters on Mobile */
  .stats-section {
    padding: 2.5rem 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-card {
    padding: 1.35rem 1rem;
    border-radius: 18px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* Filter Tabs Touch Scroll on Smartphone */
  .skills-filter, .project-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
  }

  .skill-cat-btn, .project-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  /* Dual Focus Path Cards */
  .path-section {
    padding: 3.5rem 0;
  }

  .path-tabs {
    flex-direction: column;
    width: 100%;
    gap: 0.4rem;
  }

  .path-tab-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
  }

  .path-card {
    padding: 1.25rem;
    border-radius: 20px;
    gap: 1.5rem;
  }

  .glass-widget-card {
    max-width: 100%;
    padding: 1.5rem 1.25rem;
    border-radius: 24px;
  }

  .widget-title {
    font-size: 1.25rem;
  }

  .widget-subtitle {
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
  }

  .widget-chip {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
  }

  /* Skills & Projects Grid */
  .skills-grid, .projects-grid, .cert-grid, .socials-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .project-banner {
    height: 180px;
  }

  .project-body {
    padding: 1.25rem;
  }

  .project-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .proj-action-btn {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
  }

  .case-study-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .case-study-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .case-study-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Lightbox Modal on Mobile */
  .lightbox-modal {
    padding: 0.75rem;
  }

  .lightbox-close {
    top: 8px;
    right: 12px;
    font-size: 1.6rem;
    color: var(--accent-cyan);
  }

  .lightbox-nav {
    top: auto;
    bottom: 10px;
    transform: none;
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .lightbox-nav.prev { left: 25%; }
  .lightbox-nav.next { right: 25%; }

  /* Timeline Mobile Adjustments */
  .timeline::before {
    left: 15px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 40px;
    padding-right: 0;
    text-align: left !important;
    margin-bottom: 1.75rem;
  }

  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-dot {
    left: 6px !important;
    right: auto !important;
    top: 4px;
  }

  /* Contact Inputs (Prevent iOS Safari Auto-Zoom) */
  .contact-info-card, .contact-form-card {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .form-input, .form-textarea {
    font-size: 16px !important; /* CRITICAL for mobile input focus */
    padding: 0.8rem 1rem;
    border-radius: 10px;
  }

  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
}

/* Extra Small Phones (<= 375px) */
@media (max-width: 375px) {
  .hero-name {
    font-size: 1.95rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.1rem;
  }
}
