/* =============================================================================
   3D COVERFLOW CAROUSEL - Infinite Circular Slider
   ============================================================================= */

/* Carousel Container */
.carousel-3d {
    position: relative;
    width: 100%;
    height: 450px;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    margin: var(--space-8) 0;
    overflow: visible;
}

.carousel-3d__viewport {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.carousel-3d__container {
    position: absolute;
    width: 360px;
    height: 100%;
    left: 50%;
    top: 0;
    margin-left: -180px;
    transform-style: preserve-3d;
}

/* Individual Slides */
.carousel-3d__slide {
    position: absolute;
    width: 360px;
    height: 380px;
    left: 0;
    top: 35px;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1),
        opacity 0.6s cubic-bezier(0.165, 0.84, 0.44, 1),
        box-shadow 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
}

.carousel-3d__slide--active {
    z-index: 10;
}

/* Project Cards */
.project-card-3d {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--color-surface) 0%, rgba(18, 18, 18, 0.95) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), rgba(201, 162, 39, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card-3d::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(201, 162, 39, 0.05) 100%);
    pointer-events: none;
}

.carousel-3d__slide--active .project-card-3d {
    border-color: rgba(201, 162, 39, 0.4);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(201, 162, 39, 0.1);
}

.carousel-3d__slide--active .project-card-3d::before {
    opacity: 1;
}

/* Card Icon */
.project-card-3d__icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-accent), rgba(201, 162, 39, 0.7));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.25);
    position: relative;
    z-index: 1;
}

.project-card-3d__icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--color-bg);
    stroke-width: 1.5;
    fill: none;
}

/* Card Header */
.project-card-3d__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
    position: relative;
    z-index: 1;
}

.project-card-3d__language {
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Card Content */
.project-card-3d__title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-3);
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.project-card-3d__description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.7;
    flex: 1;
    margin-bottom: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Card Tags */
.project-card-3d__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.project-card-3d__tag {
    padding: var(--space-1) var(--space-2);
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-accent);
    font-weight: var(--font-medium);
}

/* Card Footer */
.project-card-3d__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.project-card-3d__stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.project-card-3d__stat svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.project-card-3d__link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-accent);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.project-card-3d__link:hover {
    transform: translateX(4px);
}

.project-card-3d__link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s ease;
}

.project-card-3d__link:hover svg {
    transform: translateX(4px);
}

/* Navigation Arrows */
.carousel-3d__nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-4);
    pointer-events: none;
    z-index: 100;
}

.carousel-3d__arrow {
    pointer-events: auto;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: rgba(18, 18, 18, 0.9);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.carousel-3d__arrow:hover {
    background: var(--color-surface);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
}

.carousel-3d__arrow:active {
    transform: scale(0.95);
}

.carousel-3d__arrow svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Indicators */
.carousel-3d__indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
}

.carousel-3d__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.carousel-3d__dot:hover {
    background: var(--color-text-muted);
    transform: scale(1.3);
}

.carousel-3d__dot--active {
    background: var(--color-accent);
    width: 24px;
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.4);
}

/* Counter */
.carousel-3d__counter {
    text-align: center;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.carousel-3d__counter-current {
    color: var(--color-accent);
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-3d {
        height: 420px;
    }

    .carousel-3d__container {
        width: 300px;
        margin-left: -150px;
    }

    .carousel-3d__slide {
        width: 300px;
        height: 360px;
    }

    .project-card-3d {
        padding: var(--space-5);
    }

    .carousel-3d__arrow {
        width: 44px;
        height: 44px;
    }

    .carousel-3d__arrow svg {
        width: 20px;
        height: 20px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .carousel-3d__slide {
        transition: none;
    }

    .project-card-3d,
    .project-card-3d::before,
    .carousel-3d__arrow,
    .carousel-3d__dot {
        transition: none;
    }
}