:root {
    --primary-blue: #2f76c2;
    --primary-green: #0db188e2;
    --off-white: #F8F9FA;
    --dark-gray: #343a40;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --light-blue-bg: #EAF3FD;
    /* Updated custom offcanvas width variables */
    --custom-offcanvas-mobile-width: 80vw; /* For phones (under 576px) */
    --custom-offcanvas-tablet-width: 400px; /* For tablets (768px to 991.98px) */
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: #ffffff;
}

main {
    flex: 1 0 auto;
    padding-top: 80px;
}

/* Navbar styling */
.navbar {
    background: var(--off-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    padding: 1.2rem 2.4rem;
}

.navbar.hidden {
    transform: translateY(-100%);
}

@media (max-width: 991.98px) {
    .navbar {
        padding: 1.2rem 2.4rem;
    }
    .navbar-brand {
        padding: 0.5rem 0.75rem;
        margin: 0;
    }
    .navbar-collapse {
        padding: 0;
    }
    .navbar-nav {
        margin: 0;
    }
    .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .navbar {
        padding: 0;
    }
    .navbar-brand {
        padding: 0.25rem 0.5rem;
    }
}

.navbar-brand img {
    height: 50px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: rgb(99, 97, 97) !important;
    font-weight: 500;
    padding: 0.5rem 0.5rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: black !important;
}

.navbar-nav .nav-link {
    margin: 0 0.3rem;
}

.welcome-message {
    font-size: 1rem;
    color: rgb(9, 9, 9);
    margin-right: 0.5rem;
    font-weight: 500;
}

.avatar-container {
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid white;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-icon {
    font-size: 40px;
    color: rgb(36, 35, 35);
    line-height: 40px;
}

.dropdown-toggle {
    color: rgb(6, 6, 6) !important;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease;
}

.dropdown-toggle:hover {
    color: var(--primary-green) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow);
    border-radius: 10px;
    min-width: 200px;
    background-color: var(--off-white);
    margin-top: 0.5rem;
}

.navbar-collapse .dropdown-menu {
    background-color: var(--light-blue-bg);
}

.dropdown-item {
    font-weight: 500;
    color: var(--dark-gray);
    white-space: normal;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #e9ecef;
    color: var(--primary-blue);
}

.navbar-collapse .dropdown-menu .dropdown-item {
    color: var(--dark-gray);
}

.navbar-collapse .dropdown-menu .dropdown-item:hover {
    background-color: var(--primary-blue);
    color: white !important;
}

.notification-item {
    font-size: 0.9rem;
    padding: 10px 15px;
}

.bi.bi-bell:hover {
    color: var(--primary-green);
}

.notification-unread {
    font-weight: 600;
    background-color: rgba(255, 0, 0, 0.05);
}

.signup-btn, .login-btn, .message-us-btn {
    background-color: #bdddff6b;
    color: var(--dark-gray);
    border: 1px solid var(--dark-gray);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.signup-btn:hover, .login-btn:hover, .message-us-btn:hover, .logout-btn:hover {
    background-color: var(--dark-gray);
    color: white;
}

.logout-btn {
    background-color: transparent;
    color: var(--dark-gray);
    border: none;
    padding: 0.5rem 1rem;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #e9ecef;
    color: var(--primary-blue);
}

.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-blue);
    color: white;
    border: 1px solid #ffffff;
    border-width: 0.5px;
    border-color: #F8F9FA;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 1002;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-btn img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.whatsapp-btn:hover {
    background-color: var(--dark-gray);
    color: white;
}

.footer {
    background-color: var(--off-white);
    color: var(--dark-gray);
    padding: 3rem 0;
    flex-shrink: 0;
}

.footer-logo img {
    height: 60px;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .footer-logo img {
        height: 50px;
        margin-bottom: 1rem;
    }
}

.footer-tagline {
    font-size: 1rem;
    color: var(--dark-gray);
    opacity: 0.8;
}

.footer-links h5 {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.footer-links i {
    color: rgb(13, 86, 195);
}

.footer-links i:hover {
    color: var(--primary-green);
}

.social-icons a {
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: inline-block;
}

.social-icons a:hover {
    color: var(--primary-green);
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links a {
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-green);
}

.newsletter-form {
    margin-top: 1rem;
}

.newsletter-form .form-control {
    border-radius: 8px;
    border: 1px solid var(--dark-gray);
    padding: 5px;
    font-size: 0.9rem;
    width: 100%;
    margin-bottom: 5px;
}

.newsletter-form .btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.newsletter-form .btn:hover {
    background-color: var(--primary-green);
}

.footer-copyright {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1rem;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--dark-gray);
    opacity: 0.7;
}

.details-button-custom {
    background-color: gainsboro;
    border-color: var(--bs-secondary);
    color: #fff;
    transition: all 0.3s ease;
}

.details-button-custom:hover {
    background-color: transparent;
    border-color: var(--bs-info);
    color: var(--bs-info);
}

/* --- OFFCANVAS STYLES MODIFIED START --- */
.offcanvas {
    background-color: var(--light-blue-bg);
    /* REMOVED: width: var(--offcanvas-width-mobile); */
    /* Handled by media queries below to override Bootstrap defaults */
}

.offcanvas-header {
    padding: 0.5rem;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    /* align-items: flex-start;  Removed as it was conflicting with content alignment */
}

.offcanvas .nav-link:hover {
    background-color: rgba(56, 119, 186, 0.76);
    color: white !important;
}

.offcanvas-header .navbar-nav {
    width: 100%;
    margin-bottom: 0.5rem;
    align-items: flex-end; /* Align nav items to the right within offcanvas */
}

.offcanvas-header .nav-item {
    width: 100%;
}

.offcanvas-header .nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--dark-gray) !important;
    font-size: 1.1rem;
    text-align: right; /* Align text content of nav links to the right */
}

.offcanvas-header .btn {
    width: auto; /* Let buttons take their natural width */
    margin-bottom: 0.5rem;
    /* Consider adding `ms-auto` to the specific button if you want it pushed right
       or add `justify-content-end` to a flex parent wrapping the buttons. */
}

.offcanvas-header .btn-close {
    margin-left: auto; /* Keep the close button pushed to the right */
    margin-top: 0.5rem;
}

/* Removed the problematic `display: none;` */
/* .offcanvas-body {
    display: none;
} */

/* Ensure the offcanvas-body content is visible when offcanvas is open */
.offcanvas.show .offcanvas-body {
    display: block; 
}

/* Override Bootstrap's default full width for offcanvas-end on extra small screens */
@media (max-width: 575.98px) { /* Up to 575.98px (typical phone portrait) */
    .offcanvas-end { /* Target the specific offcanvas direction */
        width: var(--custom-offcanvas-mobile-width); /* E.g., 80vw */
    }
}

/* Tablet width override (for screens >= 768px and < 992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .offcanvas-end { /* Target the specific offcanvas direction */
        width: var(--custom-offcanvas-tablet-width); /* E.g., 400px */
    }
}

/* Dropdown menus inside offcanvas */
.offcanvas .dropdown-menu {
    position: static; /* Prevent dropdown from breaking out of offcanvas flow */
    float: none; /* Remove float behavior */
    width: 100%;
    margin-top: 0;
    box-shadow: none; /* Remove shadow for a cleaner look inside offcanvas */
    background-color: transparent; /* Match offcanvas background */
    border: none;
}

.offcanvas .dropdown-item {
    padding-left: 1.5rem; /* Indent dropdown items */
    text-align: right; /* Align dropdown items to the right */
}

/* --- OFFCANVAS STYLES MODIFIED END --- */


@media (max-width: 991.98px) {
    .navbar-collapse {
        display: none !important;
    }
    .navbar-toggler.d-lg-none {
        display: block !important;
    }
    .navbar-toggler.d-none.d-lg-block {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
    }
    .navbar-toggler.d-lg-none {
        display: none !important;
    }
    .navbar-toggler.d-none.d-lg-block {
        display: none !important;
    }
    .offcanvas {
        visibility: hidden;
    }
    .offcanvas.show {
        visibility: hidden;
    }
}

.authenticated-user-dropdown {
    color: var(--primary-blue) !important;
    font-size: 1.4rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.authenticated-user-dropdown:hover {
    color: var(--dark-gray) !important;
    transform: scale(1.1);
}

.scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-to-top-btn:hover {
    background-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .scroll-to-top-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        bottom: 15px;
        left: 15px;
    }
}

.whatsapp-btn {
    z-index: 1002;
}

/* Section and Animation Styles */
.section {
    padding: 0;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.hero {
    min-height: 570px;
    padding-top: 60px;
    padding-bottom: 50px;
    background-color: #fbfbfb;
    border-radius: 5px;
}

.section.hero-cards-section {
    padding-top: 40px;
    padding-bottom: 0;
    background-color: #eaf2fc;
    margin-top: -40px;
}

.section.offers-section {
    padding: 40px 0;
    background-color: #f8f9fa;
    margin-top: 50px;
    margin-bottom: 50px;
}

.section.impact-section {
    padding: 20px 0;
    background-color: #003c86cb;
    margin-top: 60px;
    margin-bottom: 60px;
    border-radius: 6px;
}

.section.featured-courses {
    padding: 40px 0;
    background-color: #f8f9fa;
}

.section.user-reviews {
    padding: 40px 0;
    background-color: #006d77;
    margin-top: 50px;
    margin-bottom: 50px;
}

.section.why-choose-us {
    padding: 40px 0;
    background-color: #f8f9fa;
}

.section.cta {
    padding: 40px 0;
    background-color: var(--primary-blue);
}

.section.categories {
    padding: 40px 0;
}

.section.cta-footer-2 {
    padding: 40px 0;
    background-color: #343a40;
    margin-bottom: 50px;
}

.section.faq {
    padding: 40px 0;
}

.section.cta-footer {
    padding: 40px 0;
    background-color: var(--primary-blue);
    margin-bottom: 30px;
}

.section-heading {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    color: black; /* Changed from 'inherit' to 'black' */
}

.section-content {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--dark-gray);
}

.card {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-up {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 1;
    transform: translateX(0);
}
