/**
 * Apps Carousel Styles
 *
 * Design system: Tailwind Spotlight theme with Stone palette
 * Features: Glass morphism, smooth animations, dark mode support
 *
 * @package Twelve_Assistant
 * @since 1.5
 */

/* ==========================================================================
   Section Container
   ========================================================================== */

.ta-apps-carousel-section {
    position: relative;
    width: 100%;
    margin: 4rem auto;
    padding: 3rem 0;
    background: linear-gradient(to right, transparent, rgb(120 113 108 / 0.05), transparent);
    overflow: hidden;
}

.dark .ta-apps-carousel-section {
    background: linear-gradient(to right, transparent, rgb(255 255 255 / 0.03), transparent);
}

/* ==========================================================================
   Header
   ========================================================================== */

.ta-apps-carousel-header {
    text-align: center;
    max-width: 48rem;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.ta-apps-carousel-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: rgb(28 25 23); /* stone-900 */
    margin-bottom: 1rem;
}

.dark .ta-apps-carousel-title {
    color: rgb(250 250 249); /* stone-50 */
}

.ta-apps-carousel-subtitle {
    font-size: 1rem;
    line-height: 1.75;
    color: rgb(87 83 78); /* stone-600 */
    max-width: 36rem;
    margin: 0 auto;
}

.dark .ta-apps-carousel-subtitle {
    color: rgb(168 162 158); /* stone-400 */
}

/* Responsive title */
@media (min-width: 640px) {
    .ta-apps-carousel-title {
        font-size: 3rem;
    }
}

/* ==========================================================================
   Carousel Wrapper
   ========================================================================== */

.ta-apps-carousel-wrapper {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .ta-apps-carousel-wrapper {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .ta-apps-carousel-wrapper {
        padding: 0 2rem;
    }
}

/* ==========================================================================
   Cards Container (Horizontal Scroll)
   ========================================================================== */

.ta-apps-carousel-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 1rem 0 2rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;

    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ta-apps-carousel-container::-webkit-scrollbar {
    display: none;
}

/* ==========================================================================
   App Card
   ========================================================================== */

.ta-app-card {
    position: relative;
    flex: 0 0 350px;
    width: 350px;
    min-height: 420px;
    scroll-snap-align: center;

    /* Background with glass morphism */
    background: rgb(255 255 255 / 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Border */
    border: 1px solid rgb(231 229 228); /* stone-200 */
    border-radius: 1rem;

    /* Shadow */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1),
                0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Animation */
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);

    /* Transition */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Overflow */
    overflow: hidden;
}

.dark .ta-app-card {
    background: rgb(41 37 36 / 0.95); /* stone-900 */
    border-color: rgb(68 64 60); /* stone-700 */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3),
                0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Card hover effect */
.ta-app-card:hover {
    transform: scale(1.02) translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15),
                0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.dark .ta-app-card:hover {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.4),
                0 8px 10px -6px rgb(0 0 0 / 0.2);
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Card Background (Animated GIF on hover)
   ========================================================================== */

.ta-app-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.5s ease, filter 0.5s ease;
    z-index: 0;
    pointer-events: none;
}

.ta-app-card:hover .ta-app-card-bg {
    opacity: 0.3;
    filter: blur(10px);
}

.dark .ta-app-card:hover .ta-app-card-bg {
    opacity: 0.2;
}

/* ==========================================================================
   Card Content
   ========================================================================== */

.ta-app-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
}

/* ==========================================================================
   Card Header
   ========================================================================== */

.ta-app-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ta-app-card-icon {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(250 250 249 / 0.8); /* stone-50 */
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.dark .ta-app-card-icon {
    background: rgb(28 25 23 / 0.8); /* stone-900 */
}

.ta-app-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ta-app-card-info {
    flex: 1;
    min-width: 0;
}

.ta-app-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    color: rgb(28 25 23); /* stone-900 */
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dark .ta-app-card-name {
    color: rgb(250 250 249); /* stone-50 */
}

/* ==========================================================================
   Tags
   ========================================================================== */

.ta-app-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ta-app-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: rgb(68 64 60); /* stone-700 */
    background: rgb(245 245 244); /* stone-100 */
    border-radius: 0.375rem;
}

.dark .ta-app-card-tag {
    color: rgb(214 211 209); /* stone-300 */
    background: rgb(68 64 60); /* stone-700 */
}

/* ==========================================================================
   Description
   ========================================================================== */

.ta-app-card-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgb(87 83 78); /* stone-600 */
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.dark .ta-app-card-description {
    color: rgb(168 162 158); /* stone-400 */
}

/* ==========================================================================
   Demo GIF
   ========================================================================== */

.ta-app-card-demo {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgb(245 245 244); /* stone-100 */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.dark .ta-app-card-demo {
    background: rgb(68 64 60); /* stone-700 */
}

.ta-app-card-demo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ta-app-card:hover .ta-app-card-demo img {
    transform: scale(1.1);
}

/* ==========================================================================
   Global Call to Action Button
   ========================================================================== */

.ta-apps-carousel-cta {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding: 0 1rem;
}

.ta-apps-carousel-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    color: rgb(250 250 249); /* stone-50 */
    background: rgb(68 64 60); /* stone-700 */
    border: none;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
                0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.dark .ta-apps-carousel-button {
    color: rgb(28 25 23); /* stone-900 */
    background: rgb(231 229 228); /* stone-200 */
}

/* Hover effect with scale and shadow */
.ta-apps-carousel-button:hover {
    transform: translateY(-2px);
    background: rgb(87 83 78); /* stone-600 */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2),
                0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dark .ta-apps-carousel-button:hover {
    background: rgb(250 250 249); /* stone-50 */
}

/* Active/pressed state */
.ta-apps-carousel-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

/* SVG icon animation */
.ta-apps-carousel-button svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.ta-apps-carousel-button:hover svg {
    transform: translateX(4px);
}

/* ==========================================================================
   Navigation Buttons
   ========================================================================== */

.ta-apps-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    /* Button style */
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Background */
    background: rgb(255 255 255 / 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Border */
    border: 1px solid rgb(231 229 228); /* stone-200 */
    border-radius: 50%;

    /* Shadow */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
                0 2px 4px -2px rgb(0 0 0 / 0.1);

    /* Color */
    color: rgb(28 25 23); /* stone-900 */

    /* Transition */
    transition: all 0.3s ease;
    opacity: 0;
    cursor: pointer;
}

.dark .ta-apps-carousel-nav {
    background: rgb(28 25 23 / 0.9); /* stone-900 */
    border-color: rgb(68 64 60); /* stone-700 */
    color: rgb(250 250 249); /* stone-50 */
}

/* Show on wrapper hover */
.ta-apps-carousel-wrapper:hover .ta-apps-carousel-nav {
    opacity: 1;
}

/* Position */
.ta-apps-carousel-nav-prev {
    left: 0;
}

.ta-apps-carousel-nav-next {
    right: 0;
}

/* Hover effect */
.ta-apps-carousel-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2),
                0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dark .ta-apps-carousel-nav:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.4),
                0 4px 6px -4px rgb(0 0 0 / 0.2);
}

/* Disabled state */
.ta-apps-carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ta-apps-carousel-nav:disabled:hover {
    transform: translateY(-50%) scale(1);
}

/* ==========================================================================
   Page Indicators
   ========================================================================== */

.ta-apps-carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.ta-apps-carousel-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgb(214 211 209); /* stone-300 */
    transition: all 0.3s ease;
    cursor: pointer;
}

.dark .ta-apps-carousel-indicator {
    background: rgb(87 83 78); /* stone-600 */
}

/* Active indicator */
.ta-apps-carousel-indicator.active {
    width: 2rem;
    background: rgb(120 113 108); /* stone-500 */
}

.dark .ta-apps-carousel-indicator.active {
    background: rgb(168 162 158); /* stone-400 */
}

/* Hover */
.ta-apps-carousel-indicator:hover {
    background: rgb(168 162 158); /* stone-400 */
}

.dark .ta-apps-carousel-indicator:hover {
    background: rgb(120 113 108); /* stone-500 */
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
    .ta-app-card {
        flex: 0 0 300px;
        width: 300px;
        min-height: 390px;
    }

    .ta-apps-carousel-container {
        gap: 1rem;
    }

    .ta-apps-carousel-nav {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Remove focus outline on buttons (already has visual feedback) */
.ta-apps-carousel-nav:focus,
.ta-apps-carousel-button:focus,
.ta-apps-carousel-indicator:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(120 113 108 / 0.5); /* stone-500 with opacity */
}

.dark .ta-apps-carousel-nav:focus,
.dark .ta-apps-carousel-button:focus,
.dark .ta-apps-carousel-indicator:focus {
    box-shadow: 0 0 0 3px rgb(168 162 158 / 0.5); /* stone-400 with opacity */
}
