/* =========================================================
   RESPONSIVE.CSS - Comprehensive Responsive Rules
   Noor-e-Ilm LMS - Public Site
   Breakpoints: 1440px, 1200px, 1024px, 991px, 768px, 576px, 425px, 375px, 320px
   ========================================================= */


/* =========================================================
   1. GLOBAL RESETS & UTILITIES
   ========================================================= */

*,
*::before,
*::after {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

img {
    height: auto;
}

table {
    width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.form-control,
.form-select,
textarea,
input,
select,
button {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6,
p, td, th, label, a, span {
    overflow-wrap: anywhere;
}
.navbar-main a,
.navbar-main .btn,
.navbar-main .nav-link {
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* Scrollbar styling for touch */
.sidebar-menu::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar-thumb {
    width: 4px;
}


/* =========================================================
   2. LARGE DESKTOPS (1440px and above)
   ========================================================= */

@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }
}


/* =========================================================
   3. STANDARD DESKTOPS (max-width: 1200px)
   ========================================================= */

@media (max-width: 1200px) {

    .container {
        width: 95%;
    }

    /* Public typography */
    .section-title,
    .about-title {
        font-size: 2rem;
    }

    .about-text,
    .section-description {
        font-size: 1rem;
    }

    /* Course cards */
    .course-card .course-body h4 {
        font-size: 20px;
    }

    /* Feature cards */
    .feature-card {
        padding: 30px;
    }
}


/* =========================================================
   4. SMALL DESKTOPS / LARGE TABLETS (max-width: 1024px)
   ========================================================= */

@media (max-width: 1024px) {

    .container {
        width: 92%;
    }

    /* Reduce large paddings */
    .about-section,
    .courses-section,
    .why-section {
        padding: 60px 0;
    }

    /* Hero */
    .hero-slide-img {
        max-height: 420px;
    }
}


/* =========================================================
   5. TABLETS (max-width: 991px)
   ========================================================= */

@media (max-width: 991px) {

    /* ----- Container ----- */
    .container {
        width: 95%;
        max-width: 100%;
    }

    /* ----- Typography ----- */
    .section-title,
    .about-title {
        font-size: 1.8rem;
    }

    .section-description,
    .about-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    /* ----- Section Padding ----- */
    .about-section,
    .courses-section,
    .why-section,
    .testimonials-section,
    .faq-section {
        padding: 50px 0;
    }

    .stats-section {
        padding: 50px 0;
    }

    /* ----- Public Navbar ----- */
    .navbar {
        padding: 8px 0;
    }

    .navbar-brand img {
        height: 48px !important;
        width: auto !important;
        object-fit: contain;
    }

    .navbar-brand .brand-name {
        font-size: 0.95rem !important;
    }

    .navbar-brand .brand-tagline {
        font-size: 0.6rem !important;
    }

    /* ----- Course Cards ----- */
    .course-image {
        height: 180px;
    }

    .course-body {
        padding: 18px;
    }

    .course-body h4 {
        font-size: 18px;
    }

    /* ----- Feature Cards ----- */
    .feature-card {
        padding: 25px 18px;
    }

    .feature-icon {
        width: 65px;
        height: 65px;
        font-size: 30px;
    }

    .feature-card h4 {
        font-size: 20px;
    }

    /* ----- Footer ----- */
    .footer-col {
        margin-bottom: 30px;
    }

    /* ----- CTA Section ----- */
    .cta-glass {
        padding: 35px 20px;
    }
}


/* =========================================================
   6. TABLET PORTRAIT (max-width: 768px)
   ========================================================= */

@media (max-width: 768px) {

    /* ----- Typography ----- */
    .section-title,
    .about-title {
        font-size: 1.6rem;
    }

    .about-text,
    .section-description {
        font-size: 0.9rem;
    }

    .about-badge,
    .section-badge {
        font-size: 0.75rem;
        padding: 6px 14px;
    }

    /* ----- Section Padding ----- */
    .about-section,
    .courses-section,
    .why-section,
    .testimonials-section,
    .faq-section {
        padding: 40px 0;
    }

    .stats-section {
        padding: 40px 0;
    }

    /* ----- Course Cards ----- */
    .course-card {
        border-radius: 14px;
    }

    .course-image {
        height: 160px;
    }

    .course-body {
        padding: 15px;
    }

    .course-body h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .course-badge {
        font-size: 12px;
        padding: 4px 10px;
        margin-bottom: 10px;
    }

    .course-info li {
        padding: 6px 0;
        font-size: 0.85rem;
    }

    /* ----- Feature Cards ----- */
    .feature-card {
        padding: 20px 15px;
        border-radius: 14px;
    }

    .feature-icon {
        width: 55px;
        height: 55px;
        font-size: 26px;
        margin-bottom: 15px;
    }

    .feature-card h4 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .feature-card p {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* ----- Stat Cards (homepage) ----- */
    .stat-card {
        padding: 25px 15px;
        border-radius: 14px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-icon {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    /* ----- Testimonial Cards ----- */
    .testimonial-card {
        padding: 20px;
        border-radius: 14px;
    }

    /* ----- Footer ----- */
    .footer-col-title {
        font-size: 1rem;
    }

    .footer-about-text {
        font-size: 0.85rem;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    .footer-contact-item {
        font-size: 0.85rem;
    }

    .footer-social-icons a {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    /* ----- Tables ----- */
    table {
        min-width: 500px;
    }

    /* ----- Contact form, gallery, video cards ----- */
    .gallery-item img {
        border-radius: 10px;
    }

    .video-card {
        border-radius: 14px;
    }
}


/* =========================================================
   7. MOBILE LANDSCAPE (max-width: 576px)
   ========================================================= */

@media (max-width: 576px) {

    /* ----- Typography ----- */
    .section-title,
    .about-title {
        font-size: 1.4rem;
    }

    .section-description,
    .about-text {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* ----- Section Padding ----- */
    .about-section,
    .courses-section,
    .why-section,
    .testimonials-section,
    .faq-section {
        padding: 30px 0;
    }

    .stats-section {
        padding: 30px 0;
    }

    /* ----- Course Tabs ----- */
    #courseTabs .nav-link {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin: 2px;
    }

    /* ----- Course Cards ----- */
    .course-image {
        height: 140px;
    }

    .course-body {
        padding: 12px;
    }

    .course-body h4 {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .course-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .course-info li {
        padding: 5px 0;
        font-size: 0.8rem;
    }

    /* ----- Feature Cards ----- */
    .feature-card {
        padding: 18px 12px;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
        margin-bottom: 10px;
    }

    .feature-card h4 {
        font-size: 16px;
    }

    .feature-card p {
        font-size: 0.8rem;
    }

    /* ----- Stat Cards ----- */
    .stat-card {
        padding: 20px 12px;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    /* ----- Testimonial Cards ----- */
    .testimonial-card {
        padding: 15px;
    }

    /* ----- CTA Section ----- */
    .cta-glass {
        padding: 25px 15px;
    }

    .cta-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    /* ----- Footer ----- */
    .footer-col {
        margin-bottom: 25px;
    }

    .footer-col-title {
        font-size: 0.95rem;
    }

    .footer-about-text,
    .footer-links a,
    .footer-contact-item {
        font-size: 0.8rem;
    }

    .footer-bottom p {
        font-size: 0.8rem;
    }

    .footer-logo {
        max-width: 55px;
    }

    .footer-social-icons {
        justify-content: center;
    }

    /* ----- Buttons ----- */
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* ----- Tables ----- */
    table {
        min-width: 450px;
    }

    /* ----- Page-specific standalone ----- */
    .page-banner,
    .page-header {
        padding: 25px 0;
    }

    /* Gallery grid */
    .gallery-grid {
        gap: 8px;
    }

    /* Forms */
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .form-control,
    .form-select {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Login / Register cards */
    .login-card,
    .register-card {
        padding: 20px;
        margin: 15px;
    }
}


/* =========================================================
   8. LARGE MOBILE (max-width: 425px)
   ========================================================= */

@media (max-width: 425px) {

    /* ----- Typography ----- */
    .section-title,
    .about-title {
        font-size: 1.3rem;
    }

    /* ----- Navbar ----- */
    .navbar-brand .brand-name {
        font-size: 0.85rem !important;
    }

    .navbar-brand .brand-tagline {
        display: none;
    }

    .navbar-brand img {
        height: 44px !important;
        width: auto !important;
        object-fit: contain;
    }

    /* ----- Sections ----- */
    .about-section,
    .courses-section,
    .why-section,
    .testimonials-section,
    .faq-section {
        padding: 25px 0;
    }

    .stats-section {
        padding: 25px 0;
    }

    /* ----- Course Cards ----- */
    .course-image {
        height: 130px;
    }

    .course-body {
        padding: 10px;
    }

    .course-body h4 {
        font-size: 14px;
    }

    /* ----- Feature Cards ----- */
    .feature-card {
        padding: 15px 10px;
    }

    .feature-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .feature-card h4 {
        font-size: 15px;
    }

    /* ----- Stat Cards ----- */
    .stat-number {
        font-size: 1.4rem;
    }

    .stat-card {
        padding: 18px 10px;
    }

    /* ----- Testimonial ----- */
    .testimonial-card {
        padding: 12px;
    }

    /* ----- Buttons ----- */
    .btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    /* ----- Footer ----- */
    .footer-col-title::after {
        width: 30px;
    }
}


/* =========================================================
   9. STANDARD MOBILE (max-width: 375px)
   ========================================================= */

@media (max-width: 375px) {

    /* ----- Typography ----- */
    .section-title,
    .about-title {
        font-size: 1.2rem;
    }

    /* ----- Sections ----- */
    .about-section,
    .courses-section,
    .why-section,
    .testimonials-section,
    .faq-section {
        padding: 20px 0;
    }

    .stats-section {
        padding: 20px 0;
    }

    /* ----- Course Cards ----- */
    .course-image {
        height: 120px;
    }

    .course-body h4 {
        font-size: 13px;
    }

    /* ----- Feature Cards ----- */
    .feature-card h4 {
        font-size: 14px;
    }

    .feature-card p {
        font-size: 0.75rem;
    }

    /* ----- Stat Cards ----- */
    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    /* ----- CTA ----- */
    .cta-title {
        font-size: 1.2rem;
    }

    .cta-btn {
        padding: 8px 20px;
        font-size: 0.8rem;
    }

    /* ----- Footer ----- */
    .footer-bottom {
        text-align: center;
    }

    .footer-bottom p {
        font-size: 0.75rem;
    }
}


/* =========================================================
   10. SMALL MOBILE (max-width: 320px)
   ========================================================= */

@media (max-width: 320px) {

    /* ----- Typography ----- */
    .section-title,
    .about-title {
        font-size: 1.1rem;
    }

    /* ----- Sections ----- */
    .about-section,
    .courses-section,
    .why-section,
    .testimonials-section,
    .faq-section {
        padding: 15px 0;
    }

    .stats-section {
        padding: 15px 0;
    }

    /* ----- Navbar ----- */
    .navbar-brand img {
        height: 40px !important;
        width: auto !important;
        object-fit: contain;
    }

    .navbar-brand .brand-name {
        font-size: 0.8rem !important;
    }

    /* ----- Course Tabs ----- */
    #courseTabs .nav-link {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    /* ----- Course Cards ----- */
    .course-image {
        height: 100px;
    }

    .course-body {
        padding: 8px;
    }

    .course-body h4 {
        font-size: 12px;
    }

    .course-info li {
        font-size: 0.75rem;
        padding: 4px 0;
    }

    /* ----- Feature Cards ----- */
    .feature-card {
        padding: 12px 8px;
    }

    .feature-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .feature-card h4 {
        font-size: 13px;
    }

    /* ----- Stat Cards ----- */
    .stat-number {
        font-size: 1.1rem;
    }

    .stat-card {
        padding: 15px 8px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* ----- Footer ----- */
    .footer-logo {
        max-width: 45px;
    }

    .footer-social-icons a {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    /* ----- Login/Register ----- */
    .login-card,
    .register-card {
        padding: 15px;
        margin: 10px;
    }
}

/* ----- Mobile/tablet: prevent horizontal overflow from AOS side-shift reveals -----
   Horizontal reveal offsets (fade-right / fade-left) translate grid columns off-
   screen and cause a horizontal scrollbar (e.g. the contact form & "Connect With
   Us" columns on phones/tablets). Below the `lg` breakpoint Bootstrap already
   stacks `col-lg-*` columns full-width, so the horizontal translate only
   introduces overflow. We neutralize the side-shift below `lg` (keeping vertical
   fade-up motion) so content always fits the viewport. */
@media (max-width: 991px) {
    [data-aos="fade-right"],
    [data-aos="fade-left"],
    [data-aos="fade-up-right"],
    [data-aos="fade-up-left"],
    [data-aos="fade-down-right"],
    [data-aos="fade-down-left"] {
        transform: none !important;
    }

    /* Contact page: keep form/Connect columns full-width & stacked below `lg`
       and remove Bootstrap row negative gutters so the fixed 45px form padding
       never overflows the viewport. */
    .contact-cards .row,
    .form-section .row {
        margin-left: 0;
        margin-right: 0;
    }
    .form-section .col-lg-7,
    .form-section .col-lg-5 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* General: neutralize the large `g-5` Bootstrap gutters on any row below `lg`.
       At these widths `col-lg-*` columns stack full-width, so the 3rem gutters are
       no longer needed and their negative row margins cause a horizontal scrollbar
       (e.g. on the public course-detail page). */
    .row.g-5 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .row.g-5 > [class*="col-"] {
        padding-left: 12px;
        padding-right: 12px;
    }
}
