:root {
    --primary: #8bc34a;
    --secondary: #ff7f50;
    --accent: #ffeb3b;
    --blue: #2196F3;
    --light-bg: #f0f9ff;
    --text-dark: #333333;
    --text-muted: #666666;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--light-bg);
    padding-top: 80px; /* Add padding to prevent content from hiding behind the fixed navbar */
}

.navbar {
    background-color: var(--primary) !important;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: white !important;
}

.nav-link {
    color: white !important;
    font-weight: 500;
    margin-left: 10px;
}

/* Mobile menu icon states:
   - default: hamburger
   - expanded: X
*/
.navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-toggler[aria-expanded='true'] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M7 7l16 16M23 7L7 23'/%3e%3c/svg%3e") !important;
}

/* Carousel Styling */
.carousel-inner {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0);
    position: relative;
}

.carousel-item {
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

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

.carousel-caption {
    background-color: rgba(0, 0, 0, 0);
    border-radius: 15px;
    padding: 20px;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    text-align: center;
    position: absolute;
    word-wrap: break-word;
}

/* Responsive caption styling */
@media (max-width: 767.98px) {
    .carousel-item {
        height: 300px; /* Reduce height on mobile */
        overflow: hidden;
    }
    
    .carousel-item img {
        object-fit: cover;
        height: 100%;
        width: 100%;
    }
    
    .carousel-caption {
        padding: 8px 12px;
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 8px;
        position: absolute;
        transform: none;
        text-align: center;
    }
    
    .carousel-caption h2 {
        font-size: 1.2rem !important;
        line-height: 1.3;
        margin-bottom: 5px;
        word-wrap: break-word;
    }
    
    .carousel-caption p {
        font-size: 0.85rem !important;
        line-height: 1.3;
        margin-bottom: 0;
        word-wrap: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .btn-enroll {
        padding: 6px 15px !important;
        font-size: 0.9rem !important;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 575.98px) {
    .carousel-item {
        height: 250px;
    }
    
    .carousel-caption {
        padding: 6px 10px;
        bottom: 8px;
        left: 8px;
        right: 8px;
        max-width: calc(100% - 16px);
        transform: none;
    }
    
    .carousel-caption h2 {
        font-size: 1rem !important;
        line-height: 1.2;
        margin-bottom: 4px;
    }
    
    .carousel-caption p {
        font-size: 0.75rem !important;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }
}

.carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-caption p {
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.carousel-control-prev, .carousel-control-next {
    width: 5%;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-enroll {
    background-color: var(--primary);
    color: white;
    border-radius: 30px;
    padding: 10px 30px;
    font-weight: bold;
    border: none;
}

.feature-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
    height: 100%;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.icon-1 {
    background-color: var(--accent);
}

.icon-2 {
    background-color: var(--secondary);
}

.icon-3 {
    background-color: var(--primary);
}

.feature-card h3 {
    color: var(--text-dark);
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.feature-card p {
    color: var(--text-muted);
    text-align: center;
}

.footer {
    background-color: var(--primary);
    color: white;
    padding: 20px 0;
}

.social-icon {
    width: 36px;
    height: 36px;
    background-color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.2);
}

.logo-circle {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 5px;
}

.circle-yellow {
    background-color: var(--accent);
}

.circle-green {
    background-color: var(--secondary);
}

.circle-blue {
    background-color: #2196F3;
}

/* Mobile fixes:
   - Bootstrap's `.fixed-top` can cover the hero/slider.
   - Force toggler to appear before the brand image.
*/
@media (max-width: 575.98px) {
    body {
        /* Navbar is sticky on mobile, so no extra body offset is needed */
        padding-top: 0;
    }

    .fixed-top {
        position: sticky !important;
        top: 0;
    }

    .navbar {
        padding: 10px 0;
        position: relative;
    }

    /* Mobile navbar layout:
       - keep logo/title and toggler on the same row
       - allow title to be truncated when space is tight */
    .navbar .container,
    .navbar > .container {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px;
    }

    .navbar-toggler {
        /* Keep the toggler on the same row */
        white-space: nowrap !important;
        flex: 0 0 auto !important;
        /* Force the toggler to the right side */
        margin-left: auto !important;
        position: relative;
        z-index: 1061;
    }

    .navbar-brand {
        /* Force brand to align horizontally with the toggler */
        display: flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Keep collapse from taking inline width in the top row */
    .navbar-collapse {
        flex-basis: auto;
        width: auto;
    }

    /* Open as an overlay panel from the right so:
       - X stays on the right
       - menu items can cover part of title when needed */
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        position: absolute;
        top: 0;
        right: 0;
        min-width: 210px;
        background-color: var(--primary);
        padding: 52px 14px 10px;
        border-radius: 0 0 0 10px;
        z-index: 1060;
    }

    .navbar-collapse.show .navbar-nav,
    .navbar-collapse.collapsing .navbar-nav {
        margin-left: 0 !important;
    }

    .navbar-collapse.show .nav-link,
    .navbar-collapse.collapsing .nav-link {
        display: block;
        padding: 6px 0;
    }

    .navbar-brand img {
        height: 60px !important;
        width: auto;
        max-width: 100%;
        /* Make logo stand out against the header background */
        filter: brightness(1.15) contrast(1.05);
        flex: 0 0 auto;
    }

    /* Reduce slider section spacing to about half on phones */
    .carousel-section.py-5 {
        padding-top: 3.0rem !important;
        padding-bottom: 0.75rem !important;
    }
}
