/* Responsive Styles */

/* Tablet (768px to 1024px) */
@media screen and (max-width: 1024px) {
  .header-container {
    padding: var(--space-1) var(--space-2);
  }
  
  .logo h1 {
    font-size: 1.25rem;
  }
  
  .search-container {
    max-width: 300px;
    margin: 0 var(--space-1);
  }
  
  .hero-content h2 {
    font-size: 2rem;
  }
  
  .hero-content p {
    font-size: 1.125rem;
  }
  
  .subjects-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .sidebar {
    width: 250px;
  }
}

/* Mobile (less than 768px) */
@media screen and (max-width: 767px) {
  .header-container {
    flex-wrap: wrap;
  }
  
  .logo {
    order: 1;
  }
  
  .header-actions {
    order: 2;
  }
  
  .search-container {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: var(--space-1) 0 0;
  }
  
  .hero-section {
    padding: var(--space-3) var(--space-2);
  }
  
  .hero-content h2 {
    font-size: 1.75rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .subjects-grid {
    grid-template-columns: 1fr;
  }
  
  /* Subject view on mobile */
  .subject-container {
    flex-direction: column;
    height: auto;
  }
  
  .sidebar {
    width: 100%;
    position: fixed;
    top: 64px; /* Match header height */
    left: 0;
    height: calc(100vh - 64px);
    z-index: 90;
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .mobile-close-sidebar,
  .mobile-toggle-sidebar {
    display: block;
  }
  
  .content-area {
    width: 100%;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
  }
}

/* Small devices adjustments */
@media screen and (max-width: 576px) {
  .hero-content h2 {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .topic-content h1 {
    font-size: 1.5rem;
  }
  
  .topic-content h2 {
    font-size: 1.25rem;
  }
  
  .topic-content h3 {
    font-size: 1.125rem;
  }
}

/* For very small screens */
@media screen and (max-width: 320px) {
  .header-actions {
    gap: var(--space-1);
  }
  
  .header-actions button {
    padding: var(--space-1) var(--space-1);
  }
}

/* Print styles */
@media print {
  header, footer, .sidebar, .content-header {
    display: none;
  }
  
  .subject-container {
    display: block;
    height: auto;
    overflow: visible;
  }
  
  .topic-content {
    overflow: visible;
    padding: 0;
  }
  
  body {
    background-color: white;
    color: black;
  }
}