/* 石家庄市恒业建设监理 - 轮播图组件样式 */

/* ===================== 轮播图容器 ===================== */
.carousel {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ===================== 轮播图幻灯片 ===================== */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-in-out);
    transform: translateX(100%);
}

.carousel-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.carousel-slide.prev {
    transform: translateX(-100%);
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================== 轮播图内容 ===================== */
.carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-8);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--duration-base) var(--ease-out) 0.3s;
}

.carousel-slide.active .carousel-content {
    transform: translateY(0);
    opacity: 1;
}

.carousel-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-description {
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
    opacity: 0.9;
}

.carousel-link {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--duration-base) var(--ease-out);
}

.carousel-link:hover {
    background: var(--primary-light);
    transform: translateX(5px);
}

/* ===================== 轮播图控制按钮 ===================== */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--primary-color);
    transition: all var(--duration-base) var(--ease-out);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.carousel-prev {
    left: var(--space-4);
}

.carousel-next {
    right: var(--space-4);
}

.carousel-control:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.carousel-control:active {
    transform: translateY(-50%) scale(0.95);
}

/* ===================== 轮播图指示器 ===================== */
.carousel-indicators {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    z-index: 10;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    border: 2px solid transparent;
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.indicator-dot.active {
    background: white;
    width: 32px;
    border-radius: var(--radius-full);
    border-color: var(--primary-color);
}

/* ===================== Hero轮播图特殊样式 ===================== */
.hero-carousel {
    height: calc(100vh - var(--header-height));
    min-height: 600px;
    border-radius: 0;
}

.hero-carousel .carousel-content {
    padding: var(--space-12) var(--space-8);
    background: linear-gradient(135deg, rgba(0, 60, 113, 0.9) 0%, rgba(0, 86, 160, 0.7) 100%);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    max-width: 800px;
    left: var(--space-8);
    right: auto;
}

.hero-carousel .carousel-slide.active .carousel-content {
    transform: translateY(-50%);
    animation: slideInLeft var(--duration-slow) var(--ease-out);
}

.hero-carousel .carousel-title {
    font-size: var(--text-5xl);
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

.hero-carousel .carousel-description {
    font-size: var(--text-xl);
    margin-bottom: var(--space-6);
}

/* ===================== 案例展示轮播图 ===================== */
.case-carousel {
    height: 400px;
}

.case-carousel .carousel-slide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
    align-items: center;
}

.case-carousel-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.case-carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.case-carousel-image:hover img {
    transform: scale(1.05);
}

.case-carousel-info {
    padding: var(--space-4);
}

.case-carousel-category {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
}

/* ===================== 客户评价轮播图 ===================== */
.testimonial-carousel {
    height: auto;
    background: var(--bg-tertiary);
}

.testimonial-carousel .carousel-slide {
    padding: var(--space-8);
    text-align: center;
}

.testimonial-quote {
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    position: relative;
}

.testimonial-quote::before {
    content: '"';
    position: absolute;
    left: -30px;
    top: -20px;
    font-size: var(--text-6xl);
    color: var(--primary-color);
    opacity: 0.1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.testimonial-info {
    text-align: left;
}

.testimonial-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.testimonial-title {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* ===================== 动画效果 ===================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px) translateY(-50%);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(-50%);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== 响应式设计 ===================== */
@media (max-width: 1024px) {
    .carousel {
        height: 500px;
    }

    .hero-carousel {
        height: calc(100vh - var(--header-height));
        min-height: 500px;
    }

    .hero-carousel .carousel-title {
        font-size: var(--text-4xl);
    }

    .case-carousel .carousel-slide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .carousel {
        height: 400px;
    }

    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: var(--text-base);
    }

    .carousel-prev {
        left: var(--space-2);
    }

    .carousel-next {
        right: var(--space-2);
    }

    .carousel-title {
        font-size: var(--text-2xl);
    }

    .carousel-description {
        font-size: var(--text-base);
    }

    .hero-carousel {
        height: calc(100vh - var(--header-height-mobile));
        min-height: 400px;
    }

    .hero-carousel .carousel-content {
        padding: var(--space-6);
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .hero-carousel .carousel-title {
        font-size: var(--text-3xl);
    }

    .hero-carousel .carousel-description {
        font-size: var(--text-base);
    }

    .carousel-indicators {
        bottom: var(--space-2);
    }

    .indicator-dot {
        width: 8px;
        height: 8px;
    }

    .indicator-dot.active {
        width: 24px;
    }
}

@media (max-width: 480px) {
    .carousel {
        height: 300px;
    }

    .carousel-content {
        padding: var(--space-4);
    }

    .carousel-title {
        font-size: var(--text-xl);
    }

    .carousel-description {
        font-size: var(--text-sm);
        margin-bottom: var(--space-3);
    }

    .carousel-link {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
    }

    .hero-carousel .carousel-title {
        font-size: var(--text-2xl);
    }

    .testimonial-carousel .carousel-slide {
        padding: var(--space-4);
    }

    .testimonial-quote {
        font-size: var(--text-base);
    }
}

/* ===================== 自动播放暂停 ===================== */
.carousel:hover .carousel-control {
    opacity: 1;
}

.carousel-control {
    opacity: 0.7;
}

/* ===================== 触摸滑动提示 ===================== */
@media (hover: none) and (pointer: coarse) {
    .carousel::after {
        content: '← 左右滑动 →';
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        padding: var(--space-2) var(--space-4);
        background: rgba(0, 0, 0, 0.6);
        color: white;
        border-radius: var(--radius-full);
        font-size: var(--text-xs);
        animation: fadeInOut 3s ease-in-out;
        pointer-events: none;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}
