/* ====== SEO & HEADER STYLING ====== */
.tutor-slider-container {
    padding: 50px 0 70px;
    background-color: #fafbfc;
    overflow: hidden; /* Prevent horizontal scrollbar from slider negative margin */
}

.tutor-slider-header {
    text-align: center;
    margin-bottom: 45px;
    padding: 0 20px;
}

.tutor-slider-title {
    font-size: 2.6rem;
    font-weight: 800;
    color: #163496;
    margin: 0 0 12px 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.tutor-slider-desc {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ====== SLIDER WRAPPER & SLICK FIXES ====== */
.tutor-slider-wrapper {
    max-width: 1200px;
    margin: auto;
    padding: 15px 0; /* Vertical room for card scale/lift animation */
    overflow: visible;
}

.tutor-slider .slick-list {
    overflow: visible !important; /* Prevents card slide-up and shadows from clipping */
    margin: 0 -15px; /* Negative margin to compensate slide spacing */
}

.tutor-slider .slick-slide {
    margin: 0 15px; /* Slide spacing */
    height: auto; /* Allow auto height for flex alignment */
    outline: none !important;
}

.tutor-slider .slick-track {
    display: flex !important;
    align-items: stretch; /* Make all cards in the same row equal height */
}

/* ====== PREMIUM TUTOR CARD ====== */
.htn-tutor-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    height: 100%;
}

.htn-tutor-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    box-sizing: border-box;
    will-change: transform; /* Hardware acceleration for buttery smooth performance */
}

.htn-tutor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-color: rgba(22, 52, 150, 0.3);
}

/* 1. Large Top Image Container (Main Entity) */
.htn-tutor-image-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 24px auto 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f8fafc;
    border: 4px solid #eff3fa;
    box-shadow: 0 4px 15px rgba(22, 52, 150, 0.08);
    flex-shrink: 0;
}

.htn-tutor-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.htn-tutor-card:hover .htn-tutor-img {
    transform: scale(1.06);
}

/* 2. Card Info Body */
.htn-tutor-info {
    padding: 16px 20px 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.htn-tutor-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 3. Small Chip Style UI (Side-by-Side) */
.htn-tutor-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
    width: 100%;
}

.htn-tutor-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.725rem;
    font-weight: 600;
    color: #163496;
    background: #eff3fa;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #d5e0f2;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.htn-tutor-chip:hover {
    background: #163496;
    color: #eff3fa; /* Swaps background and text colors */
    border-color: #163496;
}

.htn-tutor-chip-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    vertical-align: middle;
    transition: color 0.2s ease;
}

/* Default icon colors inside chips */
.qualification .htn-tutor-chip-icon {
    color: inherit; /* Inherits the chip's default #4f46e5 */
}

.experience .htn-tutor-chip-icon {
    color: #64748b; /* Slate color when not hovered */
}

/* Hover icon colors inside chips */
.htn-tutor-chip:hover .htn-tutor-chip-icon {
    color: inherit; /* Inherits the hover state #ffffff */
}

/* 4. Elegant Footer Button (Pill style matching previous chip hover colors) */
.htn-tutor-footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: #eff3fa; /* light blue background */
    color: #163496; /* deep blue text */
    font-weight: 700;
    font-size: 0.825rem;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
    margin-top: auto;
}

.htn-tutor-link-icon {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    color: inherit;
    transition: transform 0.3s ease;
}

.htn-tutor-footer-link:hover {
    background: #163496; /* Solid brand color on hover */
    color: #ffffff; /* White text on hover */
    box-shadow: 0 4px 12px rgba(22, 52, 150, 0.25);
}

.htn-tutor-footer-link:hover .htn-tutor-link-icon {
    transform: translateX(3px);
}

/* ====== MOBILE & TABLET RESPONSIVE OPTIMIZATIONS ====== */

@media (max-width: 1024px) {
    .tutor-slider-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .tutor-slider-container {
        padding: 30px 0 45px;
    }
    .tutor-slider-header {
        margin-bottom: 25px;
    }
    .tutor-slider-title {
        font-size: 1.85rem;
    }
    .tutor-slider-desc {
        font-size: 0.95rem;
    }
    .tutor-slider .slick-list {
        margin: 0 -8px;
    }
    .tutor-slider .slick-slide {
        margin: 0 8px;
    }
    .htn-tutor-card {
        min-height: 280px;
        border-radius: 16px;
    }
    .htn-tutor-image-wrap {
        width: 130px;
        height: 130px;
        margin: 20px auto 0;
        border-radius: 50%;
    }
    .htn-tutor-info {
        padding: 10px 10px 10px;
    }
    .htn-tutor-name {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    .htn-tutor-chips {
        gap: 4px;
        margin-bottom: 10px;
    }
    .htn-tutor-chip {
        font-size: 0.65rem;
        padding: 3px 8px;
        gap: 4px;
        border-radius: 15px;
    }
    .htn-tutor-chip-icon {
        width: 10px;
        height: 10px;
    }
    .htn-tutor-footer-link {
        font-size: 0.75rem;
        padding: 8px 12px;
        border-radius: 8px;
    }
    .htn-tutor-link-icon {
        width: 7px;
        height: 7px;
    }
}

@media (max-width: 480px) {
    .tutor-slider .slick-list {
        margin: 0 -6px;
    }
    .tutor-slider .slick-slide {
        margin: 0 6px;
    }
    .htn-tutor-card {
        min-height: 240px;
        border-radius: 14px;
    }
    .htn-tutor-image-wrap {
        width: 110px;
        height: 110px;
        margin: 16px auto 0;
        border-radius: 50%;
    }
    .htn-tutor-info {
        padding: 8px 8px 8px;
    }
    .htn-tutor-name {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    .htn-tutor-chips {
        gap: 3px;
        margin-bottom: 8px;
    }
    .htn-tutor-chip {
        font-size: 0.625rem;
        padding: 2px 6px;
        gap: 3px;
        border-radius: 12px;
    }
    .htn-tutor-chip-icon {
        width: 9px;
        height: 9px;
    }
    .htn-tutor-footer-link {
        font-size: 0.7rem;
        padding: 7px 10px;
        border-radius: 6px;
    }
    .htn-tutor-link-icon {
        width: 6px;
        height: 6px;
    }
}

/* ====== PRE-INITIALIZATION CAROUSEL FOUC FIX ====== */
.tutor-slider:not(.slick-initialized) {
    display: flex !important;
    overflow: hidden;
    gap: 30px; /* Matches the 15px slide margins on both sides */
    padding: 15px 0;
}

/* Hide raw uninitialized layout to prevent FOUC/stacking when Slick fails to initialize quickly */
.tutor-slider {
    opacity: 0;
    transition: opacity 220ms ease-in-out;
}
.tutor-slider.slick-initialized {
    opacity: 1;
}

.tutor-slider:not(.slick-initialized) .tutor-slide {
    flex: 0 0 calc(25% - 22.5px); /* 4 slides on desktop */
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .tutor-slider:not(.slick-initialized) .tutor-slide {
        flex: 0 0 calc(33.333% - 20px); /* 3 slides on small desktop/tablet */
    }
}

@media (max-width: 768px) {
    .tutor-slider:not(.slick-initialized) {
        gap: 16px; /* Matches 8px slide margins */
    }
    .tutor-slider:not(.slick-initialized) .tutor-slide {
        flex: 0 0 calc(50% - 8px); /* 2 slides on tablet/mobile */
    }
}

@media (max-width: 480px) {
    .tutor-slider:not(.slick-initialized) {
        gap: 12px; /* Matches 6px slide margins */
    }
    .tutor-slider:not(.slick-initialized) .tutor-slide {
        flex: 0 0 calc(50% - 6px); /* 2 slides on small mobile devices */
    }
}
