/* AI Agents Course - Responsive CSS */
/* Mobile-First Responsive Design with Breakpoints */

/* Breakpoint Variables (using custom media queries) */
:root {
  --breakpoint-xs: 480px;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* Base Mobile Styles (320px and up) */
@media screen and (max-width: 479px) {
  /* Typography adjustments for small screens */
  :root {
    --text-xs: 0.7rem;
    --text-sm: 0.8rem;
    --text-base: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.1rem;
    --text-2xl: 1.3rem;
    --text-3xl: 1.6rem;
    --text-4xl: 2rem;
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  /* Header adjustments */
  .nav-container {
    padding: var(--space-md);
  }

  .logo {
    font-size: var(--text-lg);
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Hero section */
  .hero-title {
    font-size: var(--text-4xl);
    line-height: 1.1;
  }

  .subtitle {
    font-size: var(--text-lg);
  }

  .hero-description {
    font-size: var(--text-base);
    margin: var(--space-xl) auto;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .hero-actions {
    flex-direction: column;
    gap: var(--space-md);
  }

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

  /* Sections */
  .section {
    padding: var(--space-3xl) 0;
  }

  .section-title {
    font-size: var(--text-3xl);
  }

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

  /* Cards */
  .overview-grid,
  .modules-grid,
  .career-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .module-card,
  .overview-card,
  .career-track {
    padding: var(--space-lg);
  }

  .module-header {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }

  .module-number {
    font-size: var(--text-base);
  }

  /* Portfolio grid */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  /* Learning path */
  .path-steps {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .path-connector {
    width: 2px;
    height: 30px;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
  }

  /* Search */
  .search-input {
    font-size: var(--text-base);
    padding: var(--space-md) var(--space-md) var(--space-md) 40px;
  }

  .search-icon {
    left: var(--space-md);
    font-size: var(--text-base);
  }

  .search-filters {
    gap: var(--space-xs);
  }

  .filter-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  /* Modal */
  .modal-overlay {
    padding: var(--space-md);
  }

  .modal-header,
  .modal-body {
    padding: var(--space-lg);
  }

  .modal-title {
    font-size: var(--text-xl);
  }

  /* Theme toggle */
  .theme-toggle {
    top: auto;
    bottom: 80px;
    right: var(--space-md);
    width: 45px;
    height: 45px;
  }

  /* Back to top */
  .back-to-top {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 45px;
    height: 45px;
  }
}

/* Small Mobile (480px and up) */
@media screen and (min-width: 480px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .btn {
    width: auto;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* Mobile Landscape / Small Tablet (640px and up) */
@media screen and (min-width: 640px) {
  .container {
    padding: 0 var(--space-lg);
  }

  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .modules-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-filters {
    justify-content: center;
  }

  .path-steps {
    flex-direction: row;
    gap: var(--space-xl);
  }

  .path-connector {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  }
}

/* Tablet (768px and up) */
@media screen and (min-width: 768px) {
  /* Show simplified navigation on tablet */
  .nav-links {
    display: flex;
    gap: var(--space-lg);
  }

  .mobile-menu-toggle {
    display: none;
  }

  /* Adjust dropdown for tablet */
  .nav-dropdown .dropdown-menu {
    min-width: 140px;
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  .subtitle {
    font-size: var(--text-xl);
  }

  .section {
    padding: var(--space-4xl) 0;
  }

  .section-title {
    font-size: var(--text-4xl);
  }

  .module-header {
    flex-direction: row;
    align-items: center;
  }

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

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
  }
}

/* Large Tablet / Small Laptop (1024px and up) */
@media screen and (min-width: 1024px) {
  .nav-container {
    padding: var(--space-lg) var(--space-xl);
  }

  .nav-links {
    gap: var(--space-xl);
  }

  .hero-content {
    padding: var(--space-4xl);
  }

  .hero-title {
    font-size: var(--text-6xl);
  }

  .hero-description {
    font-size: var(--text-xl);
  }

  .section {
    padding: var(--space-5xl) 0;
  }

  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modules-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }

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

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Modal adjustments */
  .modal-content {
    max-width: 800px;
  }
}

/* Desktop (1280px and up) */
@media screen and (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }

  .nav-container {
    max-width: 1200px;
  }

  .career-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .portfolio-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .modal-content {
    max-width: 900px;
  }
}

/* Large Desktop (1536px and up) */
@media screen and (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }

  .nav-container {
    max-width: 1400px;
  }

  .hero-title {
    font-size: 4.5rem;
  }

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

/* Landscape Orientation Adjustments */
@media screen and (orientation: landscape) and (max-height: 600px) {
  .hero-section {
    min-height: auto;
    padding: var(--space-3xl) 0;
  }

  .hero-content {
    padding: var(--space-2xl);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-stats {
    margin: var(--space-xl) 0;
  }

  .section {
    padding: var(--space-2xl) 0;
  }
}

/* High DPI / Retina Display Adjustments */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
  /* Optimize for high DPI displays */
  .logo,
  .section-title,
  .hero-title {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Sharper borders and shadows */
  .card,
  .btn,
  .module-card {
    border-width: 0.5px;
  }
}

/* Print Styles */
@media print {
  .main-header,
  .theme-toggle,
  .back-to-top,
  .mobile-nav,
  .hero-actions,
  .btn {
    display: none !important;
  }

  .hero-section {
    min-height: auto;
    page-break-after: always;
  }

  .section {
    page-break-inside: avoid;
    padding: var(--space-lg) 0;
  }

  .module-card,
  .overview-card,
  .career-track {
    page-break-inside: avoid;
    border: 1px solid #000;
    margin-bottom: var(--space-lg);
  }

  body {
    background: white !important;
    color: black !important;
  }

  .card,
  .overview-card,
  .module-card,
  .career-track {
    background: white !important;
    box-shadow: none !important;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-background .shape {
    animation: none;
  }

  .animate-float,
  .animate-pulse,
  .animate-glow {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto !important;
  }
}

/* Dark Mode Adjustments for Different Screen Sizes */
@media screen and (max-width: 768px) {
  .dark-theme .mobile-nav {
    background: rgba(31, 31, 31, 0.95);
    backdrop-filter: blur(20px);
  }

  .dark-theme .main-header {
    background: rgba(15, 15, 15, 0.9);
  }
}

/* Light Theme Mobile Adjustments */
@media screen and (max-width: 768px) {
  .light-theme .mobile-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
  }

  .light-theme .main-header {
    background: rgba(255, 255, 255, 0.9);
  }
}

/* Hover Effects Only on Non-Touch Devices */
@media (hover: hover) and (pointer: fine) {
  .card:hover,
  .module-card:hover,
  .overview-card:hover,
  .career-track:hover {
    transform: translateY(-5px);
  }

  .btn:hover::before {
    left: 100%;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px; /* iOS recommended minimum touch target */
  }

  .nav-link {
    padding: var(--space-md);
  }

  .mobile-nav-link {
    padding: var(--space-lg) var(--space-xl);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .filter-btn {
    min-height: 40px;
    padding: var(--space-sm) var(--space-lg);
  }

  /* Remove hover effects on touch devices */
  .card:hover,
  .module-card:hover,
  .overview-card:hover,
  .career-track:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
}

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

  .nav-container {
    max-width: 1600px;
  }

  .hero-content {
    max-width: 1000px;
  }
}

/* Specific Device Breakpoints */
/* iPhone SE */
@media screen and (max-width: 375px) {
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

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

/* iPad Portrait */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* iPad Landscape */
@media screen and (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .modules-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .career-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Container Query Support (Progressive Enhancement) */
@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size;
  }

  @container (max-width: 600px) {
    .module-card {
      padding: var(--space-lg);
    }
  }

  @container (min-width: 900px) {
    .module-card {
      padding: var(--space-2xl);
    }
  }
}
