/**
 * Polaroid Tabs - Simplified for GSAP Carousel
 */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --epw-tabs-spacing: 2rem;
    --epw-tabs-border-radius: 4px;
    --epw-tabs-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.epw-tabs-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--epw-tabs-spacing);
    background: transparent;
}

/* ========================================
   GRID LAYOUT - DESKTOP
   ======================================== */
.epw-tabs-wrapper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    min-height: 500px;
}

/* ========================================
   LATERAL COLUMNS (TAB BUTTONS)
   ======================================== */
.epw-tabs-left,
.epw-tabs-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.epw-tab-button {
    background: #ffffff;
    border: none;
    border-radius: var(--epw-tabs-border-radius);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: var(--epw-tabs-transition);
    box-shadow: none;
    position: relative;
    z-index: 10;
    white-space: normal;
    word-wrap: break-word;
}

/* LEFT COLUMN TABS */
.epw-tabs-left .epw-tab-button {
    text-align: left;
}

/* RIGHT COLUMN TABS */
.epw-tabs-right .epw-tab-button {
    text-align: right;
}

.epw-tab-button:hover {
    background: #f5f9ff;
    transform: translateX(4px);
}

.epw-tabs-right .epw-tab-button:hover {
    transform: translateX(-4px);
}

.epw-tab-button[aria-selected="true"] {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #ffffff;
}

.epw-tab-button:focus {
    outline: none;
}

/* ========================================
   CENTRAL STAGE - CAROUSEL CONTAINER
   ======================================== */
.epw-tabs-stage {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Tab content wrapper */
.epw-tab-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   POLAROID CAROUSEL (like CodePen demo)
   ======================================== */
.epw-polaroid-stack {
    position: relative;
    width: 16rem;
    height: 21rem;
    max-width: 100%;
    margin: 0 auto;
}

.epw-polaroid {
    list-style: none;
    padding: 16px;
    padding-bottom: 40px;
    margin: 0;
    width: 100%;
    height: auto;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    background: #ffffff;
    border-radius: 0.8rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.epw-polaroid img {
    width: 100%;
    height: auto;
    max-height: none;
    opacity: 1;
    display: block;
    margin: 0 auto;
    border-radius: 0.4rem;
    object-fit: cover;
}

.epw-polaroid:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ========================================
   CTA BUTTON
   ======================================== */
.epw-polaroid-cta {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
    transform: rotate(8deg);
    transition: var(--epw-tabs-transition);
    z-index: 5;
    white-space: nowrap;
}

.epw-polaroid-cta:hover {
    transform: rotate(0deg) scale(1.1);
}

/* ========================================
   CTA POSITION VARIANTS
   ======================================== */

/* Top Left */
.cta-position-top-left .epw-polaroid-cta {
    top: -10px;
    left: -10px;
    bottom: auto;
    right: auto;
    transform: rotate(-8deg);
}
.cta-position-top-left .epw-polaroid-cta:hover {
    transform: rotate(0deg) scale(1.1);
}

/* Top Center */
.cta-position-top-center .epw-polaroid-cta {
    top: -10px;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translateX(-50%) rotate(-4deg);
}
.cta-position-top-center .epw-polaroid-cta:hover {
    transform: translateX(-50%) rotate(0deg) scale(1.1);
}

/* Top Right */
.cta-position-top-right .epw-polaroid-cta {
    top: -10px;
    right: -10px;
    bottom: auto;
    left: auto;
    transform: rotate(8deg);
}
.cta-position-top-right .epw-polaroid-cta:hover {
    transform: rotate(0deg) scale(1.1);
}

/* Center Left */
.cta-position-center-left .epw-polaroid-cta {
    top: 50%;
    left: -10px;
    bottom: auto;
    right: auto;
    transform: translateY(-50%) rotate(-6deg);
}
.cta-position-center-left .epw-polaroid-cta:hover {
    transform: translateY(-50%) rotate(0deg) scale(1.1);
}

/* Center Center */
.cta-position-center-center .epw-polaroid-cta {
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%, -50%);
}
.cta-position-center-center .epw-polaroid-cta:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Center Right */
.cta-position-center-right .epw-polaroid-cta {
    top: 50%;
    right: -10px;
    bottom: auto;
    left: auto;
    transform: translateY(-50%) rotate(6deg);
}
.cta-position-center-right .epw-polaroid-cta:hover {
    transform: translateY(-50%) rotate(0deg) scale(1.1);
}

/* Bottom Left */
.cta-position-bottom-left .epw-polaroid-cta {
    bottom: -10px;
    left: -10px;
    top: auto;
    right: auto;
    transform: rotate(-8deg);
}
.cta-position-bottom-left .epw-polaroid-cta:hover {
    transform: rotate(0deg) scale(1.1);
}

/* Bottom Center */
.cta-position-bottom-center .epw-polaroid-cta {
    bottom: -10px;
    left: 50%;
    top: auto;
    right: auto;
    transform: translateX(-50%) rotate(4deg);
}
.cta-position-bottom-center .epw-polaroid-cta:hover {
    transform: translateX(-50%) rotate(0deg) scale(1.1);
}

/* Bottom Right (default - matches base .epw-polaroid-cta) */
.cta-position-bottom-right .epw-polaroid-cta {
    bottom: -10px;
    right: -10px;
    top: auto;
    left: auto;
}

/* ========================================
   VIGNETTE OVERLAY
   ======================================== */
.epw-tabs-stage.has-overlay {
    position: relative;
}

.epw-tabs-stage.has-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
    z-index: 4;
    border-radius: inherit;
}

/* ========================================
   RESPONSIVE - TABLET/MOBILE
   ======================================== */

/* Small laptops (1081px - 1280px) - Container ~1100px */
@media (max-width: 1280px) and (min-width: 1081px) {
    .epw-polaroid-stack {
        width: 14rem;
        height: 18rem;
    }

    .epw-polaroid img {
        max-height: 15.5rem;
    }
}

/* iPad and larger tablets (768px - 1080px) */
@media (max-width: 1080px) and (min-width: 768px) {
    .epw-tabs-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .epw-tabs-left,
    .epw-tabs-right {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }

    .epw-tab-button {
        flex: 0 1 auto;
        text-align: center !important;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        min-width: fit-content;
    }

    .epw-tab-button:hover,
    .epw-tabs-right .epw-tab-button:hover {
        transform: translateY(-2px);
    }

    .epw-tabs-stage {
        min-height: 500px;
    }

    /* Carousel for iPad - Container ~800px */
    .epw-polaroid-stack {
        width: 12rem;
        height: 15.5rem;
    }

    .epw-polaroid img {
        max-height: 13rem;
    }
}

/* Small tablets and large phones (640px - 767px) */
@media (max-width: 767px) and (min-width: 640px) {
    .epw-tabs-container {
        padding: 1rem;
    }

    .epw-tabs-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .epw-tabs-left,
    .epw-tabs-right {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }

    .epw-tab-button {
        flex: 0 1 auto;
        text-align: center !important;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .epw-tabs-stage {
        min-height: 400px;
    }

    .epw-polaroid-stack {
        width: 11rem;
        height: 14rem;
    }

    .epw-polaroid img {
        max-height: 11.5rem;
    }
}

/* Mobile phones (< 640px) */
@media (max-width: 640px) {
    .epw-tabs-container {
        padding: 1rem 0.5rem;
    }

    /* Vertical layout: tabs on top, content below */
    .epw-tabs-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1rem;
    }

    .epw-tabs-left,
    .epw-tabs-right {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }

    .epw-tab-button {
        flex: 0 1 auto;
        text-align: center !important;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-width: fit-content;
    }

    .epw-tab-button:hover,
    .epw-tabs-right .epw-tab-button:hover {
        transform: translateY(-2px);
    }

    .epw-tabs-stage {
        min-height: 450px;
        order: 3;
    }

    .epw-tabs-left {
        order: 1;
    }

    .epw-tabs-right {
        order: 2;
    }

    .epw-polaroid-stack {
        width: 80%;
        max-width: 16rem;
        height: 21rem;
    }

    .epw-polaroid img {
        max-height: none;
    }

    .epw-polaroid-cta {
        font-size: 0.75rem;
        padding: 0.5rem 0.9rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.epw-tab-button:focus-visible {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .epw-tab-button,
    .epw-polaroid,
    .epw-polaroid-cta {
        transition: none;
    }
}
