/* ==========================================================================
   TutorBridge - Responsive Stylesheet
   Breakpoints: 1024px, 768px, 480px
   ========================================================================== */

/* --- 1024px Breakpoint (Laptops & Landscape Tablets) --- */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .dashboard-layout {
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
  }

  .chat-wrapper {
    grid-template-columns: 260px 1fr;
  }

  .hero-rebuild-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }

  .hero-title-main {
    font-size: 3rem;
  }

  .hero-image-frame {
    height: 410px;
  }
}

/* --- 768px Breakpoint (Tablets & Mobile) --- */
@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }

  /* Header */
  .nav-links {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  /* Rebuilt Hero: Exact Requested Mobile Hierarchy & Dimensions */
  .hero-rebuild-section {
    padding: 2.75rem 0 3.25rem 0;
    min-height: auto;
  }

  .hero-rebuild-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero-left-col {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 1;
  }

  .hero-right-col {
    width: 100%;
    order: 2; /* Moves image directly below search bar */
  }

  .hero-trust-horizontal.mobile-only {
    order: 3; /* Positioned under image on mobile */
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
  }

  .desktop-only {
    display: none !important;
  }

  .hero-title-main {
    font-size: clamp(2.25rem, 7vw, 2.75rem); /* ~38-46px */
    line-height: 1.18;
    margin-bottom: 1rem;
  }

  .hero-desc-main {
    font-size: 1.0625rem; /* ~17px */
    line-height: 1.55;
    margin-bottom: 1.5rem;
  }

  .hero-horizontal-search {
    height: 68px;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    border-radius: 10px;
    max-width: 100%;
    box-shadow: 0 4px 16px rgba(23, 50, 58, 0.08);
  }

  .hero-search-input {
    font-size: 0.95rem;
  }

  .hero-search-btn {
    height: 100%;
    min-height: 48px;
    padding: 0 1.25rem;
    font-size: 0.9rem;
    border-radius: 6px;
  }

  .hero-image-stage {
    max-width: 100%;
    margin: 0.25rem auto 0 auto;
    padding-top: 18px;
    padding-left: 18px;
  }

  .hero-image-stage::before {
    width: 72%;
    height: 72%;
    border-radius: 10px;
  }

  .hero-image-frame {
    height: 330px; /* ~300-350px high */
    border-radius: 10px;
  }

  /* Marketplace Layout with Sidebar */
  .marketplace-layout {
    grid-template-columns: 1fr !important;
  }

  .filters-sidebar {
    display: none;
  }

  .filters-sidebar.drawer-open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFFFFF;
    z-index: 2500;
    padding: 1.5rem;
    overflow-y: auto;
  }

  #mobile-filter-drawer-btn {
    display: inline-flex !important;
  }

  /* Tutor Profile Layout */
  .profile-layout {
    grid-template-columns: 1fr !important;
  }

  .profile-sidebar {
    display: none;
  }

  .sticky-mobile-cta-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-card);
    box-shadow: 0 -2px 10px rgba(23, 50, 58, 0.08);
    z-index: 900;
    align-items: center;
    justify-content: space-between;
  }

  /* Dashboard Layout */
  .dashboard-layout {
    grid-template-columns: 1fr;
    padding: 1rem 0 3rem 0;
  }

  .dashboard-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0.35rem;
  }

  .dashboard-nav-item {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Messaging Responsive */
  .chat-wrapper {
    grid-template-columns: 1fr;
    height: 560px;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }

  /* Modals */
  .modal-container {
    width: 100%;
    margin: 0.5rem;
    max-height: 94vh;
  }
}

/* --- 480px Breakpoint (Small Mobile) --- */
@media (max-width: 480px) {
  .section {
    padding: 2.75rem 0;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero-title-main {
    font-size: 2.25rem !important;
    line-height: 1.2 !important;
  }

  .hero-desc-main {
    font-size: 1rem !important;
  }

  .hero-horizontal-search {
    height: 60px !important;
    padding: 0.35rem 0.4rem 0.35rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .hero-search-input {
    font-size: 0.875rem !important;
  }

  .hero-search-btn {
    padding: 0 0.85rem !important;
    font-size: 0.8125rem !important;
    min-height: 42px !important;
  }

  .hero-image-frame {
    height: 300px !important;
  }

  h2 {
    font-size: 1.4rem;
  }

  .btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
  }

  .tutor-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .tutor-card-footer .btn {
    width: 100%;
  }

  .course-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .course-card-footer .btn {
    width: 100%;
  }

  .message-bubble {
    max-width: 88%;
  }
}
