/**
 * Aspired Careers Carousel Grid Widget Styles
 * Integrated with the Aspired Careers Design System
 */

/* Main Carousel Container */
.aspired-carousel-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.aspired-carousel-wrapper {
    position: relative;
    width: 100%;
}

.aspired-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

/* Carousel Items */
.aspired-carousel-item {
    flex: 0 0 auto;
    width: calc((100% - (var(--item-gap, 20px) * (var(--slides-to-show, 3) - 1))) / var(--slides-to-show, 3));
    max-width: calc((100% - (var(--item-gap, 20px) * (var(--slides-to-show, 3) - 1))) / var(--slides-to-show, 3));
    position: relative;
    box-sizing: border-box;
}

/* Responsive item sizing */
.aspired-carousel-container[data-slides-to-show="1"] .aspired-carousel-item {
    width: 100%;
    max-width: 100%;
}

.aspired-carousel-container[data-slides-to-show="2"] .aspired-carousel-item {
    width: calc((100% - 20px) / 2);
    max-width: calc((100% - 20px) / 2);
}

.aspired-carousel-container[data-slides-to-show="3"] .aspired-carousel-item {
    width: calc((100% - 40px) / 3);
    max-width: calc((100% - 40px) / 3);
}

.aspired-carousel-container[data-slides-to-show="4"] .aspired-carousel-item {
    width: calc((100% - 60px) / 4);
    max-width: calc((100% - 60px) / 4);
}

.aspired-carousel-container[data-slides-to-show="5"] .aspired-carousel-item {
    width: calc((100% - 80px) / 5);
    max-width: calc((100% - 80px) / 5);
}

.aspired-carousel-container[data-slides-to-show="6"] .aspired-carousel-item {
    width: calc((100% - 100px) / 6);
    max-width: calc((100% - 100px) / 6);
}

.aspired-carousel-item-content {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* Content Layout */
.aspired-carousel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.aspired-carousel-image {
    overflow: hidden;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
}

.aspired-carousel-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.aspired-carousel-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aspired-carousel-title {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--dark-gray, #1A202C);
    margin: 0;
}

.aspired-carousel-description {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--medium-gray, #4A5568);
    margin: 0;
    flex: 1;
}

.aspired-carousel-button {
    align-self: flex-start;
}

/* Navigation Arrows */
.aspired-carousel-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
}

.aspired-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #E2E8F0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    color: var(--aspired-green, #2fc178);
    font-size: 18px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.aspired-carousel-arrow:hover {
    background: var(--aspired-green, #2fc178);
    color: white;
}

.aspired-carousel-prev {
    left: -24px;
}

.aspired-carousel-next {
    right: -24px;
}

/* Dots Navigation */
.aspired-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.aspired-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: var(--light-gray, #E2E8F0);
    cursor: pointer;
    padding: 0;
}

.aspired-carousel-dot:hover {
    background-color: var(--medium-gray, #4A5568);
}

.aspired-carousel-dot.active {
    background-color: var(--aspired-green, #2fc178);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .aspired-carousel-container[data-slides-to-show="3"] .aspired-carousel-item,
    .aspired-carousel-container[data-slides-to-show="4"] .aspired-carousel-item,
    .aspired-carousel-container[data-slides-to-show="5"] .aspired-carousel-item,
    .aspired-carousel-container[data-slides-to-show="6"] .aspired-carousel-item {
        width: calc((100% - 20px) / 2);
        max-width: calc((100% - 20px) / 2);
    }

    .aspired-carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .aspired-carousel-prev {
        left: -20px;
    }

    .aspired-carousel-next {
        right: -20px;
    }


    .aspired-carousel-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .aspired-carousel-container .aspired-carousel-item {
        width: 100% !important;
        max-width: 100% !important;
    }

    .aspired-carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .aspired-carousel-prev {
        left: -18px;
    }

    .aspired-carousel-next {
        right: -18px;
    }

    .aspired-carousel-title {
        font-size: 1.125rem;
    }

    .aspired-carousel-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .aspired-carousel-title {
        font-size: 1rem;
    }

    .aspired-carousel-description {
        font-size: 0.85rem;
    }

    .aspired-carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Image Only Layout */
.aspired-carousel-item[data-content-type="image_only"] .aspired-carousel-item-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.aspired-carousel-item[data-content-type="image_only"] .aspired-carousel-item-content:hover {
    transform: none;
    box-shadow: none;
}

.aspired-carousel-item[data-content-type="image_only"] .aspired-carousel-image img {
    height: auto;
    min-height: 200px;
}

/* Custom HTML Layout */
.aspired-carousel-item[data-content-type="custom_html"] .aspired-carousel-item-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Container Max Width Control */
.elementor-widget-aspired-carousel-grid {
    max-width: 100%;
    overflow: hidden;
}

.elementor-widget-aspired-carousel-grid .elementor-widget-container {
    max-width: 100%;
    overflow: hidden;
}

/* Loading Animation */
.aspired-carousel-container.loading .aspired-carousel-track {
    opacity: 0.7;
}

/* Focus States for Accessibility */
.aspired-carousel-arrow:focus,
.aspired-carousel-dot:focus {
    outline: 2px solid var(--aspired-green, #2fc178);
    outline-offset: 2px;
}

/* Animation for Smooth Transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.aspired-carousel-item.active {
    animation: slideIn 0.5s ease-out;
}

/* Design System Integration - Button Styles */
.aspired-carousel-button.aspired-btn-primary {
    background: var(--aspired-green, #2fc178) !important;
    color: white !important;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(47, 193, 120, 0.2);
}

.aspired-carousel-button.aspired-btn-primary:hover {
    background: var(--aspired-green-dark, #388E3C) !important;
    box-shadow: 0 4px 8px rgba(47, 193, 120, 0.3);
    color: white !important;
}

/* Fade Effect for Autoplay */
.aspired-carousel-container.fade-effect .aspired-carousel-item {
    opacity: 0.7;
}

.aspired-carousel-container.fade-effect .aspired-carousel-item:not(.active) {
    opacity: 0.7;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aspired-carousel-item-content {
        background: #2D3748;
        border-color: #4A5568;
        color: #F7FAFC;
    }

    .aspired-carousel-title {
        color: #F7FAFC;
    }

    .aspired-carousel-description {
        color: #E2E8F0;
    }

    .aspired-carousel-arrow {
        background: rgba(45, 55, 72, 0.9);
        border-color: #4A5568;
    }
}