/* General Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden;
    padding: 0 50px; /* Space for arrows */
}

/* Override grid styles when using carousel */
.carousel-container .news-grid,
.carousel-container .courses-grid,
.carousel-container .clients-grid {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    margin: 0 !important;
}

.carousel-wrapper {
    overflow: hidden;
    margin: 0 -10px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.carousel-item {
    flex: 0 0 33.333%;
    padding: 0 10px;
    box-sizing: border-box;
    min-height: 400px;
    width: 33.333%;
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 2px solid #2E5C8A;
    color: #2E5C8A;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    z-index: 2;
}

.carousel-nav:hover {
    background: #2E5C8A;
    color: white;
}

.carousel-nav.prev {
    left: 0;
}

.carousel-nav.next {
    right: 0;
}

.carousel-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Carousel Dots */
.carousel-dots {
    text-align: center;
    padding: 20px 0 0;
}

.carousel-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ddd;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: #2E5C8A;
    width: 30px;
    border-radius: 5px;
}

/* Specific Carousel Adjustments */
/* Courses Carousel */
.courses-carousel .carousel-item {
    flex: 0 0 33.333%; /* 3 items per row */
}

.courses-carousel .course-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.courses-carousel .course-card:hover {
    transform: translateY(-5px);
}

.courses-carousel .course-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.courses-carousel .course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.courses-carousel .course-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.courses-carousel .course-excerpt {
    flex: 1;
    margin-bottom: 1rem;
}

.courses-carousel .course-meta {
    margin-bottom: 1rem;
}

.courses-carousel .course-price,
.courses-carousel .course-duration {
    display: inline-block;
    margin-right: 1rem;
    font-size: 0.875rem;
    color: #666;
}

/* News Carousel */
.news-carousel .carousel-item {
    flex: 0 0 33.333%;
}

.news-carousel .news-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.news-carousel .news-card:hover {
    transform: translateY(-5px);
}

.news-carousel .news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.news-carousel .news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.news-carousel .news-excerpt {
    flex: 1;
    margin-bottom: 1rem;
}

/* Clients Carousel */
.clients-carousel .carousel-item {
    flex: 0 0 20%; /* 5 items per row like in the design */
    text-align: center;
}

.clients-carousel .client-item {
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    transition: all 0.3s;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px;
}

.clients-carousel .client-item:hover {
    border-color: #2E5C8A;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 92, 138, 0.15);
}

.clients-carousel .client-item img {
    max-width: 90%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter 0.3s;
}

.clients-carousel .client-item:hover img {
    filter: grayscale(0%);
}

.clients-carousel .client-item h4 {
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 991px) and (min-width: 768px) {
    .courses-carousel .carousel-item,
    .news-carousel .carousel-item {
        flex: 0 0 50%; /* 2 items on tablet */
    }
}

@media (max-width: 991px) {
    .clients-carousel .carousel-item {
        flex: 0 0 25%; /* 4 items on tablet */
    }
}

@media (max-width: 767px) {
    .carousel-container {
        padding: 0 30px;
    }
    
    .courses-carousel .carousel-item,
    .news-carousel .carousel-item {
        flex: 0 0 100%; /* 1 item on mobile */
    }
    
    .clients-carousel .carousel-item {
        flex: 0 0 33.333%; /* 3 items on mobile */
    }
    
    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        z-index: 10;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    .carousel-nav.prev {
        left: 5px;
    }
    
    .carousel-nav.next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .clients-carousel .carousel-item {
        flex: 0 0 100%;
    }
    
    .carousel-item {
        min-height: 350px;
    }
}

/* Section spacing */
.featured-courses,
.latest-news,
.our-clients {
    padding: 4rem 0;
}

/* Principles section spacing */
.principles {
    padding: 4rem 0;
    margin-bottom: 2rem;
}

/* All section titles uppercase */
.section-title,
.box-title {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Clients section specific styling */
.our-clients .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #2E5C8A;
    margin-bottom: 3rem;
    letter-spacing: 1px;
}

/* Clients Grid Layout */
.clients-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 2rem 0;
    justify-content: center;
    align-items: center;
}

.clients-grid .client-item {
    flex: 0 0 auto;
    width: 250px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    transition: all 0.3s;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.clients-grid .client-item:hover {
    border-color: #2E5C8A;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 92, 138, 0.15);
}

.clients-grid .client-item img {
    max-width: 90%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter 0.3s;
}

.clients-grid .client-item:hover img {
    filter: grayscale(0%);
}

.clients-grid .client-item h4 {
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .clients-grid {
        gap: 15px;
    }
    
    .clients-grid .client-item {
        width: 200px;
        height: 120px;
        padding: 20px;
    }
    
    .clients-grid .client-item img {
        max-height: 70px;
    }
}

@media (max-width: 480px) {
    .clients-grid .client-item {
        width: 180px;
        height: 110px;
        padding: 15px;
    }
    
    .clients-grid .client-item img {
        max-height: 60px;
    }
}

/* Fix for potential conflicts */
.carousel-container .course-card,
.carousel-container .news-card,
.carousel-container .client-item {
    margin: 0 !important;
}

/* Ensure carousel is always visible */
.carousel-container {
    min-height: 450px;
}

/* Hide navigation when not needed */
.carousel-nav:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Clean carousel container */
.carousel-container {
    background: transparent;
}