/* JKKP Slider - Modern Design */
:root {
    --jkkp-slider-transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --slider-aspect-ratio: calc(5 / 16 * 100%);
    --desktop-border-radius: 8px;
    --desktop-bullet-size: 10px;
    --tablet-border-radius: 6px;
    --tablet-bullet-size: 8px;
    --mobile-border-radius: 4px;
    --mobile-bullet-size: 6px;
    --bullet-default-color: #cccccc;
    --bullet-active-color: #007bff;
}

/* Block level overrides */
.wp-block-my-plugin-jkkp-home-main-slider,
.entry-content .wp-block-my-plugin-jkkp-home-main-slider {
    display: block !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

.jkkp-slider {
    position: relative;
    margin: 0 auto;
    overflow: hidden; /* Keep hidden for bullets below */
}

.jkkp-slider-container {
    position: relative;
    width: 100%;
    padding-top: 26.67%; /* Reduced height (approximately 15:6 aspect ratio) */
    overflow: hidden;
    border-radius: var(--desktop-border-radius, 8px);
}

/* Progress Bar Container */
.jkkp-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    overflow: hidden;
    border-bottom-left-radius: var(--desktop-border-radius, 8px);
    border-bottom-right-radius: var(--desktop-border-radius, 8px);
}

.jkkp-slider-container .jkkp-progress {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.jkkp-slider-container .jkkp-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--bullet-active-color, #007bff);
    transform-origin: left center;
    will-change: width;
    transition: none;
}

.jkkp-slider:not(:hover) .jkkp-slider-container .jkkp-progress-bar {
    transition: width 5000ms linear;
}

/* Pause animation on hover */
.jkkp-slider:hover .jkkp-slider-container .jkkp-progress-bar {
    transition: none;
}

/* Slides */
.jkkp-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.jkkp-slide.active {
    opacity: 1;
}

.jkkp-slide-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.jkkp-slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.jkkp-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation Container */
.jkkp-navigation {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    z-index: 10;
}

/* Bullet Navigation */
.jkkp-bullets {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.jkkp-bullet {
    width: var(--desktop-bullet-size, 10px);
    height: var(--desktop-bullet-size, 10px);
    border-radius: 50%;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background-color: var(--bullet-default-color);
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.jkkp-bullet:hover {
    transform: scale(1.1);
}

.jkkp-bullet.active {
    background-color: var(--bullet-active-color);
    transform: scale(1.2);
}

/* Responsive Design */
@media screen and (min-width: 769px) {
    .jkkp-slider-container {
        border-radius: var(--desktop-border-radius, 8px);
    }

    .jkkp-bullet {
        width: var(--desktop-bullet-size, 10px);
        height: var(--desktop-bullet-size, 10px);
    }
}

@media screen and (min-width: 577px) and (max-width: 768px) {
    .jkkp-slider-container {
        border-radius: var(--tablet-border-radius, 6px);
    }

    .jkkp-bullet {
        width: var(--tablet-bullet-size, 8px);
        height: var(--tablet-bullet-size, 8px);
    }

    .jkkp-navigation {
        padding: 12px 0;
    }

    .jkkp-bullets {
        gap: 8px;
    }
}

@media screen and (max-width: 576px) {
    .jkkp-slider-container {
        border-radius: var(--mobile-border-radius, 4px);
    }

    .jkkp-bullet {
        width: var(--mobile-bullet-size, 6px);
        height: var(--mobile-bullet-size, 6px);
    }

    .jkkp-navigation {
        padding: 10px 0;
    }

    .jkkp-bullets {
        gap: 6px;
    }
}

/* WordPress Integration */
.wp-block-my-plugin-jkkp-home-main-slider {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Theme compatibility */
.entry-content .jkkp-slider,
.entry-content .jkkp-slider-container,
.entry-content .jkkp-slide,
.entry-content .jkkp-slide-image,
.entry-content .wp-block-my-plugin-jkkp-home-main-slider,
.entry-content > .wp-block-my-plugin-jkkp-home-main-slider {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Additional theme overrides */
.wp-block-my-plugin-jkkp-home-main-slider::before,
.wp-block-my-plugin-jkkp-home-main-slider::after,
.jkkp-slider::before,
.jkkp-slider::after {
    display: none !important;
    content: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Block spacing overrides */
.block-editor-block-list__layout .wp-block-my-plugin-jkkp-home-main-slider,
.wp-block-my-plugin-jkkp-home-main-slider.wp-block {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Editor specific overrides */
.block-editor-block-list__block[data-type="my-plugin/jkkp-home-main-slider"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Additional spacing overrides */
.entry-content > .wp-block-my-plugin-jkkp-home-main-slider:first-child {
    margin-top: 0 !important;
}

.entry-content > .wp-block-my-plugin-jkkp-home-main-slider:last-child {
    margin-bottom: 0 !important;
}

@media screen and (max-width: 768px) {
    /* Mobile block spacing overrides */
    .wp-block-my-plugin-jkkp-home-main-slider,
    .entry-content .wp-block-my-plugin-jkkp-home-main-slider,
    .entry-content > .wp-block-my-plugin-jkkp-home-main-slider,
    .wp-block[data-type="my-plugin/jkkp-home-main-slider"],
    .wp-block-my-plugin-jkkp-home-main-slider.alignfull,
    .wp-block-my-plugin-jkkp-home-main-slider.alignwide {
        margin: 0 !important;
        padding: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Mobile theme compatibility */
    .entry-content .jkkp-slider,
    .entry-content .jkkp-slider-container,
    .entry-content .jkkp-slide,
    .entry-content .jkkp-slide-image {
        margin: 0 !important;
        padding: 0 !important;
    }

    .jkkp-slider-container .jkkp-progress {
        height: 2px;
    }
}

@media screen and (max-width: 576px) {
    /* Small mobile specific overrides */
    .wp-block-my-plugin-jkkp-home-main-slider,
    .entry-content .wp-block-my-plugin-jkkp-home-main-slider,
    .entry-content > .wp-block-my-plugin-jkkp-home-main-slider {
        margin: 0 !important;
        padding: 0 !important;
    }

    .jkkp-slider-container .jkkp-progress {
        height: 2px;
    }

    /* Additional small mobile theme overrides */
    article .entry-content .wp-block-my-plugin-jkkp-home-main-slider,
    .post .entry-content .wp-block-my-plugin-jkkp-home-main-slider,
    .page .entry-content .wp-block-my-plugin-jkkp-home-main-slider {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Additional mobile-specific theme overrides */
@media (max-width: 767px) {
    .entry-content > [class*="wp-block-"]:not(:last-child).wp-block-my-plugin-jkkp-home-main-slider {
        margin-bottom: 0 !important;
    }
    
    .entry-content > [class*="wp-block-"]:not(:first-child).wp-block-my-plugin-jkkp-home-main-slider {
        margin-top: 0 !important;
    }
    
    /* Common mobile theme class overrides */
    .content-area .wp-block-my-plugin-jkkp-home-main-slider,
    .site-main .wp-block-my-plugin-jkkp-home-main-slider,
    .post-content .wp-block-my-plugin-jkkp-home-main-slider,
    .page-content .wp-block-my-plugin-jkkp-home-main-slider {
        margin: 0 !important;
        padding: 0 !important;
    }
}
