/* ============================================================
   RESPONSIVE.CSS — Full Site Mobile/Tablet Responsiveness
   Covers: Navbar, Hero, Stats, About, Community, Footer, 
           Chat Widget, Courses, Notes, Blogs, Gears, Contact
   Breakpoints: 1200px | 992px | 768px | 480px | 360px
   ============================================================ */

/* ---- 1. GLOBAL BOX MODEL FIX ---- */
*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe, dotlottie-player {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   BREAKPOINT: LARGE TABLET / SMALL DESKTOP  (≤ 1200px)
   ============================================================ */
@media (max-width: 1200px) {
  .container {
    padding: 0 30px;
  }

  .hero-content h1,
  .hero-content .hero-content h1 {
    font-size: 3rem !important;
  }

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

  .footer-content {
    grid-template-columns: 1.5fr 1fr 1fr !important;
  }

  /* ==========================
     NAVBAR (Slide-in Drawer)
     ========================== */
  .navbar {
    width: 96% !important;
    padding: 8px 16px !important;
    border-radius: 40px !important;
    top: 12px !important;
    left: 2% !important;
    transform: none !important;
  }

  /* Nav links become full-screen overlay panel */
  .nav-links {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    right: -110% !important;        /* start off-screen */
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    background: rgba(2, 2, 5, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 28px !important;
    transition: right 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    z-index: 1000 !important;
    left: auto !important;
    transform: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 20px !important;
  }

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

  .nav-links li a:not(.nav-btn-stack):not(.nav-btn-book):not(.nav-btn-coding-hub) {
    font-size: 1.1rem !important;
    color: rgba(255,255,255,0.8) !important;
  }

  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    z-index: 1200 !important;
    font-size: 1.25rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  }

  .menu-toggle:hover {
    background: rgba(0, 240, 255, 0.1) !important;
    border-color: rgba(0, 240, 255, 0.3) !important;
    color: #00f0ff !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2) !important;
  }
}

/* ============================================================
   BREAKPOINT: TABLET  (≤ 992px)
   ============================================================ */
@media (max-width: 992px) {
  /* --- NAVBAR --- */
  .navbar {
    width: 92% !important;
    padding: 10px 20px !important;
  }

  /* --- HERO --- */
  .hero-content {
    flex-direction: column !important;
    text-align: center !important;
    padding-top: 120px !important;
    gap: 40px !important;
    min-height: auto !important;
  }

  .hero-text {
    max-width: 100% !important;
  }

  .hero-image {
    transform: translate(0, 0) !important;
    margin-top: 10px;
  }

  .hero-content p {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 580px;
  }

  .cta-group {
    justify-content: center !important;
  }

  .hero-content h1,
  .hero-content h1.typed-courses {
    font-size: 2.8rem !important;
  }

  /* --- ORBIT / LOTTIE --- */
  .orbit-container {
    width: 340px !important;
    height: 340px !important;
  }

  .hero-image dotlottie-player {
    width: 300px !important;
    height: 300px !important;
  }

  /* --- STATS --- */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }

  /* --- COURSES --- */
  .courses-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* --- FOOTER --- */
  .footer-content {
    grid-template-columns: 1fr 1fr !important;
    gap: 40px !important;
  }

  /* --- GEARS BENTO --- */
  .bento-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: 280px !important;
  }

  .bento-box.large {
    grid-row: span 1 !important;
  }

  #gears-hero h1 {
    font-size: 3.5rem !important;
  }
}

/* ============================================================
   BREAKPOINT: MOBILE  (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* --- GLOBAL --- */
  .container {
    padding: 0 16px !important;
  }

  section {
    padding: 70px 0 !important;
    min-height: auto !important;
  }

  .section-title {
    font-size: 1.9rem !important;
    margin-bottom: 1.5rem !important;
  }

  /* NAVBAR drawer rules moved to 1200px query to cover all phone and tablet viewports properly */

  /* ==========================
     HERO SECTION
     ========================== */
  .hero-content h1,
  .hero-content h1 .auto-type {
    font-size: 2.1rem !important;
    line-height: 1.2 !important;
    word-break: break-word;
  }

  .hero-content p {
    font-size: 1rem !important;
    margin-bottom: 28px !important;
  }

  /* Orbit & Lottie */
  .orbit-container {
    width: 270px !important;
    height: 270px !important;
  }

  .hero-image dotlottie-player {
    width: 230px !important;
    height: 230px !important;
  }

  /* Hide alternate tech icons to reduce clutter */
  .tech-icon:nth-child(2n) {
    display: none !important;
  }

  .tech-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
  }

  /* CTA Buttons */
  .cta-group {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 300px;
    text-align: center !important;
    padding: 14px 24px !important;
  }

  /* ==========================
     STATS SECTION
     ========================== */
  #stats {
    padding: 40px 0 !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    max-width: 340px;
    margin: 0 auto;
  }

  /* ==========================
     ABOUT SECTION
     ========================== */
  .about-text {
    padding: 1.2rem !important;
  }

  .about-wrapper {
    padding: 0 !important;
  }

  .tech-stack {
    justify-content: center !important;
    gap: 8px !important;
    flex-wrap: wrap;
  }

  .tech-stack span {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
  }

  /* ==========================
     COMMUNITY CARDS
     ========================== */
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* ==========================
     COURSES PAGE
     ========================== */
  .courses-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }

  .courses-grid .course-card .card-image {
    height: 120px !important;
  }

  /* ==========================
     BLOGS PAGE
     ========================== */
  .blogs-grid,
  .blog-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* ==========================
     NOTES PAGE
     ========================== */
  .notes-hero h1 {
    font-size: 2.2rem !important;
  }

  .filter-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .resource-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }

  /* ==========================
     GEARS / BENTO
     ========================== */
  .bento-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    gap: 16px !important;
  }

  .bento-box.wide,
  .bento-box.tall,
  .bento-box.large {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .bento-box {
    padding: 1.8rem !important;
    min-height: 220px;
  }

  #gears-hero {
    padding: 130px 0 40px !important;
  }

  #gears-hero h1 {
    font-size: 2.5rem !important;
  }

  /* ==========================
     FOOTER
     ========================== */
  footer {
    padding: 70px 0 30px !important;
    padding-bottom: 100px !important; /* extra space for chat widget */
  }

  .footer-content {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    text-align: center !important;
  }

  .footer-brand p {
    margin: 0 auto 25px !important;
    max-width: 300px;
  }

  .footer-brand h2 {
    font-size: 1.8rem !important;
  }

  .social-links {
    justify-content: center !important;
  }

  .footer-links ul li a {
    justify-content: center !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 15px !important;
  }

  /* ==========================
     BACK TO TOP
     ========================== */
  .back-to-top {
    bottom: 85px !important;
    left: 20px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 1rem !important;
  }

  /* ==========================
     CHAT WIDGET
     ========================== */
  .chat-widget {
    bottom: 18px !important;
    right: 18px !important;
  }

  .chat-button {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.3rem !important;
  }

  .chat-window {
    position: fixed !important;
    bottom: 80px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    height: 60vh !important;
    max-height: 400px !important;
    border-radius: 16px !important;
  }

  /* ==========================
     PRELOADER (Mobile)
     ========================== */
  .preloader-content {
    width: 320px !important;
    height: 320px !important;
  }

  .preloader-orbit {
    width: 280px !important;
    height: 280px !important;
    margin-top: -140px !important;
    margin-left: -140px !important;
  }

  .main-ring {
    width: 200px !important;
    height: 200px !important;
  }

  .inner-ring {
    width: 160px !important;
    height: 160px !important;
  }

  /* ==========================
     HERO PAGES (inner pages)
     ========================== */
  .legal-content {
    padding-top: 110px !important;
  }

  /* ==========================
     CONTACT PAGE
     ========================== */
  .contact-hero {
    padding: 110px 16px 40px !important;
  }

  .contact-card-wrapper {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    border-radius: 16px !important;
  }

  .contact-info-panel,
  .contact-form-panel {
    padding: 30px 20px !important;
  }

  .info-header h2 {
    font-size: 1.8rem !important;
  }

  /* ==========================
     LOGIN PAGE
     ========================== */
  .auth-container,
  .login-wrapper,
  .auth-card {
    margin: 0 16px !important;
    width: auto !important;
  }
}

/* ============================================================
   BREAKPOINT: SMALL MOBILE  (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  html {
    font-size: 85% !important;
  }

  .hero-content h1 {
    font-size: 1.85rem !important;
  }

  .hero-content p {
    font-size: 0.95rem !important;
  }

  /* Single column courses */
  .courses-grid {
    grid-template-columns: 1fr !important;
  }

  /* Single column notes */
  .resource-grid {
    grid-template-columns: 1fr !important;
  }

  /* Stat items extra compact */
  .stat-item h3 {
    font-size: 2.2rem !important;
  }

  .section-title {
    font-size: 1.65rem !important;
  }

  .glass-card {
    padding: 1.2rem !important;
  }

  /* Footer compact */
  .footer-brand h2 {
    font-size: 1.5rem !important;
  }

  /* Nav link font */
  .nav-links li a {
    font-size: 1.2rem !important;
  }

  /* Bento title */
  .bento-title {
    font-size: 1.4rem !important;
  }

  /* Blogs cards */
  .blog-card {
    padding: 0.8rem !important;
  }
}

/* ============================================================
   BREAKPOINT: VERY SMALL  (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
  .hero-content h1 {
    font-size: 1.6rem !important;
  }

  .navbar .logo {
    font-size: 1rem !important;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 16px !important;
    font-size: 0.85rem !important;
  }

  .chat-button {
    width: 46px !important;
    height: 46px !important;
  }
}

/* ============================================================
   UTILITY: Prevent horizontal overflow globally
   ============================================================ */
body {
  overflow-x: hidden !important;
}

/* Horizontal scroll sections get touch scrolling */
.horizontal-scroll-view {
  -webkit-overflow-scrolling: touch;
}
