/* Homepage Carousel Styles */
.homepage-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

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

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.carousel-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.carousel-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
}

.carousel-text {
    text-align: center;
    color: white;
    max-width: 80%;
    animation: slideInUp 0.8s ease-out;
}

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

.carousel-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
}

.carousel-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    opacity: 0.9;
}

.carousel-button {
    display: inline-block;
    padding: 14px 32px;
    background-color: #ff6b6b;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.carousel-button:hover {
    background-color: #ff5252;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.4);
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.8rem;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.8;
}

.carousel-prev:hover, .carousel-next:hover {
    background: rgba(255, 255, 255, 1);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.carousel-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.8);
}

/* 加载动画 */
.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f8f9fa;
}

.carousel-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .carousel-title {
        font-size: 2.2rem;
    }
    
    .carousel-description {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .carousel-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .carousel-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .carousel-text {
        max-width: 90%;
        padding: 15px;
    }
    
    .carousel-button {
        padding: 12px 24px;
        font-size: 0.85rem;
    }
    
    .carousel-prev, .carousel-next {
        font-size: 1.5rem;
        padding: 10px 14px;
    }
    
    .carousel-prev {
        left: 15px;
    }
    
    .carousel-next {
        right: 15px;
    }
    
    .carousel-dots {
        bottom: 15px;
        gap: 10px;
    }
    
    .carousel-dot {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .carousel-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .carousel-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .carousel-button {
        padding: 10px 20px;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
    
    .carousel-prev, .carousel-next {
        font-size: 1.2rem;
        padding: 8px 12px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .carousel-content {
        padding: 10px;
    }
}

/* 无障碍访问支持 */
.carousel-prev:focus, .carousel-next:focus, .carousel-dot:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .homepage-carousel {
        box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
    }
    
    .carousel-no-image {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

/* 减少动画的用户偏好 */
@media (prefers-reduced-motion: reduce) {
    .carousel-slide {
        transition: none;
    }
    
    .carousel-text {
        animation: none;
    }
    
    .carousel-button:hover {
        transform: none;
    }
    
    .carousel-prev:hover, .carousel-next:hover {
        transform: translateY(-50%);
    }
}