/**
 * Polanger Woo Category Story Carousel - Frontend Styles
 *
 * @package Polanger_Woo_Category_Story_Carousel
 */

/* Carousel Wrapper */
.pwfb-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
}

/* Arrow Position - Outside (default) */
.pwfb-arrows-outside {
    padding-left: 50px;
    padding-right: 50px;
}

/* Arrow Position - Inside */
.pwfb-arrows-inside {
    padding-left: 10px;
    padding-right: 10px;
}

.pwfb-carousel {
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Carousel Item */
.pwfb-carousel-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 5px 10px;
    outline: none;
    box-sizing: border-box;
}

.pwfb-category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.3s ease;
    border-bottom: none !important;
    box-shadow: none !important;
}

.pwfb-category-link:hover {
    transform: scale(1.05);
    text-decoration: none !important;
}

.pwfb-category-link:focus,
.pwfb-category-link:active,
.pwfb-category-link:visited {
    outline: none;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Image Wrapper - Instagram Style */
.pwfb-image-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

/* Gradient Border - Rotating Animation */
.pwfb-gradient-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: conic-gradient(
        #f09433,
        #e6683c,
        #dc2743,
        #cc2366,
        #bc1888,
        #f09433
    );
    animation: pwfb-rotate 3s linear infinite;
}

/* Rotation Animation */
@keyframes pwfb-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Inner Image Container */
.pwfb-image-inner {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pwfb-image-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Category Title */
.pwfb-category-title {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-top: 8px;
    max-width: 120px;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Slick Slider Overrides */
.pwfb-carousel .slick-list {
    overflow: visible !important;
    padding: 20px 0 !important;
    margin: 0 -20px;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.pwfb-carousel .slick-track {
    display: flex;
    align-items: flex-start;
}

.pwfb-carousel .slick-slide {
    height: auto;
    display: flex;
    justify-content: center;
}

.pwfb-carousel .slick-slide > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Navigation Arrows */
.pwfb-carousel .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.pwfb-carousel .slick-arrow:hover {
    background: #f5f5f5;
    border-color: #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwfb-carousel .slick-arrow:focus {
    outline: none;
}

/* Arrow Position - Outside */
.pwfb-arrows-outside .pwfb-carousel .slick-prev {
    left: -45px;
}

.pwfb-arrows-outside .pwfb-carousel .slick-next {
    right: -45px;
}

/* Arrow Position - Inside */
.pwfb-arrows-inside .pwfb-carousel .slick-prev {
    left: 10px;
}

.pwfb-arrows-inside .pwfb-carousel .slick-next {
    right: 10px;
}

/* Default fallback */
.pwfb-carousel .slick-prev {
    left: -45px;
}

.pwfb-carousel .slick-next {
    right: -45px;
}

.pwfb-carousel .slick-arrow::before {
    font-size: 0;
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-right: 3px solid #333;
    border-bottom: 3px solid #333;
}

.pwfb-carousel .slick-prev::before {
    transform: rotate(135deg);
    margin-left: 4px;
}

.pwfb-carousel .slick-next::before {
    transform: rotate(-45deg);
    margin-right: 4px;
}

.pwfb-carousel .slick-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination Dots */
.pwfb-carousel .slick-dots {
    position: relative;
    bottom: 0;
    margin-top: 20px;
    padding: 0;
    list-style: none;
    display: flex !important;
    justify-content: center;
    gap: 8px;
}

.pwfb-carousel .slick-dots li {
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
}

.pwfb-carousel .slick-dots li button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    transition: all 0.3s ease;
}

.pwfb-carousel .slick-dots li button:hover {
    background: #bbb;
}

.pwfb-carousel .slick-dots li button::before {
    display: none;
}

.pwfb-carousel .slick-dots li.slick-active button {
    background: #dc2743;
    transform: scale(1.2);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .pwfb-arrows-outside {
        padding-left: 45px;
        padding-right: 45px;
    }
    
    .pwfb-arrows-outside .pwfb-carousel .slick-prev {
        left: -40px;
    }
    
    .pwfb-arrows-outside .pwfb-carousel .slick-next {
        right: -40px;
    }
}

@media (max-width: 768px) {
    .pwfb-carousel .slick-arrow {
        width: 35px;
        height: 35px;
    }
    
    .pwfb-arrows-outside {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .pwfb-arrows-outside .pwfb-carousel .slick-prev {
        left: -35px;
    }
    
    .pwfb-arrows-outside .pwfb-carousel .slick-next {
        right: -35px;
    }
    
    .pwfb-arrows-inside .pwfb-carousel .slick-prev {
        left: 5px;
    }
    
    .pwfb-arrows-inside .pwfb-carousel .slick-next {
        right: 5px;
    }
    
    .pwfb-category-title {
        font-size: 12px;
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .pwfb-carousel .slick-arrow {
        width: 32px;
        height: 32px;
    }
    
    .pwfb-carousel .slick-arrow::before {
        font-size: 16px;
    }
    
    .pwfb-arrows-outside {
        padding-left: 35px;
        padding-right: 35px;
    }
    
    .pwfb-arrows-outside .pwfb-carousel .slick-prev {
        left: -32px;
    }
    
    .pwfb-arrows-outside .pwfb-carousel .slick-next {
        right: -32px;
    }
}

/* Hover Effects */
.pwfb-category-link:hover .pwfb-gradient-border {
    animation-duration: 1s;
}

.pwfb-category-link:hover .pwfb-image-inner {
    transform: scale(0.95);
}

/* Loading State - Hide content before Slick initializes */
.pwfb-carousel:not(.slick-initialized) {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

.pwfb-carousel:not(.slick-initialized) .pwfb-carousel-item {
    display: none;
}

/* Show carousel after Slick initializes */
.pwfb-carousel.slick-initialized {
    opacity: 1;
    visibility: visible;
    height: auto;
    animation: pwfb-fadeIn 0.3s ease-in-out;
}

@keyframes pwfb-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hide horizontal scrollbar */
.pwfb-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pwfb-carousel::-webkit-scrollbar {
    display: none;
}

/* Center Mode Styles */
.pwfb-center-mode .pwfb-carousel .slick-slide {
    transition: all 0.4s ease;
    transform: scale(0.75);
    opacity: 0.5;
    filter: blur(1px);
}

.pwfb-center-mode .pwfb-carousel .slick-slide.slick-center {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
    z-index: 10;
}

.pwfb-center-mode .pwfb-carousel .slick-slide.slick-center .pwfb-image-wrapper {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.pwfb-center-mode .pwfb-carousel .slick-slide.slick-center .pwfb-gradient-border {
    animation-duration: 1.5s;
}

/* Adjacent slides to center - slightly larger than others */
.pwfb-center-mode .pwfb-carousel .slick-slide.slick-center + .slick-slide,
.pwfb-center-mode .pwfb-carousel .slick-slide:has(+ .slick-center) {
    transform: scale(0.85);
    opacity: 0.7;
    filter: blur(0);
}

/* Center mode responsive adjustments */
@media (max-width: 768px) {
    .pwfb-center-mode .pwfb-carousel .slick-slide {
        transform: scale(0.8);
    }
    
    .pwfb-center-mode .pwfb-carousel .slick-slide.slick-center {
        transform: scale(1);
    }
}

/* Center mode title enhancement */
.pwfb-center-mode .pwfb-carousel .slick-slide .pwfb-category-title {
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.pwfb-center-mode .pwfb-carousel .slick-slide.slick-center .pwfb-category-title {
    opacity: 1;
    font-weight: 600;
}

/* ============================================
   BORDER STYLES
   ============================================ */

/* Hide border when disabled */
.pwfb-carousel-wrapper:not(.pwfb-border-enabled) .pwfb-gradient-border {
    display: none;
}

/* Solid Border Style */
.pwfb-border-solid .pwfb-gradient-border {
    animation: none !important;
    background: var(--pwfb-border-color-1, #f09433) !important;
}

/* Pulse Border Style */
.pwfb-border-pulse .pwfb-gradient-border {
    animation: pwfb-pulse 2s ease-in-out infinite !important;
}

@keyframes pwfb-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Rainbow Border Style */
.pwfb-border-rainbow .pwfb-gradient-border {
    background: linear-gradient(
        45deg,
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000
    ) !important;
    background-size: 400% 400% !important;
    animation: pwfb-rainbow 3s ease infinite !important;
}

@keyframes pwfb-rainbow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Dashed Rotating Border Style */
.pwfb-border-dashed .pwfb-gradient-border {
    background: transparent !important;
    border: 3px dashed var(--pwfb-border-color-1, #dc2743) !important;
    animation: pwfb-dashed-rotate 16s linear infinite !important;
}

.pwfb-border-dashed .pwfb-image-wrapper {
    position: relative;
}

.pwfb-border-dashed .pwfb-gradient-border::before {
    display: none;
}

@keyframes pwfb-dashed-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

/* Zoom Hover Effect */
.pwfb-hover-zoom .pwfb-category-link:hover {
    transform: scale(1.1) !important;
}

.pwfb-hover-zoom .pwfb-category-link:hover .pwfb-image-wrapper {
    transform: scale(1.05);
}

/* Rotate Hover Effect */
.pwfb-hover-rotate .pwfb-category-link:hover .pwfb-image-wrapper {
    transform: rotate(5deg) scale(1.05);
    transition: transform 0.3s ease;
}

/* Glow Hover Effect */
.pwfb-hover-glow .pwfb-category-link:hover .pwfb-image-wrapper {
    box-shadow: 0 0 20px rgba(240, 148, 51, 0.6), 0 0 40px rgba(220, 39, 67, 0.4);
    transition: box-shadow 0.3s ease;
}

/* Bounce Hover Effect */
.pwfb-hover-bounce .pwfb-category-link:hover {
    animation: pwfb-bounce 0.5s ease;
}

@keyframes pwfb-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(-8px);
    }
}

/* Shake Hover Effect */
.pwfb-hover-shake .pwfb-category-link:hover {
    animation: pwfb-shake 0.5s ease;
}

@keyframes pwfb-shake {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px);
    }
    40% {
        transform: translateX(5px);
    }
    60% {
        transform: translateX(-5px);
    }
    80% {
        transform: translateX(5px);
    }
}

/* ============================================
   SHADOW STYLES
   ============================================ */

/* Ensure shadow follows border-radius */
.pwfb-shadow-soft .pwfb-image-wrapper,
.pwfb-shadow-medium .pwfb-image-wrapper,
.pwfb-shadow-hard .pwfb-image-wrapper,
.pwfb-shadow-colored .pwfb-image-wrapper {
    border-radius: 50%;
    overflow: visible;
}

/* Soft Shadow */
.pwfb-shadow-soft .pwfb-image-wrapper {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Medium Shadow */
.pwfb-shadow-medium .pwfb-image-wrapper {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

/* Hard Shadow */
.pwfb-shadow-hard .pwfb-image-wrapper {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

/* Colored Shadow */
.pwfb-shadow-colored .pwfb-image-wrapper {
    filter: drop-shadow(0 6px 12px rgba(240, 148, 51, 0.5)) drop-shadow(0 4px 8px rgba(220, 39, 67, 0.4));
}

/* Shadow hover enhancement */
.pwfb-shadow-soft .pwfb-category-link:hover .pwfb-image-wrapper {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.pwfb-shadow-medium .pwfb-category-link:hover .pwfb-image-wrapper {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.pwfb-shadow-hard .pwfb-category-link:hover .pwfb-image-wrapper {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.pwfb-shadow-colored .pwfb-category-link:hover .pwfb-image-wrapper {
    filter: drop-shadow(0 10px 20px rgba(240, 148, 51, 0.6)) drop-shadow(0 6px 12px rgba(220, 39, 67, 0.5));
}
