.discover-section {
    padding: 6rem 0;
    text-align: center;
    background: #ffffff;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

.discover-header h2 {
    font-size: 3rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.discover-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 4rem;
}

.discover-tabs button {
    background: #fff;
    border: 1px solid #eee;
    color: #555;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discover-tabs button.active {
    background: #6366f1; /* similar to the purple button in the image */
    color: #fff;
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.discover-tabs button:hover:not(.active) {
    background: #f9f9f9;
}

.discover-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    height: 500px;
    perspective: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-container {
    position: relative;
    width: 320px;
    height: 480px;
    transform-style: preserve-3d;
}

.carousel-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    -webkit-user-drag: none;
}

/* Base styles for card content */
.carousel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.6s;
}

.card-top-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.6s;
}

.card-rating {
    background: rgba(255, 193, 7, 0.8);
    color: #000;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

.card-type {
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.card-content {
    position: absolute;
    bottom: 1.5rem;
    left: 1rem;
    right: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s;
}

.card-content h3 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
}

.card-content p {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    margin: 0;
}

/* Grayscale for non-active cards */
.carousel-card {
    filter: grayscale(100%);
}

/* Active card styles */
.carousel-card.active {
    z-index: 10;
    transform: translateX(0) scale(1) translateZ(0);
    filter: grayscale(0%);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.carousel-card.active::before,
.carousel-card.active .card-top-info,
.carousel-card.active .card-content {
    opacity: 1;
}
.carousel-card.active .card-content {
    transform: translateY(0);
}

/* Left prev 1 */
.carousel-card.prev-1 {
    z-index: 9;
    transform: translateX(-140px) scale(0.9) rotate(-8deg) translateZ(-50px);
}
/* Right next 1 */
.carousel-card.next-1 {
    z-index: 9;
    transform: translateX(140px) scale(0.9) rotate(8deg) translateZ(-50px);
}

/* Left prev 2 */
.carousel-card.prev-2 {
    z-index: 8;
    transform: translateX(-260px) scale(0.8) rotate(-16deg) translateZ(-100px);
}
/* Right next 2 */
.carousel-card.next-2 {
    z-index: 8;
    transform: translateX(260px) scale(0.8) rotate(16deg) translateZ(-100px);
}

/* Left prev 3 */
.carousel-card.prev-3 {
    z-index: 7;
    transform: translateX(-360px) scale(0.7) rotate(-24deg) translateZ(-150px);
    opacity: 0.5;
}
/* Right next 3 */
.carousel-card.next-3 {
    z-index: 7;
    transform: translateX(360px) scale(0.7) rotate(24deg) translateZ(-150px);
    opacity: 0.5;
}

/* Hidden cards */
.carousel-card.hidden {
    opacity: 0;
    z-index: 1;
    transform: scale(0.5) translateZ(-200px);
    pointer-events: none;
}

@media (max-width: 768px) {
    .discover-header h2 { font-size: 2rem; }
    .carousel-container { width: 260px; height: 390px; }
    
    .carousel-card.prev-1 { transform: translateX(-100px) scale(0.9) rotate(-6deg); }
    .carousel-card.next-1 { transform: translateX(100px) scale(0.9) rotate(6deg); }
    
    .carousel-card.prev-2 { transform: translateX(-180px) scale(0.8) rotate(-12deg); }
    .carousel-card.next-2 { transform: translateX(180px) scale(0.8) rotate(12deg); }
    
    .carousel-card.prev-3, .carousel-card.next-3 { opacity: 0; pointer-events: none; }
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}
.carousel-nav-btn:hover { background: #f0f0f0; transform: translateY(-50%) scale(1.05); }

.carousel-nav-btn.prev { left: 2rem; }
.carousel-nav-btn.next { right: 2rem; }

.carousel-card video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    z-index: 0;
    pointer-events: none; /* Let the card handle clicks to active it */
}

.carousel-card.active video {
    pointer-events: auto; /* Let active video be clickable for controls */
}

.carousel-card::before {
    z-index: 1;
}

.card-top-info {
    z-index: 2;
}

.card-content {
    z-index: 2;
}
