/**
 * Advanced Carousel Widget Styles
 *
 * Responsive styles for the Advanced Carousel Widget with SwiperJS integration.
 * Includes base styles, animations, and accessibility features.
 *
 * @package Advanced_Widget_Kit
 * @since 2.0.1
 */

/* ==========================================================================
   Base Carousel Styles
   ========================================================================== */

.awke-advanced-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.awke-advanced-carousel .swiper-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.awke-advanced-carousel .swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.awke-advanced-carousel .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Slide Content Styles
   ========================================================================== */

.awke-carousel-slide {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.awke-carousel-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.awke-slide-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.awke-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.awke-carousel-slide:hover .awke-slide-image img {
    transform: scale(1.05);
}

.awke-slide-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.awke-slide-text {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.awke-slide-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.3;
}

.awke-slide-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

.awke-slide-description p {
    margin: 0 0 15px 0;
}

.awke-slide-description p:last-child {
    margin-bottom: 0;
}

.awke-slide-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.awke-slide-link:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.awke-slide-template {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */

.awke-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.awke-carousel-arrow:hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.awke-carousel-arrow:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.awke-carousel-arrow svg {
    width: 16px;
    height: 16px;
    fill: #333;
    transition: fill 0.3s ease;
}

.awke-carousel-arrow:hover svg {
    fill: #007cba;
}

.awke-carousel-next {
    right: 15px;
}

.awke-carousel-prev {
    left: 15px;
}

/* Swiper Navigation Override */
.awke-advanced-carousel .swiper-button-next,
.awke-advanced-carousel .swiper-button-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    margin-top: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.awke-advanced-carousel .swiper-button-next:hover,
.awke-advanced-carousel .swiper-button-prev:hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.awke-advanced-carousel .swiper-button-next:after,
.awke-advanced-carousel .swiper-button-prev:after {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.awke-advanced-carousel .swiper-button-next:hover:after,
.awke-advanced-carousel .swiper-button-prev:hover:after {
    color: #007cba;
}

/* ==========================================================================
   Pagination Styles
   ========================================================================== */

.awke-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.awke-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.awke-carousel-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.awke-carousel-dot.active {
    background-color: #007cba;
    transform: scale(1.3);
}

.awke-carousel-dot:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Swiper Pagination Override */
.awke-advanced-carousel .swiper-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.awke-advanced-carousel .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.awke-advanced-carousel .swiper-pagination-bullet:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.awke-advanced-carousel .swiper-pagination-bullet-active {
    background-color: #007cba;
    transform: scale(1.3);
}

/* Fraction Pagination */
.awke-advanced-carousel .swiper-pagination-fraction {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Progress Bar Pagination */
.awke-advanced-carousel .swiper-pagination-progressbar {
    background-color: rgba(255, 255, 255, 0.2);
    height: 4px;
    border-radius: 2px;
}

.awke-advanced-carousel .swiper-pagination-progressbar-fill {
    background-color: #007cba;
    border-radius: 2px;
}

/* ==========================================================================
   Effect-Specific Styles
   ========================================================================== */

/* Fade Effect */
.awke-advanced-carousel[data-effect="fade"] .swiper-slide {
    opacity: 0;
    transition-property: opacity;
}

.awke-advanced-carousel[data-effect="fade"] .swiper-slide-active {
    opacity: 1;
}

/* Cube Effect */
.awke-advanced-carousel[data-effect="cube"] {
    perspective: 1000px;
}

.awke-advanced-carousel[data-effect="cube"] .swiper-wrapper {
    transform-style: preserve-3d;
}

/* Coverflow Effect */
.awke-advanced-carousel[data-effect="coverflow"] .swiper-slide {
    transition-property: transform;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet Styles */
@media (max-width: 1024px) {
    .awke-advanced-carousel {
        border-radius: 6px;
    }
    
    .awke-carousel-arrow {
        width: 40px;
        height: 40px;
    }
    
    .awke-carousel-arrow svg {
        width: 14px;
        height: 14px;
    }
    
    .awke-carousel-next {
        right: 10px;
    }
    
    .awke-carousel-prev {
        left: 10px;
    }
    
    .awke-slide-text {
        padding: 15px;
    }
    
    .awke-slide-title {
        font-size: 1.3rem;
    }
    
    .awke-slide-description {
        font-size: 0.9rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .awke-advanced-carousel {
        border-radius: 4px;
    }
    
    .awke-carousel-arrow {
        width: 36px;
        height: 36px;
        display: none; /* Hide arrows on mobile by default */
    }
    
    .awke-carousel-arrow svg {
        width: 12px;
        height: 12px;
    }
    
    .awke-carousel-dots {
        bottom: 15px;
    }
    
    .awke-carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    .awke-slide-text {
        padding: 12px;
    }
    
    .awke-slide-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .awke-slide-description {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .awke-slide-link {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .awke-advanced-carousel {
        border-radius: 0;
        box-shadow: none;
    }
    
    .awke-carousel-dots {
        bottom: 10px;
    }
    
    .awke-slide-text {
        padding: 10px;
    }
    
    .awke-slide-title {
        font-size: 1.1rem;
    }
    
    .awke-slide-description {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   Accessibility Styles
   ========================================================================== */

/* Focus styles for keyboard navigation */
.awke-advanced-carousel:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .awke-carousel-arrow {
        background-color: #000;
        color: #fff;
    }
    
    .awke-carousel-arrow svg {
        fill: #fff;
    }
    
    .awke-carousel-dot {
        background-color: #000;
        border: 2px solid #fff;
    }
    
    .awke-carousel-dot.active {
        background-color: #fff;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .awke-advanced-carousel .swiper-slide,
    .awke-advanced-carousel .swiper-wrapper,
    .awke-slide-image img,
    .awke-carousel-arrow,
    .awke-carousel-dot {
        transition: none;
    }
    
    .awke-carousel-slide:hover {
        transform: none;
    }
    
    .awke-carousel-slide:hover .awke-slide-image img {
        transform: none;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.awke-advanced-carousel:not(.awke-carousel-initialized) {
    opacity: 0.7;
}

.awke-advanced-carousel:not(.awke-carousel-initialized)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: awke-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes awke-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.awke-advanced-carousel[dir="rtl"] .awke-carousel-next {
    left: 15px;
    right: auto;
}

.awke-advanced-carousel[dir="rtl"] .awke-carousel-prev {
    right: 15px;
    left: auto;
}

.awke-advanced-carousel[dir="rtl"] .swiper-button-next {
    left: 15px;
    right: auto;
}

.awke-advanced-carousel[dir="rtl"] .swiper-button-prev {
    right: 15px;
    left: auto;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .awke-advanced-carousel {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .awke-carousel-arrow,
    .awke-carousel-dots {
        display: none;
    }
    
    .awke-advanced-carousel .swiper-slide {
        page-break-inside: avoid;
    }
}
