/* TechnoMind Academy Carousels Styles (Updated) */

.technomind-carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 40px auto;
    padding: 20px 0;
    overflow: hidden; /* Prevent horizontal scrollbar on body */
}

/* Full width slider hack to break out of container */
.tm-full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Base Swiper Adjustments */
.tm-full-width .swiper {
    padding: 20px; /* Space for shadows */
    box-sizing: border-box;
}

/* Style 1: The iSchoolTech Perfect Match */
.tm-style-1 .swiper-slide {
    width: 280px; /* Fixed width for uniform cards */
    height: auto;
    display: flex;
}

.tm-style-1 .tm-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid #eaeaea;
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.tm-style-1 .tm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.tm-style-1 .tm-card-image-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f9f9f9;
}

.tm-style-1 .tm-card-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Bottom info panel */
.tm-style-1 .tm-card-info {
    background-color: #7dcec8; /* User requested teal color */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eef2f6;
    flex-grow: 1;
}

/* Text Container */
.tm-style-1 .tm-card-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: start;
}

.tm-style-1 .tm-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a73e8; /* Bright Blue */
    margin: 0 0 5px 0;
    line-height: 1.2;
    font-family: inherit;
}

.tm-style-1 .tm-card-subtitle {
    font-size: 13px;
    color: #888;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tm-style-1 .tm-flag-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

/* Orange Play Button */
.tm-style-1 .tm-play-btn {
    width: 40px;
    height: 40px;
    background-color: #ff7f00; /* Vibrant Orange */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(255, 127, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s;
    flex-shrink: 0;
}

.tm-style-1 .tm-play-btn:hover {
    transform: scale(1.1);
    background-color: #e67300;
}

.tm-style-1 .tm-play-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    margin-left: 3px; /* visual center for play triangle */
}

/* Hide Swiper Pagination */
.tm-style-1 .swiper-pagination {
    display: none;
}

/* Video Modal Styles */
.tm-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tm-video-modal.tm-modal-active {
    opacity: 1;
    visibility: visible;
}

.tm-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 10px; /* Optional padding for aesthetics */
}

.tm-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: transparent;
    border: none;
    line-height: 1;
    transition: color 0.2s;
}

.tm-modal-close:hover {
    color: #ff7f00;
}

.tm-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.tm-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ------------------------------------- */
/* Style 2: White cards, italic blue text, no buttons */
/* ------------------------------------- */
.tm-style-2 .swiper-slide {
    width: 280px; /* Same fixed width as style 1 */
    height: auto;
    display: flex;
}

.tm-style-2 .tm-card-s2 {
    background: var(--tm-card-bg, #ffffff);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid #f0f0f0;
}

.tm-style-2 .tm-card-s2:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.tm-style-2 .tm-card-s2-image-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f9f9f9;
}

.tm-style-2 .tm-card-s2-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.tm-style-2 .tm-card-s2-info {
    background-color: var(--tm-info-bar-color, #7dcec8);
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: start;
}

.tm-style-2 .tm-card-s2-title {
    font-size: 18px;
    font-weight: 500;
    font-style: italic;
    color: var(--tm-title-color, #1a73e8);
    margin: 0 0 10px 0;
    line-height: 1.3;
    font-family: inherit;
}

.tm-style-2 .tm-card-s2-subtitle {
    font-size: 14px;
    font-style: italic;
    color: var(--tm-subtitle-color, #555555);
    margin: 0;
    line-height: 1.5;
}

/* Hide Swiper Pagination */
.tm-style-2 .swiper-pagination {
    display: none;
}

/* ------------------------------------- */
/* Style 3: Video Carousel               */
/* ------------------------------------- */
.tm-style-3 .swiper-slide {
    width: 280px;
    height: auto;
    display: flex;
}
.tm-style-3 .tm-card-v {
    background: var(--tm-card-bg, #ffffff);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid #eaeaea;
}
.tm-style-3 .tm-card-v:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}
.tm-style-3 .tm-card-v-media {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
}
.tm-style-3 .tm-yt-inline {
    width: 100%;
    height: auto;
    aspect-ratio: 9/16;
    display: block;
    pointer-events: none;
    border: none;
}
.tm-style-3 .tm-video-inline {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}
.tm-style-3 .tm-card-v-poster {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}
/* Video overlay with play button */
.tm-video-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    transition: background 0.3s ease;
    cursor: pointer;
    z-index: 2;
}
.tm-video-overlay:hover {
    background: rgba(0,0,0,0.35);
}
.tm-video-play-icon {
    width: 44px;
    height: 44px;
    background: var(--tm-play-btn-color, #ff7f00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255,127,0,0.3);
}
.tm-video-overlay:hover .tm-video-play-icon {
    transform: scale(1.1);
    filter: brightness(0.9);
}
.tm-video-play-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    margin-left: 3px;
}
/* Video info bar — matches Style 1 exactly */
.tm-style-3 .tm-card-v-info {
    padding: 15px 20px;
    background-color: var(--tm-info-bar-color, #7dcec8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tm-style-3 .tm-card-v-text {
    flex: 1;
    min-width: 0;
}
.tm-style-3 .tm-card-v-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--tm-title-color, #1a73e8);
    margin: 0 0 4px 0;
    line-height: 1.2;
}
.tm-style-3 .tm-card-v-subtitle {
    font-size: 13px;
    color: var(--tm-subtitle-color, #888);
    margin: 0;
}
/* Play button in info bar — same as Style 1 */
.tm-video-play-btn {
    width: 40px;
    height: 40px;
    background-color: var(--tm-play-btn-color, #ff7f00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: filter 0.2s, transform 0.2s;
    cursor: pointer;
}
.tm-video-play-btn:hover {
    filter: brightness(0.9);
    transform: scale(1.08);
}
.tm-video-play-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    margin-left: 2px;
}

/* Video Modal (Enhanced) */
.tm-video-modal-v2 {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.tm-video-modal-v2.tm-modal-active {
    opacity: 1;
    visibility: visible;
}
.tm-modal-v2-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.tm-video-modal-v2.tm-modal-active .tm-modal-v2-content {
    transform: scale(1);
}
.tm-modal-v2-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(8px);
}
.tm-modal-v2-close:hover {
    background: rgba(255,255,255,0.3);
}
.tm-modal-v2-video {
    width: 100%;
    aspect-ratio: 9/16;
}
.tm-modal-v2-video iframe,
.tm-modal-v2-video video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
/* Landscape modal aspect */
.tm-modal-v2-video.tm-modal-landscape {
    aspect-ratio: 4/3;
}

/* Landscape aspect for Style 3 */
.technomind-carousel-wrapper[data-aspect="landscape"].tm-style-3 .tm-yt-inline {
    aspect-ratio: 4/3;
}
.technomind-carousel-wrapper[data-aspect="landscape"].tm-style-3 .swiper-slide {
    width: 340px;
}

/* ------------------------------------- */
/* Global Navigation Arrows Styling      */
/* ------------------------------------- */
.technomind-carousel-wrapper .swiper-button-next,
.technomind-carousel-wrapper .swiper-button-prev {
    background-color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: #1a73e8; /* Bright Blue */
    transition: transform 0.2s, background-color 0.2s;
}

.technomind-carousel-wrapper .swiper-button-next:hover,
.technomind-carousel-wrapper .swiper-button-prev:hover {
    transform: scale(1.1);
    color: #0d47a1;
}

.technomind-carousel-wrapper .swiper-button-next::after,
.technomind-carousel-wrapper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

/* Inward spacing from screen edges */
.technomind-carousel-wrapper .swiper-button-next { right: 20px; }
.technomind-carousel-wrapper .swiper-button-prev { left: 20px; }

/* ------------------------------------- */
/* Landscape Aspect Ratio (4:3 images)   */
/* ------------------------------------- */
.technomind-carousel-wrapper[data-aspect="landscape"] .swiper-slide {
    width: 340px;
}

.technomind-carousel-wrapper[data-aspect="landscape"] .tm-card-image-wrap,
.technomind-carousel-wrapper[data-aspect="landscape"] .tm-card-s2-image-wrap {
    width: 100%;
    background: #f9f9f9;
}

.technomind-carousel-wrapper[data-aspect="landscape"] .tm-card-image,
.technomind-carousel-wrapper[data-aspect="landscape"] .tm-card-s2-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ------------------------------------- */
/* Loading Spinner for Video Modals       */
/* ------------------------------------- */
.tm-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 5;
}
.tm-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tmSpin 0.8s linear infinite;
}
.tm-modal-v2-video {
    position: relative;
}
@keyframes tmSpin {
    to { transform: rotate(360deg); }
}

/* ------------------------------------- */
/* Shorts Modal — Portrait (9:16)         */
/* ------------------------------------- */
.tm-content-short {
    max-width: 380px !important;
}
.tm-video-short {
    padding-bottom: 177.78% !important;
}
.tm-modal-v2-content.tm-modal-short {
    max-width: 380px;
}
.tm-modal-short .tm-modal-v2-video {
    aspect-ratio: 9/16;
}
