/**
 * Apple-Style Carousel CSS
 * Premium horizontal scrolling carousel with expandable cards
 */

/* Carousel Container */
.apple-carousel {
    width: 100%;
    padding: 80px 0;
    overflow: hidden;
    position: relative;
}

.apple-carousel-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
}

.apple-carousel-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.apple-carousel-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--medium-gray);
    max-width: 800px;
    line-height: 1.6;
}

/* Carousel Track */
.apple-carousel-track {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.apple-carousel-track::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Carousel Card */
.apple-carousel-card {
    flex: 0 0 400px;
    height: 500px;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    scroll-snap-align: start;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 19, 29, 0.1);
}

.apple-carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.3) 50%,
            rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

.apple-carousel-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 60px rgba(0, 19, 29, 0.2);
}

.apple-carousel-card:hover::before {
    opacity: 0.8;
}

/* Card Image */
.apple-carousel-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-carousel-card:hover .apple-carousel-card-image {
    transform: scale(1.1);
}

/* Card Content */
.apple-carousel-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 2;
    color: white;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-carousel-card-category {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.apple-carousel-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    margin: 0;
}

/* Card Logo (Added) */
.apple-carousel-card-logo {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: auto;
    z-index: 10;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    pointer-events: none;
    transition: all 0.3s ease;
}

.apple-carousel-card:hover .apple-carousel-card-logo {
    transform: scale(1.1);
    opacity: 1;
}

/* Expanded Card */
.apple-carousel-card.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    z-index: 1000;
    flex: none;
    box-shadow: 0 40px 100px rgba(0, 19, 29, 0.4);
}

.apple-carousel-card.expanded::before {
    opacity: 0;
}

.apple-carousel-card.expanded .apple-carousel-card-content {
    transform: translateY(100%);
    opacity: 0;
}

.apple-carousel-card.expanded .apple-carousel-card-logo {
    opacity: 0;
    visibility: hidden;
}

/* Expanded Card Detail View */
.apple-carousel-card-detail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    overflow-y: auto;
    padding: 3rem;
}

.apple-carousel-card.expanded .apple-carousel-card-detail {
    opacity: 1;
    visibility: visible;
}

.apple-carousel-card-detail-content {
    max-width: 900px;
    margin: 0 auto;
}

.apple-carousel-card-detail-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.apple-carousel-card-detail-description {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--medium-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.apple-carousel-card-detail-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0, 19, 29, 0.1);
}

/* Close Button */
.apple-carousel-card-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.apple-carousel-card.expanded .apple-carousel-card-close {
    opacity: 1;
    visibility: visible;
}

.apple-carousel-card-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.apple-carousel-card-close::before,
.apple-carousel-card-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--dark-color);
}

.apple-carousel-card-close::before {
    transform: rotate(45deg);
}

.apple-carousel-card-close::after {
    transform: rotate(-45deg);
}

/* Backdrop Overlay */
.apple-carousel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-carousel-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Navigation Arrows */
.apple-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 19, 29, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.apple-carousel:hover .apple-carousel-nav {
    opacity: 1;
    visibility: visible;
}

.apple-carousel-nav.prev {
    left: 20px;
}

.apple-carousel-nav.next {
    right: 20px;
}

.apple-carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 19, 29, 0.15);
}

.apple-carousel-nav svg {
    width: 24px;
    height: 24px;
    fill: var(--dark-color);
}

/* Waves in Cards */
.apple-carousel-card .wave-container {
    height: 50px;
    z-index: 1;
    pointer-events: none;
    border-radius: 0 0 20px 20px; /* Match card border radius */
}

.apple-carousel-card .wave-svg {
    height: 50px;
}

.apple-carousel-card .wave-path {
    opacity: 0.6;
}

/* Adjust content z-index to be above waves */
.apple-carousel-card-content {
    z-index: 5;
}

/* Ensure logo is on top */
.apple-carousel-card-logo {
    z-index: 20;
}
