/* Geniatech Content Carousel Widget Styles */

.geniatech-content-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.geniatech-content-carousel .geniatech-content-carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 10px;
   
}

.geniatech-content-carousel .geniatech-content-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
}

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

.geniatech-content-carousel .geniatech-content-carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.geniatech-content-carousel .geniatech-content-slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.geniatech-content-carousel .geniatech-content-slide-background.pc{display:block;}
.geniatech-content-carousel .geniatech-content-slide-background.mb{display:none;}

.geniatech-content-carousel .geniatech-content-slide-content {
    position: relative;
    z-index: 2;
    padding: 60px;
    max-width: 50%;
    color: #ffffff;
    animation: slideInLeft 0.8s ease-out;
}

.geniatech-content-carousel .geniatech-content-carousel-slide.active .geniatech-content-slide-content {
    animation: slideInLeft 0.8s ease-out;
}

.geniatech-content-carousel .geniatech-content-image {
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.geniatech-content-carousel .geniatech-content-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    /*border-radius: 8px;*/
    display: block;
}

.geniatech-content-carousel .geniatech-content-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #ffffff;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    position: relative;
}

.geniatech-content-carousel .geniatech-content-title::after {
    content: '';
    position: absolute;
    bottom: -23px;
    left: 0;
    width: 32px;
    height: 2px;
    background-color: #323B40;
    display: block;
}

.geniatech-content-carousel .geniatech-content-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 35px;
    margin-top: 36px;
    color: #ffffff;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.geniatech-content-carousel .geniatech-content-description * {
    color: inherit;
}

.geniatech-content-carousel .geniatech-content-description p {
    margin-bottom: 1rem;
}

.geniatech-content-carousel .geniatech-content-description p:last-child {
    margin-bottom: 0;
}

.geniatech-content-carousel .geniatech-content-description strong {
    font-weight: 700;
}

.geniatech-content-carousel .geniatech-content-description em {
    font-style: italic;
}

.geniatech-content-carousel .geniatech-content-button-wrapper {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.geniatech-content-carousel .geniatech-content-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #007cba;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* 支持通过宽高控制按钮大小 */
    width: auto;
    height: auto;
    box-sizing: border-box;
}

.geniatech-content-carousel .geniatech-content-button .button-icon {
    display: inline-flex;
    align-items: center;
    font-size: 0.9em;
}

.geniatech-content-carousel .geniatech-content-button .icon-before {
    margin-right: 4px;
}

.geniatech-content-carousel .geniatech-content-button .icon-after {
    margin-left: 4px;
}

.geniatech-content-carousel .geniatech-content-button:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    color: #ffffff;
}

/* 指示器样式 */
.geniatech-content-carousel .geniatech-content-carousel-indicators {
    display: flex;
    flex-wrap: nowrap;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    -ms-overflow-style: auto;
    touch-action: pan-x;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* 允许在移动端横向滚动时不撑满等分 */
    width: 100%;
}

.geniatech-content-carousel .geniatech-content-indicator-item {
    flex: 1 1 0%; /* PC端等分 */
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    font-size: 14px;
    color: #666666;
    background-color: transparent;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.geniatech-content-carousel .geniatech-content-indicator-item::before {
    content: '';
    width: 100%;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.geniatech-content-carousel .geniatech-content-indicator-item:hover {
    color: #007cba;
}

.geniatech-content-carousel .geniatech-content-indicator-item.active {
    color: #007cba;
    font-weight: 600;
}

.geniatech-content-carousel .geniatech-content-indicator-item.active::before {
    background-color: currentColor;
}

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

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .slide-content {
        padding: 40px;
        max-width: 60%;
    }
    
    .content-title {
        font-size: 2rem;
    }
    
    .content-description {
        font-size: 1rem;
    }
    
    .geniatech-content-image img {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 350px;
        border-radius: 8px;
    }
    
    .geniatech-content-carousel .geniatech-content-carousel-slide{align-items:start;padding-top:10px}
    .geniatech-content-carousel .geniatech-content-image{display:none}
    .geniatech-content-carousel .geniatech-content-description{margin-bottom:15px}
    
    .slide-content {
        padding: 30px 20px;
        max-width: 100%;
        text-align: center;
    }
    
    .content-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .content-description {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .geniatech-content-image img {
        width: 60px;
        height: 60px;
    }
    
    .geniatech-content-carousel .geniatech-content-slide-background.pc{display:none;}
    .geniatech-content-carousel .geniatech-content-slide-background.mb{display:block;}
    
    .content-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .geniatech-content-carousel .geniatech-content-carousel-indicators {
        border-radius: 0 0 8px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        white-space: nowrap;
    }
    .geniatech-content-carousel .geniatech-content-carousel-indicators::-webkit-scrollbar { display: none; }
    
    .geniatech-content-carousel .geniatech-content-indicator-item {
        padding: 15px 20px;
        font-size: 13px;
        flex: 0 0 auto; /* 移动端不等分，允许横向滚动 */
    }
}

@media (max-width: 480px) {
    .carousel-container {
        height: 300px;
        border-radius: 5px;
    }
    
    .slide-content {
        padding: 20px 15px;
    }
    
    .content-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .content-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .geniatech-content-image img {
        width: 50px;
        height: 50px;
    }
    
    .content-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .geniatech-content-carousel .geniatech-content-carousel-indicators {
        border-radius: 0 0 5px 5px;
        flex-direction: row; /* 横向布局，便于滑动 */
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
    }
    .geniatech-content-carousel .geniatech-content-carousel-indicators::-webkit-scrollbar { display: none; }
    
    .geniatech-content-carousel .geniatech-content-indicator-item {
        padding: 12px 15px;
        font-size: 12px;
        border-bottom: none;
        flex: 0 0 auto;
    }
    
    .indicator-item:last-child {
        border-bottom: none;
    }
    
    .indicator-item::after {
        height: 2px;
        left: 0;
        right: auto;
        width: 0;
        transition: width 0.3s ease;
    }
    
    .indicator-item.active::after {
        width: 100%;
    }
}

/* 加载状态 */
.geniatech-content-carousel.loading {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.geniatech-content-carousel.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .carousel-indicators {
        background-color: #2c3e50;
    }
    
    .indicator-item {
        color: #bdc3c7;
    }
    
    .indicator-item:hover {
        background-color: rgba(52, 152, 219, 0.1);
        color: #3498db;
    }
    
    .indicator-item.active {
        color: #3498db;
    }
    
    .indicator-item.active::after {
        background-color: #3498db;
    }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    .carousel-slide::before {
        background-color: rgba(0, 0, 0, 0.6);
    }
    
    .indicator-item {
        border: 1px solid #cccccc;
    }
    
    .content-button {
        border: 2px solid #ffffff;
    }
}

/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
    .geniatech-content-carousel-slide,
    .geniatech-content-slide-content,
    .geniatech-content-image,
    .geniatech-content-title,
    .geniatech-content-description,
    .geniatech-content-button-wrapper,
    .geniatech-content-button,
    .geniatech-content-indicator-item {
        animation: none;
        transition: none;
    }
    
    .geniatech-content-carousel-slide {
        transition: opacity 0.1s ease;
    }
}
