/**
 * Yiontech Course Grid Widget Styles
 */

/* Global box-sizing fix for consistent sizing */
.yiontech-course-grid-widget,
.yiontech-course-grid-widget * {
    box-sizing: border-box;
}

.yiontech-course-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.yiontech-course-grid-pagination {
    margin-top: 2rem;
    text-align: center;
}

.yiontech-course-grid-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.3s ease;
}

.yiontech-course-grid-pagination .page-numbers:hover,
.yiontech-course-grid-pagination .page-numbers.current {
    background-color: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
}

.yiontech-has-hover-animation {
    transition: all 0.3s ease;
}

.yiontech-has-hover-animation:hover {
    transform: translateY(-4px);
}

/* Carousel Styles */
.yiontech-carousel-main-wrap {
    position: relative;
    margin-bottom: 2.5rem;
}

.yiontech-carousel-loop-wrap {
    position: relative;
    margin: 0 -0.75rem;
}

.yiontech-carousel-loop-wrap .tutor-courses-loop-wrap {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

/* Fixed width for slides based on column count */
.yiontech-carousel-loop-wrap .tutor-courses-loop-wrap > div {
    flex: 0 0 auto;
    padding: 0 0.75rem;
    width: calc(100% / var(--slides-to-show));
    box-sizing: border-box;
}

/* Specific widths for different column counts */
.yiontech-carousel-loop-wrap[data-columns="1"] .tutor-courses-loop-wrap > div {
    width: 100%;
}

.yiontech-carousel-loop-wrap[data-columns="2"] .tutor-courses-loop-wrap > div {
    width: 50%;
}

.yiontech-carousel-loop-wrap[data-columns="3"] .tutor-courses-loop-wrap > div {
    width: 33.333%;
}

.yiontech-carousel-loop-wrap[data-columns="4"] .tutor-courses-loop-wrap > div {
    width: 25%;
}

.yiontech-carousel-loop-wrap[data-columns="5"] .tutor-courses-loop-wrap > div {
    width: 20%;
}

.yiontech-carousel-loop-wrap[data-columns="6"] .tutor-courses-loop-wrap > div {
    width: 16.666%;
}

/* Center content when there are fewer slides than columns */
.yiontech-carousel-loop-wrap[data-courses-count="1"] .tutor-courses-loop-wrap {
    justify-content: center;
}

.yiontech-carousel-loop-wrap[data-courses-count="2"][data-columns="3"] .tutor-courses-loop-wrap,
.yiontech-carousel-loop-wrap[data-courses-count="2"][data-columns="4"] .tutor-courses-loop-wrap,
.yiontech-carousel-loop-wrap[data-courses-count="2"][data-columns="5"] .tutor-courses-loop-wrap,
.yiontech-carousel-loop-wrap[data-courses-count="2"][data-columns="6"] .tutor-courses-loop-wrap {
    justify-content: center;
}

.yiontech-carousel-loop-wrap[data-courses-count="3"][data-columns="4"] .tutor-courses-loop-wrap,
.yiontech-carousel-loop-wrap[data-courses-count="3"][data-columns="5"] .tutor-courses-loop-wrap,
.yiontech-carousel-loop-wrap[data-courses-count="3"][data-columns="6"] .tutor-courses-loop-wrap {
    justify-content: center;
}

/* Carousel Arrow Styles - Updated with SVG support */
.yiontech-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: #1e40af;
    color: #ffffff;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.yiontech-carousel-arrow:hover {
    background: #1e3a8a;
}

.yiontech-carousel-arrow svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2.5;
}

.yiontech-carousel-arrow.yiontech-carousel-arrow-prev {
    left: 0;
}

.yiontech-carousel-arrow.yiontech-carousel-arrow-next {
    right: 0;
}

.yiontech-carousel-arrow.arrow-square {
    border-radius: 0.25rem;
}

.yiontech-carousel-arrow.arrow-circle {
    border-radius: 50%;
}

.yiontech-carousel-arrow.arrow-rounded {
    border-radius: 0.5rem;
}

.yiontech-carousel-arrow-position-top {
    top: -2rem;
    transform: none;
}

.yiontech-carousel-arrow-position-bottom {
    bottom: -2rem;
    top: auto;
    transform: none;
}

.yiontech-carousel-dots {
    position: absolute;
    bottom: -2.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0;
    list-style: none;
    z-index: 999;
}

.yiontech-carousel-dots-position-top {
    top: -2.5rem;
    bottom: auto;
}

.yiontech-carousel-dots-position-both .yiontech-carousel-dots {
    position: relative;
    top: auto;
    bottom: auto;
    margin: 0.5rem 0;
}

.yiontech-carousel-dots li {
    margin: 0 0.25rem;
}

.yiontech-carousel-dots button {
    background: #d1d5db;
    border: none;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    text-indent: -9999px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yiontech-carousel-dots .slick-active button {
    background: #1e40af;
    transform: scale(1.2);
}

/* Slick Slider Custom Styles */
.yiontech-carousel-loop-wrap .slick-list {
    position: relative;
    margin: 0;
}

.yiontech-carousel-loop-wrap .slick-track {
    display: flex;
    opacity: 1;
}

.yiontech-carousel-loop-wrap .slick-slide {
    height: auto;
    padding: 0 0.75rem;
    box-sizing: border-box;
}

.yiontech-carousel-loop-wrap .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: #1e40af;
    color: #ffffff;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.yiontech-carousel-loop-wrap .slick-arrow:hover {
    background: #1e3a8a;
}

.yiontech-carousel-loop-wrap .slick-prev {
    left: 0;
}

.yiontech-carousel-loop-wrap .slick-next {
    right: 0;
}

.yiontech-carousel-loop-wrap .slick-dots {
    position: absolute;
    bottom: -2.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0;
    list-style: none;
}

.yiontech-carousel-loop-wrap .slick-dots li {
    margin: 0 0.25rem;
}

.yiontech-carousel-loop-wrap .slick-dots button {
    background: #d1d5db;
    border: none;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    text-indent: -9999px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yiontech-carousel-loop-wrap .slick-dots .slick-active button {
    background: #1e40af;
    transform: scale(1.2);
}

/* Fallback for when Slick is not available */
.yiontech-carousel-fallback {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #1e40af #f1f1f1;
}

.yiontech-carousel-fallback .tutor-courses-loop-wrap {
    display: flex;
    flex-wrap: nowrap;
}

.yiontech-carousel-fallback .tutor-courses-loop-wrap > div {
    flex: 0 0 auto;
    scroll-snap-align: start;
    margin-right: 1.25rem;
    width: calc(100% / var(--slides-to-show));
    box-sizing: border-box;
}

.yiontech-carousel-fallback::-webkit-scrollbar {
    height: 0.5rem;
}

.yiontech-carousel-fallback::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.yiontech-carousel-fallback::-webkit-scrollbar-thumb {
    background: #1e40af;
    border-radius: 0.25rem;
}

.yiontech-carousel-fallback::-webkit-scrollbar-thumb:hover {
    background: #1e3a8a;
}

.yiontech-course-card-inner {
    box-sizing: border-box;
    margin: -20px 30px 0px 30px;
    border: 0;
    box-shadow: 0px 34px 28px -20px rgba(0, 0, 0, .15);
}

/* Fix for carousel arrows in editor */
.elementor-editor-active .yiontech-carousel-arrow {
    z-index: 10;
}

.elementor-editor-active .yiontech-carousel-arrow-prev {
    left: 0.625rem;
}

.elementor-editor-active .yiontech-carousel-arrow-next {
    right: 0.625rem;
}

/* Fix for carousel dots in editor */
.elementor-editor-active .yiontech-carousel-dots {
    z-index: 10;
}

/* Modern card design improvements */
.yiontech-course-card {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 100%;
}

.yiontech-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.yiontech-course-card .tutor-course-thumbnail {
    position: relative;
    overflow: hidden;
}

.yiontech-course-card .tutor-course-thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.yiontech-course-card:hover .tutor-course-thumbnail img {
    transform: scale(1.05);
}

.yiontech-course-card .course-title {
    margin: 0 0 0.625rem;
    font-size: 1.125rem;
    line-height: 1.3;
}

.yiontech-course-card .course-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.yiontech-course-card .course-title a:hover {
    color: #1e40af;
}

.yiontech-course-card .course-meta {
    margin: 0 0 0.875rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.yiontech-course-card .course-meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.yiontech-course-card .course-meta-item i {
    margin-right: 0.5rem;
    color: #1e40af;
}

.yiontech-course-card .tutor-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

.yiontech-course-card .course-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
}

.yiontech-course-card .course-price .price {
    color: #1e40af;
}

.yiontech-course-card .course-price .original-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.yiontech-course-card .tutor-enroll-btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background-color: #1e40af;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.yiontech-course-card .tutor-enroll-btn:hover {
    background-color: #1e3a8a;
    color: #ffffff;
}

/* Overlay layout improvements - FIXED */
.yiontech-course-card-overlay {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 0.75rem;
}

.yiontech-course-card-overlay .tutor-course-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.yiontech-course-card-overlay .tutor-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yiontech-course-card-overlay .tutor-loop-course-container {
        border: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0.3) 80%, rgba(0,0,0,0) 100%);
    padding: 2rem 1.5rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0 0 0.75rem 0.75rem;
}

.yiontech-course-card-overlay .tutor-loop-course-container .course-title {
    font-size: 1.25rem;
    margin-bottom: 0.625rem;
}

.yiontech-course-card-overlay .tutor-loop-course-container .course-title a {
    color: #ffffff;
}

.yiontech-course-card-overlay .tutor-loop-course-container .course-meta {
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.yiontech-course-card-overlay .tutor-loop-course-container .course-meta-item i {
    color: #ffffff;
}

.yiontech-course-card-overlay .tutor-loop-course-container .tutor-card-footer {
    background: transparent;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding: 1rem 0 0;
}

.yiontech-course-card-overlay .tutor-loop-course-container .course-price {
    color: #ffffff;
    font-size: 1.25rem;
}

.yiontech-course-card-overlay .tutor-loop-course-container .tutor-enroll-btn {
    background: #ffffff;
    color: #1e40af;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.yiontech-course-card-overlay .tutor-loop-course-container .tutor-enroll-btn:hover {
    background: #f0f0f0;
    color: #1e40af;
}

.yiontech-course-card-overlay .tutor-loop-course-container .tutor-ratings {
    margin-bottom: 0.75rem;
}

.yiontech-course-card-overlay .tutor-loop-course-container .tutor-ratings .tutor-ratings-stars {
    color: #FFD700;
}

.yiontech-course-card-overlay .tutor-loop-course-container .tutor-ratings .tutor-ratings-average,
.yiontech-course-card-overlay .tutor-loop-course-container .tutor-ratings .tutor-ratings-count {
    color: rgba(255,255,255,0.9);
}

/* Force equal height for all carousel items */
.yiontech-coursel-overlayed .tutor-courses-loop-wrap > div {
    height: 400px !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .yiontech-course-grid-cols-4,
    .yiontech-course-grid-cols-5,
    .yiontech-course-grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Adjust height for overlay carousel on medium screens */
    .yiontech-coursel-overlayed .tutor-courses-loop-wrap > div {
        height: 350px !important;
    }
    
    .yiontech-course-card-overlay {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .yiontech-course-grid-cols-3,
    .yiontech-course-grid-cols-4,
    .yiontech-course-grid-cols-5,
    .yiontech-course-grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Adjust height for overlay carousel on small screens */
    .yiontech-coursel-overlayed .tutor-courses-loop-wrap > div {
        height: 300px !important;
    }
    
    .yiontech-course-card-overlay {
        height: 300px;
    }
    
    .yiontech-course-card-overlay .tutor-loop-course-container {
        padding: 1.5rem 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .yiontech-course-grid-cols-2,
    .yiontech-course-grid-cols-3,
    .yiontech-course-grid-cols-4,
    .yiontech-course-grid-cols-5,
    .yiontech-course-grid-cols-6 {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yiontech-carousel-arrow {
        width: 2rem;
        height: 2rem;
    }
    
    .yiontech-carousel-arrow.yiontech-carousel-arrow-prev {
        left: 0.25rem;
    }
    
    .yiontech-carousel-arrow.yiontech-carousel-arrow-next {
        right: 0.25rem;
    }
    
    /* Adjust height for overlay carousel on mobile */
    .yiontech-coursel-overlayed .tutor-courses-loop-wrap > div {
        height: 250px !important;
    }
    
    .yiontech-course-card-overlay {
        height: 250px;
    }
    
    .yiontech-course-card-overlay .tutor-loop-course-container {
        padding: 1rem;
    }
    
    .yiontech-course-card-overlay .tutor-loop-course-container .course-title {
        font-size: 1rem;
    }
}

.shadow-md{
    --tw-shadow: none;
}