/* 同心圆旋转动画 */
@keyframes rotate-clockwise {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotate-counter-clockwise {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

/* Solution Advantages Circle Layout */
.solution-advantages-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.advantages-circle {
    position: relative;
    max-width: 100%;
    padding-top: 100%; /* Square aspect ratio for the circle container */
    overflow: visible;
}

.advantages-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32%;
    height: 32%;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--color-primary);
    text-align: center;
    padding: 2rem;
    z-index: 30;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 外圈 - 顺时针旋转 */
.advantages-center::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    border: 2px dashed var(--color-primary);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    animation: rotate-clockwise 15s linear infinite;
    animation-play-state: paused;
    z-index: 1;
}

/* 内圈 - 逆时针旋转 */
.advantages-center::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 2px dashed var(--color-primary);
    opacity: 0;
    transition: opacity 0.4s ease 0.1s;
    pointer-events: none;
    animation: rotate-counter-clockwise 12s linear infinite;
    animation-play-state: paused;
    z-index: 1;
}

.advantages-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* 悬停时显示并启动旋转动画 */
.advantages-center:hover::before {
    opacity: 1;
    animation-play-state: running;
}

.advantages-center:hover::after {
    opacity: 1;
    animation-play-state: running;
}

.advantages-center h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.3;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.advantages-center i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.advantage-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.advantage-content {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    text-align: center;
    z-index: 20;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.advantage-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, border 0.3s ease;
    border: 3px solid #e0e0e0;
}

.advantage-text {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-color 0.3s ease;
}

.advantage-text h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.advantage-text p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Hover effects */
.advantage-content:hover .advantage-icon {
    color: white;
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 71, 107, 0.25);
}

.advantage-content:hover .advantage-text {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left-color: var(--color-primary);
}

.advantage-item:hover .advantage-text {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.advantage-item:hover .advantage-text h4 {
    color: var(--color-primary);
}

/* Connecting lines */
.advantages-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 50%;
    background: #e0e0e0;
    transform-origin: 50% 0;
    transition: background 0.3s ease;
}

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

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

/* Media query for larger screens - ensure proper spacing */
@media (min-width: 1100px) {
    .advantage-content {
        width: 280px;
    }
}

/* For screens between 988px and 1099px - switch to 3-column grid layout */
@media (min-width: 988px) and (max-width: 1099px) {
    .advantages-circle {
        display: none;
    }
    
    .advantages-mobile-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 1000px;
        margin: 0 auto;
    }
    
    /* Ensure proper styling for grid items */
    .advantage-mobile-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        border-left: 4px solid transparent;
        transition: all 0.3s ease;
    }
    
    .advantage-mobile-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-left-color: var(--color-primary);
    }
    
    .advantage-mobile-icon {
        width: 60px;
        height: 60px;
        margin-right: 0;
        margin-bottom: 1rem;
        background: #f8f9fa;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        color: var(--color-primary);
        border: 3px solid #e0e0e0;
        transition: all 0.3s ease;
    }
    
    .advantage-mobile-item:hover .advantage-mobile-icon {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }
    
    .advantage-mobile-text h4 {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #2c3e50;
        transition: color 0.3s ease;
    }
    
    .advantage-mobile-item:hover .advantage-mobile-text h4 {
        color: var(--color-primary);
    }
    
    .advantage-mobile-text p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #666;
        margin: 0;
    }
}

/* For screens between 745px and 987px - switch to 2-column grid layout */
@media (min-width: 745px) and (max-width: 987px) {
    .advantages-circle {
        display: none;
    }
    
    .advantages-mobile-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        max-width: 700px;
        margin: 0 auto;
    }
    
    /* Ensure proper styling for grid items */
    .advantage-mobile-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        border-left: 4px solid transparent;
        transition: all 0.3s ease;
    }
    
    .advantage-mobile-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-left-color: var(--color-primary);
    }
    
    .advantage-mobile-icon {
        width: 60px;
        height: 60px;
        margin-right: 0;
        margin-bottom: 1rem;
        background: #f8f9fa;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        color: var(--color-primary);
        border: 3px solid #e0e0e0;
        transition: all 0.3s ease;
    }
    
    .advantage-mobile-item:hover .advantage-mobile-icon {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }
    
    .advantage-mobile-text h4 {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #2c3e50;
        transition: color 0.3s ease;
    }
    
    .advantage-mobile-item:hover .advantage-mobile-text h4 {
        color: var(--color-primary);
    }
    
    .advantage-mobile-text p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #666;
        margin: 0;
    }
}

/* For screens below 745px - switch to 1-column grid layout */
@media (max-width: 744px) {
    .advantages-circle {
        display: none;
    }
    
    .advantages-mobile-grid {
        display: grid !important;
        grid-template-columns: minmax(300px, 1fr);
        gap: 1.5rem;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 1rem;
    }
    
    .advantage-mobile-item {
        max-width: 100%;
        min-width: 300px;
        margin: 0 auto;
        display: flex;
        align-items: flex-start;
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        border-left: 4px solid transparent;
        transition: all 0.3s ease;
        min-height: 250px;
    }
    
    .advantage-mobile-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-left-color: var(--color-primary);
    }
    
    .advantage-mobile-icon {
        flex-shrink: 0;
        width: 60px;
        height: 60px;
        margin-right: 1rem;
        background: #f8f9fa;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        color: var(--color-primary);
        border: 3px solid #e0e0e0;
        transition: all 0.3s ease;
    }
    
    .advantage-mobile-item:hover .advantage-mobile-icon {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }

    .advantage-mobile-text h4 {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #2c3e50;
        transition: color 0.3s ease;
    }

    .advantage-mobile-item:hover .advantage-mobile-text h4 {
        color: var(--color-primary);
    }
    
    .advantage-mobile-text p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #666;
        margin: 0;
    }
}

/* Hidden by default for mobile */
.advantages-mobile-grid {
    display: none;
}