/* 
======================
MEET THE CAST STYLES
======================
*/

/* Hero section customization */
.hero.parallax-section {
    background-color: var(--background-dark);
}

.tip {
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: rgba(127, 14, 189, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(127, 14, 189, 0.3);
}

.tip i {
    color: var(--primary-purple);
    margin-right: 0.5rem;
}

/* Cast Grid Layout */
.cast-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin: var(--spacing-md) 0;
}

.cast-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid rgba(11, 42, 169, 0.1);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.cast-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue-light);
}

.card-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    overflow: hidden; /* Add this default */
}

.card-flip-container {
    flex: 0 0 300px;
    height: 400px;
    margin: auto;
    perspective: 1000px;
}

.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0;
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

.flip {
    transform: rotateY(180deg);
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cast-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    object-position: center; /* Changed from 'center top' to center vertically as well */
    transition: transform 0.3s ease;
}

.card-flipper:hover .cast-image {
    transform: scale(.9);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    border-radius: 50%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-flipper:hover .image-overlay {
    opacity: 1;
}

.cast-info {
    flex: 1;
    padding: var(--spacing-md);
}

.cast-info h3 {
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
    font-size: 1.8rem;
}

.cast-info h4 {
    color: var(--primary-purple);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    font-size: 1.3rem;
}

.character-name {
    font-style: italic;
    opacity: 0.8;
}

.bio {
    margin-bottom: var(--spacing-sm);
}

.quick-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.fact {
    padding: var(--spacing-sm);
    background-color: var(--divine-light-white);
    border-radius: var(--border-radius);
    border: 1px solid rgba(251, 251, 215, 0.8);
}

.fact h5 {
    color: var(--primary-blue-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.fact h5 i {
    margin-right: 0.5rem;
    color: var(--primary-purple);
}

.fact p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* CTA Section */
.crimson-court-cta {
    text-align: center;
    margin: var(--spacing-lg) 0 var(--spacing-md);
    padding: var(--spacing-md);
    background-color: rgba(195, 10, 61, 0.05);
    border-radius: var(--border-radius);
    border: 2px solid rgba(195, 10, 61, 0.1);
}

.crimson-court-cta h3 {
    color: var(--primary-red);
    margin-bottom: var(--spacing-sm);
}

/* Video Carousel Styles */
.crimson-court-carousel {
    position: relative;
    overflow: hidden;
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.crimson-court-carousel .section-background {
    opacity: 0.15;
}

.video-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: var(--spacing-sm) 0;
}

.video-carousel {
    display: flex;
    transition: transform 0.5s ease;
    gap: 16px; /* Fixed gap between items */
    padding: var(--spacing-sm) 0;
}

/* When carousel has the carousel-layout class, apply these styles */
.carousel-layout {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: visible; /* Changed from auto to visible */
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none;     /* Hide scrollbar for Firefox */
    gap: 16px; /* Fixed gap between items */
    padding: var(--spacing-sm) 0;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.carousel-layout::-webkit-scrollbar {
    display: none;
}

/* Style standard video-card elements when in carousel */
.carousel-layout .video-card {
    flex: 0 0 300px; /* Fixed width */
    max-width: 300px;
    margin: 0; /* Remove margins, using gap instead */
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.carousel-layout .video-card:hover {
    transform: scale(1) translateY(-10px);
    z-index: 2;
}

.carousel-item {
    flex: 0 0 300px; /* Fixed width */
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    transform: scale(0.95);
    background-color: white;
    border: 2px solid rgba(195, 10, 61, 0.1);
    margin: 0; /* Remove margins, using gap instead */
}

.carousel-item:hover {
    transform: scale(1) translateY(-10px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(195, 10, 61, 0.3);
    border-color: rgba(195, 10, 61, 0.5);
    z-index: 2;
}

.carousel-controls {
    display: none; /* Hidden by default, shown when videos are loaded */
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
    padding: 0 var(--spacing-sm);
}

.carousel-control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.carousel-control:hover {
    background-color: var(--primary-red);
    transform: scale(1.1);
}

.carousel-control:focus {
    outline: none;
}

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

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: var(--spacing-md);
}

/* Loading State for Carousel */
.video-carousel .loading-spinner {
    width: 100%;
    padding: var(--spacing-md) 0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .card-content {
        flex-direction: column;
    }
    
    .card-flip-container {
        flex: 0 0 auto;
        width: 100%;
        height: 500px;
    }
    
    .quick-facts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .card-flip-container {
        height: 400px;
    }
    
    .cast-info {
        padding: var(--spacing-sm);
    }
    
    .fact {
        padding: var(--spacing-xs);
    }
}

@media (max-width: 576px) {
    .card-flip-container {
        height: 350px;
    }
}

/* Add this new media query for very small devices */
@media (max-width: 400px) {
    .card-flip-container {
        height: 300px;
    }
    
    .card-content {
        overflow: visible; /* This now properly overrides the default */
    }
    
    .cast-card {
        max-width: 100%;
        overflow: hidden;
    }
    
    .card-front, .card-back {
        max-width: 100%;
    }
    
    .cast-image {
        max-width: 100%;
        height: auto;
    }
    
    .cast-info h3 {
        font-size: 1.4rem;
    }
    
    .cast-info h4 {
        font-size: 1.1rem;
    }
}