/**
 * Advanced Loop Grid Slider - Widget Styles
 *
 * @package Advanced_Loop_Grid_Slider
 * @since 1.0.0
 */

/* Wrapper */
.algs-widget-wrapper {
    width: 100%;
}

/* Grid Layout */
.algs-grid {
    display: grid;
    width: 100%;
}

.algs-grid .algs-grid-item {
    width: 100%;
}

/* Column Layout (same as grid but responsive) */
.algs-layout-column {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.algs-layout-column .algs-grid-item {
    padding: 0 10px;
    margin-bottom: 20px;
}

/* Masonry Layout */
.algs-masonry {
    display: block;
}

.algs-masonry .algs-grid-item {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Swiper Styles */
.algs-swiper {
    width: 100%;
    padding-bottom: 40px;
}

.algs-swiper .swiper-slide {
    height: auto;
    display: flex;
}

.algs-swiper .swiper-slide > * {
    width: 100%;
}

/* Swiper Navigation */
.swiper-button-prev,
.swiper-button-next {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* External Navigation Buttons */
.swiper-prev-button,
.swiper-next-button {
    cursor: pointer;
    color: #333;
    z-index: 10;
    transition: all 0.3s ease;
}

.swiper-prev-button:hover,
.swiper-next-button:hover {
    opacity: 0.7;
}

/* Disabled States for External Buttons */
.swiper-prev-button.disabled,
.swiper-next-button.disabled,
.swiper-button-prev.swiper-button-disabled,
.swiper-button-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Custom External Button Styling Examples */
/* You can customize these based on your design */
.custom-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.custom-nav-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.custom-nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 16px;
    font-weight: bold;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Swiper Pagination */
.algs-swiper .swiper-pagination {
    bottom: 0;
}

.algs-swiper .swiper-pagination-bullet {
    background: #ccc;
    opacity: 1;
    width: 10px;
    height: 10px;
    margin: 0 4px;
}

.algs-swiper .swiper-pagination-bullet-active {
    background: #61ce70;
}

/* Swiper Fraction */
.algs-swiper .swiper-pagination-fraction {
    color: #333;
    font-size: 14px;
}

/* Swiper Progressbar */
.algs-swiper .swiper-pagination-progressbar {
    background: #eee;
}

.algs-swiper .swiper-pagination-progressbar-fill {
    background: #61ce70;
}

/* No Posts Message */
.algs-no-posts {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

/* No Template Message */
.algs-no-template {
    padding: 20px;
    text-align: center;
    color: #999;
    border: 2px dashed #ddd;
    border-radius: 4px;
}

/* Template Error */
.algs-template-error {
    padding: 20px;
    text-align: center;
    color: #d00;
    background: #fee;
    border-radius: 4px;
}

/* Editor Preview */
.algs-editor-preview {
    padding: 20px;
}

.algs-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.algs-preview-item {
    aspect-ratio: 4/3;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.algs-preview-template {
    text-align: center;
    color: #666;
}

.algs-preview-template i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.algs-no-template-message {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .algs-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .algs-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Lazy Load Placeholder */
.algs-lazy-placeholder {
    background: #f0f0f0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.algs-lazy-placeholder::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top-color: #61ce70;
    border-radius: 50%;
    animation: algs-spin 1s linear infinite;
}

@keyframes algs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation for items */
.algs-grid-item {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.algs-grid-item.loading {
    opacity: 0;
}

/* Swiper fade effect */
.algs-swiper .swiper-slide {
    transition: transform 0.3s ease;
}

/* Centered slides */
.algs-swiper .swiper-slide.swiper-slide-active {
    z-index: 1;
}

/* ========================================
   SWIPER EFFECTS STYLES
   ======================================== */

/* Swiper Effect: Fade */
.algs-swiper.effect-fade .swiper-slide {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.algs-swiper.effect-fade .swiper-slide.swiper-slide-active {
    opacity: 1;
}

/* Swiper Effect: Cube */
.algs-swiper.effect-cube {
    overflow: visible;
}

.algs-swiper.effect-cube .swiper-slide {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.algs-swiper.effect-cube .swiper-slide-shadow {
    background: rgba(0, 0, 0, 0.15);
    border-radius: inherit;
}

.algs-swiper.effect-cube .swiper-slide-shadow-left {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.4), transparent);
}

.algs-swiper.effect-cube .swiper-slide-shadow-right {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.4), transparent);
}

.algs-swiper.effect-cube .swiper-slide-shadow-top {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

.algs-swiper.effect-cube .swiper-slide-shadow-bottom {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

/* Swiper Effect: Coverflow */
.algs-swiper.effect-coverflow .swiper-slide {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.algs-swiper.effect-coverflow .swiper-slide-shadow {
    background: rgba(0, 0, 0, 0.15);
}

/* Swiper Effect: Flip */
.algs-swiper.effect-flip .swiper-slide {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.algs-swiper.effect-flip .swiper-slide-shadow {
    background: rgba(0, 0, 0, 0.1);
}

.algs-swiper.effect-flip .swiper-slide-shadow-left {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.3), transparent);
}

.algs-swiper.effect-flip .swiper-slide-shadow-right {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3), transparent);
}

.algs-swiper.effect-flip .swiper-slide-shadow-top {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
}

.algs-swiper.effect-flip .swiper-slide-shadow-bottom {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
}

/* Mousewheel cursor */
.algs-swiper.mousewheel-enabled {
    cursor: grab;
}

.algs-swiper.mousewheel-enabled:active {
    cursor: grabbing;
}

/* Keyboard navigation hint */
.algs-swiper.keyboard-enabled:focus {
    outline: 2px solid #61ce70;
    outline-offset: 2px;
}

/* Free mode indicator */
.algs-swiper.free-mode-enabled .swiper-wrapper {
    transition-timing-function: ease-out;
}

/* Auto height transition */
.algs-swiper.auto-height-enabled .swiper-slide {
    transition: height 0.3s ease;
}
