/**
 * Lightweight Gallery - Frontend Styles
 * Version: 1.0.0
 */

/* Container */
.lwg-gallery-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
    margin: 0 auto;
    cursor: pointer;
}

/* Gallery Section Wrapper */
.lwg-gallery-section {
    display: flex;
    /* width: 520px; */
    width: 100%;
    height: 232px;
    padding: 32px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border-radius: 40px;
    background: #FAF9F9;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Cards Container */
.lwg-cards-container {
    position: relative;
    width: 100%;
    height: 200px;
    margin-top: 30px;
    transition: transform 0.25s ease;
}

/* Individual Cards */
.lwg-card {
    position: absolute;
    width: 303px;
    border-radius: 18px;
    border: 3.607px solid #FFF;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    background: #f5f5f5;
}

.lwg-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Zigzag stacked layout - default state */
.lwg-card-1 {
    width: 302.559px;
    height: 199.412px;
    aspect-ratio: 302.56/199.41;
    position: absolute;
    right: 47.051px;
    top: -76px;
    z-index: 3;
    transform: rotate(-9.07deg);
    border-radius: 18.036px;
    border: 3.607px solid #FFF;
    box-shadow: 0 3.607px 18.036px 0 rgba(0, 0, 0, 0.20);
}

.lwg-card-2 {
    width: 302.107px;
    height: 199.115px;
    aspect-ratio: 302.11/199.11;
    position: absolute;
    left: 89px;
    top: -85px;
    z-index: 2;
    border-radius: 18.036px;
    border: 3.607px solid #FFF;
    box-shadow: 0 3.607px 18.036px 0 rgba(0, 0, 0, 0.20);
}

.lwg-card-3 {
    width: 302.559px;
    height: 199.412px;
    aspect-ratio: 302.56/199.41;
    position: absolute;
    left: 102px;
    top: -108px;
    z-index: 1;
    transform: rotate(10.464deg);
    border-radius: 18.036px;
    border: 3.607px solid #FFF;
    box-shadow: 0 3.607px 18.036px 0 rgba(0, 0, 0, 0.20);
}

/* Hover state - cards lift and fan out */
.lwg-gallery-preview:hover .lwg-card-1 {
    transform: translateY(-15px) translateX(-25px) rotate(5deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    
}

.lwg-gallery-preview:hover .lwg-card-2 {
    transform: translateY(-20px) rotate(0deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    left: 54.858px;
    top: -90.063px;
}

.lwg-gallery-preview:hover .lwg-card-3 {
    transform: translateY(-15px) translateX(25px) rotate(-6deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    left: -1px;
    top: -117px;
}

/* Button Frame/Wrapper */
.lwg-button-frame {
    display: flex;
    /* width: 520px; */
    width: 100%;
    max-width: 800px;
    padding: 24px 32px 32px 32px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    position: absolute;
    bottom: 0;
    border-radius: 40px;
    background: #FAF9F9;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Action Button */
.lwg-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 30px;
    background: transparent;
    border: 1px solid #2A2622;
    border-radius: 9999px;
    font-size: 16px;
    font-weight: 500;
    color: #2A2622;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.lwg-play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.lwg-play-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Button hover state */
.lwg-gallery-preview:hover .lwg-action-button {
    border: 1px solid #2A2622;
    background: rgba(111, 105, 105, 0.10);
    color: #333;
}

.lwg-gallery-preview:hover .lwg-play-icon {
    transform: translateX(3px);
}

/* Button active state */
.lwg-action-button:active {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* .lwg-gallery-preview {
        padding: 30px 15px;
    } */
    
    .lwg-cards-container {
        /* width: 240px;
        height: 180px; */
    }
    
    .lwg-card {
        /* width: 140px;
        height: 140px;
        border-radius: 14px; */
    }
    
    /* .lwg-card-1 {
        left: 10px;
    }
    
    .lwg-card-2 {
        left: 50px;
    }
    
    .lwg-card-3 {
        left: 90px;
    }
    
    .lwg-gallery-preview:hover .lwg-card-1 {
        transform: translateY(-12px) translateX(-20px) rotate(-8deg);
    }
    
    .lwg-gallery-preview:hover .lwg-card-3 {
        transform: translateY(-12px) translateX(20px) rotate(8deg);
    }
    
    .lwg-action-button {
        padding: 12px 24px;
        font-size: 14px;
    } */
}

@media (max-width: 480px) {
    .lwg-cards-container {
        width: 100%;
        height: 160px;
    }
    
    .lwg-card {
        width: 100%;
        height: 120px;
        border-radius: 12px;
    }
    
    .lwg-card-1 {
        top: -36px;
        left: 0px;
        transform: rotate(0deg);
    }
    
    .lwg-card-2 {
       top: -72px;
        left: 20px;
        transform: rotate(10deg);
    }
    
    .lwg-card-3 {
        top: -108px;
        left: -20px;
        transform: rotate(-10deg);
    }
    
    .lwg-gallery-preview:hover .lwg-card-1 {
       top: -36px;
        left: 0px;
        transform: rotate(0deg);
    }
    
    .lwg-gallery-preview:hover .lwg-card-2 {
        top: -72px;
        left: 20px;
        transform: rotate(10deg);
    }
    .lwg-gallery-preview:hover .lwg-card-3 {
        top: -108px;
        left: -20px;
        transform: rotate(-10deg);
    }
    
    .lwg-action-button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Loading state for images */
.lwg-card img {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Accessibility improvements */
.lwg-gallery-preview:focus-within {
    outline: 2px solid #4a90e2;
    outline-offset: 4px;
    border-radius: 8px;
}

.lwg-action-button:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .lwg-gallery-preview {
        page-break-inside: avoid;
    }
}
