/**
 * Elegant 3D Showcase - Frontend Styles
 * Glass Flip Gallery - Image rotates from portrait to landscape
 */

/* Gallery Container */
.e3ds-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 400px;
}

/* Panel - changes size with image rotation */
.e3ds-panel {
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
}

/* 3D Card container */
.e3ds-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: center center;
    background: transparent;
}

/* Front face - the image container */
.e3ds-front {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    overflow: hidden;
    background: transparent;
    /* 3D panel depth shadow */
    box-shadow: 
        8px 0 25px -5px rgba(0,0,0,0.4),
        2px 0 8px -2px rgba(0,0,0,0.3);
}

/* IMAGE: Rotates from portrait (-90deg) to landscape (0deg) */
.e3ds-front img {
    position: absolute;
    top: 50%;
    left: 50%;
    object-fit: cover;
    display: block;
    /* Default collapsed state set via inline styles */
}

/* 3D Edges */
.e3ds-edge {
    position: absolute;
}

.e3ds-edge-left {
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.5) 0%,
        rgba(20,20,20,0.8) 50%,
        rgba(40,40,40,0.9) 100%
    );
    transform: translateX(-100%) rotateY(-90deg);
    transform-origin: right center;
}

.e3ds-edge-right {
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to left, 
        rgba(0,0,0,0.3) 0%,
        rgba(30,30,30,0.6) 100%
    );
    transform: translateX(100%) rotateY(90deg);
    transform-origin: left center;
}

.e3ds-edge-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(to bottom, 
        rgba(60,60,60,0.8) 0%,
        rgba(30,30,30,0.6) 100%
    );
    transform: translateY(-100%) rotateX(90deg);
    transform-origin: bottom center;
}

.e3ds-edge-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(to top, 
        rgba(0,0,0,0.7) 0%,
        rgba(20,20,20,0.5) 100%
    );
    transform: translateY(100%) rotateX(-90deg);
    transform-origin: top center;
}

/* Shadow beneath panel */
.e3ds-shadow {
    position: absolute;
    bottom: -30px;
    left: 10%;
    width: 80%;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, transparent 70%);
    transform: rotateX(90deg);
    opacity: 0.7;
    pointer-events: none;
}

.e3ds-panel.active .e3ds-shadow {
    opacity: 0.9;
}

/* Title overlay - only visible when active */
.e3ds-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    color: #fff;
    opacity: 0;
    transform: translateY(8px);
    z-index: 10;
}

.e3ds-panel.active .e3ds-title {
    opacity: 1;
    transform: translateY(0);
}

.e3ds-title h3 {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 3px;
    letter-spacing: 0.5px;
}

.e3ds-title p {
    font-size: 0.75rem;
    margin: 0;
    color: rgba(255,255,255,0.55);
}

.e3ds-title .e3ds-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4ade80;
    margin-top: 6px;
}

/* Subtle highlight on collapsed panels */
.e3ds-panel:not(.active)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 2px;
}

/* Focus state */
.e3ds-panel:focus-visible {
    outline: 1px solid rgba(255,255,255,0.4);
    outline-offset: 3px;
}

/* Link */
.e3ds-link {
    position: absolute;
    inset: 0;
    z-index: 20;
}

/* Responsive */
@media (max-width: 1024px) {
    .e3ds-gallery {
        padding: 30px 15px;
    }
}

@media (max-width: 768px) {
    .e3ds-gallery {
        padding: 20px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .e3ds-panel,
    .e3ds-card,
    .e3ds-shadow,
    .e3ds-title,
    .e3ds-front img {
        transition-duration: 0.01ms !important;
    }
}
