/* ==========================================================================
   LOGO - Modern LMS & EdTech Platform
   Advanced Mobile & Responsive Media Queries (responsive.css)
   ========================================================================== */

/* --- XL Screens (Below 1200px) --- */
@media (max-width: 1200px) {
  .hero-title {
    font-size: 2.75rem;
  }
  
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* --- LG Screens / Tablet Landscape (Below 992px) --- */
@media (max-width: 992px) {
  .topbar-links {
    display: none;
  }

  .nav-menu {
    display: none;
  }

  .mobile-toggle-btn {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Content appears first on mobile, visual follows */
  .hero-content {
    order: 1;
    text-align: left;
  }

  .hero-visual {
    order: 2;
    max-width: 460px;
    margin: 0 auto;
  }

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

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

  .newsletter-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .newsletter-form-box {
    max-width: 500px;
    margin: 0 auto;
  }

  /* --- Course Catalog Offcanvas Filter Drawer on Mobile --- */
  .catalog-layout {
    display: block;
  }

  .btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
  }

  .filter-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-dark);
  }

  .filter-mobile-apply-bar {
    display: block;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .catalog-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 2300;
    padding: 1.5rem;
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .catalog-sidebar.active {
    transform: translateX(0);
  }

  .catalog-backdrop {
    display: block;
  }

  /* --- Student Portal Mobile Navigation & Offcanvas Drawer --- */
  .student-layout {
    display: block;
  }

  .student-mobile-header-wrap {
    display: block;
  }

  .student-sidebar-close-row {
    display: flex;
  }

  .student-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 310px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 2300;
    padding: 1.5rem;
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .student-sidebar.active {
    transform: translateX(0);
  }

  .student-sidebar-backdrop {
    display: block;
  }

  /* --- Classroom Curriculum Offcanvas Drawer on Mobile --- */
  .classroom-wrapper {
    display: block;
  }

  .btn-curriculum-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  .curriculum-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: none;
    font-size: 1.1rem;
    color: var(--text-dark);
    cursor: pointer;
  }

  .classroom-curriculum {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 340px;
    max-width: 88vw;
    background: #ffffff;
    z-index: 2300;
    border-right: none;
    box-shadow: var(--shadow-xl);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .classroom-curriculum.active {
    transform: translateX(0);
  }

  .classroom-curriculum-backdrop {
    display: block;
  }

  .classroom-progress-pill {
    display: none !important;
  }

  .classroom-topbar {
    padding: 0 1rem !important;
  }

  .classroom-topbar-title {
    max-width: 150px !important;
    font-size: 0.88rem !important;
  }
}

/* --- Lead Generation Modal Mobile Layout (Below 820px) --- */
@media (max-width: 820px) {
  .lead-modal-overlay {
    padding: 0.75rem;
  }

  .lead-modal-card {
    max-width: 100%;
    max-height: 94vh;
    border-radius: var(--radius-xl);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lead-modal-grid {
    grid-template-columns: 1fr;
  }

  .lead-modal-promo {
    padding: 1.5rem 1.25rem 1rem;
    text-align: center;
    align-items: center;
  }

  .lead-modal-promo::before {
    display: none;
  }

  .lead-badge {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
  }

  .lead-modal-promo h3 {
    font-size: 1.28rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
  }

  .lead-promo-sub {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.65rem;
    color: #cbd5e1;
  }

  /* Hide long desktop-heavy benefits list and avatar stack on mobile */
  .lead-benefits-list,
  .lead-trust-indicator {
    display: none;
  }

  /* Compact perks badges on mobile */
  .lead-mobile-perks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
  }

  .lead-mobile-perks span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
  }

  .lead-mobile-perks span i {
    color: #38bdf8;
    font-size: 0.75rem;
  }

  .lead-mobile-perks span:nth-child(2) i {
    color: #fbbf24;
  }

  .lead-mobile-perks span:nth-child(3) i {
    color: #34d399;
  }

  /* Right Form Area on Mobile */
  .lead-modal-form-wrap {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  /* Avoid repeating promo copy since banner already explains it */
  .lead-form-header {
    display: none;
  }

  .lead-form .form-group {
    margin-bottom: 0.75rem !important;
  }

  .lead-form .form-label {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
  }

  .lead-form .form-control {
    height: 42px;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
  }

  .input-icon-group .form-control {
    padding-left: 2.35rem;
  }

  .input-icon-group .input-icon {
    left: 0.85rem;
    font-size: 0.85rem;
  }

  .country-prefix {
    padding: 0 0.65rem;
    font-size: 0.85rem;
  }

  .lead-submit-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.92rem;
    margin-top: 0.5rem;
  }

  .lead-modal-close {
    top: 0.65rem;
    right: 0.65rem;
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
  }
}

/* --- MD Screens / Tablet Portrait (Below 768px) --- */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }

  /* Global typography scale down for mobile */
  h1, .h1 { 
    font-size: 1.75rem !important; 
    line-height: 1.25 !important;
    letter-spacing: -0.02em;
  }
  h2, .h2 { 
    font-size: 1.55rem !important; 
    line-height: 1.3 !important;
    letter-spacing: -0.01em;
  }
  h3, .h3 { 
    font-size: 1.25rem !important; 
    line-height: 1.35 !important;
  }
  h4, .h4 { 
    font-size: 1.08rem !important; 
  }

  /* Page banners */
  .page-banner {
    padding: 3rem 0 2.5rem !important;
  }

  .page-banner h1,
  .page-banner h1[style] {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.5rem !important;
  }

  .page-banner p,
  .page-banner p[style] {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
  }

  /* Section headers */
  .section-header {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: 1.55rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.65rem;
  }

  .section-subtitle {
    font-size: 0.78rem;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.65rem;
  }

  .section-desc {
    font-size: 0.9rem;
    line-height: 1.5;
  }

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

  .hero-title {
    font-size: 1.85rem !important;
    line-height: 1.24 !important;
    margin-bottom: 0.85rem;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
  }

  .hero-search-box {
    flex-direction: column;
    padding: 0.65rem;
    border-radius: var(--radius-lg);
    gap: 0.65rem;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

  .hero-search-box input {
    font-size: 0.9rem;
    padding: 0.4rem 0.5rem;
  }

  .hero-search-box .btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    justify-content: center;
  }

  .hero-trending {
    font-size: 0.82rem;
    gap: 0.4rem;
  }

  .trend-tag {
    padding: 0.2rem 0.55rem;
    font-size: 0.76rem;
  }

  /* Grids */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .floating-card {
    display: none;
  }

  /* Course cards */
  .course-card {
    border-radius: var(--radius-lg);
  }

  .course-card-thumb {
    height: 180px;
  }

  .course-card-content {
    padding: 1.25rem;
  }

  .course-card h3,
  .course-card h4,
  .course-title {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.5rem;
  }

  .course-meta {
    font-size: 0.78rem;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
  }

  .course-price, .price-current {
    font-size: 1.28rem !important;
  }

  /* Top Announcement Bar */
  .topbar {
    padding: 0.4rem 0;
    font-size: 0.8rem;
  }

  .topbar-content {
    justify-content: center;
    text-align: center;
  }

  .topbar-promo {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
  }

  .topbar-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
  }

  .topbar-countdown {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Events & Webinars */
  .event-card {
    flex-direction: column;
  }

  .event-thumb, .event-content {
    width: 100%;
  }

  .event-thumb {
    height: 170px;
  }

  .pricing-toggle-wrap {
    margin-bottom: 2rem;
  }

  .pricing-card.popular {
    transform: none;
  }

  .pricing-price {
    font-size: 2.1rem !important;
  }

  .stat-number {
    font-size: 2.2rem !important;
  }

  /* Shopping Cart & Checkout tables */
  .cart-table-wrap {
    overflow-x: auto;
  }

  .checkout-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- SM Screens / Mobile Devices (Below 576px) --- */
@media (max-width: 576px) {
  .container,
  .container-fluid {
    padding: 0 1rem;
  }

  /* Header adjustments */
  .site-header .header-container {
    height: 64px;
  }

  .site-logo {
    font-size: 1.25rem;
    gap: 0.5rem;
  }

  .site-logo-img {
    height: 32px;
    max-width: 140px;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  /* Hide user button text in header, keep icon for space */
  .header-actions .btn span {
    display: none;
  }

  .header-actions .btn {
    padding: 0.45rem 0.65rem;
    min-width: unset;
  }

  .header-actions {
    gap: 0.6rem;
  }

  .action-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  /* Headings on small mobile */
  h1, .h1 { 
    font-size: 1.6rem !important; 
  }

  .hero-title {
    font-size: 1.65rem !important;
    line-height: 1.22 !important;
  }

  .page-banner h1,
  .page-banner h1[style] {
    font-size: 1.55rem !important;
  }

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

  /* Categories: Clean 2-column mobile card grid like top edtech apps */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .category-card {
    padding: 1.1rem 0.75rem;
    text-align: center;
    border-radius: var(--radius-md);
  }

  .category-icon-wrap {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    margin: 0 auto 0.75rem;
  }

  .category-card h4 {
    font-size: 0.88rem !important;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }

  .category-card .count {
    font-size: 0.72rem;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-number {
    font-size: 1.95rem !important;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 1.35rem 1.15rem;
  }

  .testimonial-quote {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  /* Global Toast positioning on mobile */
  .toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
  }

  .toast-msg {
    min-width: unset;
    width: 100%;
    padding: 0.85rem 1rem;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .classroom-main {
    padding: 1rem;
  }

  /* Floating Lead Trigger Pill on mobile */
  .floating-lead-trigger {
    bottom: 14px;
    left: 14px;
    padding: 0.4rem 0.8rem 0.4rem 0.45rem;
    gap: 0.5rem;
    box-shadow: 0 8px 20px -3px rgba(79, 70, 229, 0.45);
  }

  .lead-trigger-badge {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .lead-trigger-text {
    font-size: 0.78rem;
  }

  .back-to-top {
    bottom: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

/* --- XS Screens / Compact Phones (Below 420px) --- */
@media (max-width: 420px) {
  /* Topbar concise view: hide verbose text, show sale badge + countdown */
  .topbar-promo > span:not(.topbar-badge) {
    display: none;
  }

  .hero-title {
    font-size: 1.5rem !important;
  }

  /* Convert floating lead pill into a sleek round floating button to save space */
  .lead-trigger-text {
    display: none;
  }

  .floating-lead-trigger {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .lead-trigger-badge {
    animation: none;
  }

  .lead-voucher-code-wrap code {
    font-size: 1.15rem;
    padding: 0.35rem 0.65rem;
  }

  .pricing-price {
    font-size: 1.75rem !important;
  }

  .partner-item {
    font-size: 1rem;
  }
}

/* --- Mobile Drawer Menu --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #ffffff;
  z-index: 2200;
  box-shadow: var(--shadow-xl);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 2199;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-body {
  padding: 1.5rem;
  flex-grow: 1;
}

.mobile-nav-list li {
  margin-bottom: 0.75rem;
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.5rem;
  font-weight: 600;
  color: var(--secondary);
  border-radius: var(--radius-sm);
}

.mobile-nav-list a:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.mobile-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-body);
}
