/* Specialties Section Layout */
.specialties-section {
    padding: 10rem 0;
    background: var(--bg-light);
    position: relative;
    overflow: hidden; /* Prevent horizontal scroll from scaled circle */
    width: 100%;
}

.specialties-container {
    position: relative;
    height: 700px;
    margin-top: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.specialties-circle-wrapper {
    position: relative;
    width: 650px;
    height: 650px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.specialties-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(15, 92, 77, 0.2);
    border-radius: 50%;
    animation: rotate 60s linear infinite;
}

.specialties-inner-orbit {
    position: absolute;
    width: 70%;
    height: 70%;
    border: 1px solid rgba(168, 130, 76, 0.1);
    border-radius: 50%;
}

.center-hub {
    position: relative;
    width: 180px;
    height: 180px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    z-index: 10;
    border: 8px solid var(--bg-light);
}

.center-hub .count {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.center-hub .label {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.specialty-item {
    position: absolute;
    width: 155px;
    height: 155px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.specialty-content {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    padding: 1rem;
    text-align: center;
    transition: inherit;
}

.specialty-item:hover .specialty-content {
    transform: scale(1.1);
    background: var(--primary);
    box-shadow: 0 20px 40px rgba(15, 92, 77, 0.3);
    border-color: var(--primary);
}

.specialty-item:hover h4 {
    color: white;
}

.specialty-item:hover img {
    filter: brightness(0) invert(1);
}

.specialty-content img {
    width: 42px;
    height: 42px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.specialty-content h4 {
    font-size: 0.85rem;
    color: var(--text-main);
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Detail View Styles */
.specialty-detail {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    animation: fadeIn 0.5s ease;
}

.detail-image {
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    height: 500px;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-back {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 0;
    margin-bottom: 1rem;
}

.detail-content h2 {
    font-size: 3rem;
    color: var(--primary);
    margin: 0;
}

.detail-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.8;
}

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

@media (max-width: 992px) {
    .specialties-container {
        height: auto;
        min-height: 600px;
    }
    .specialties-circle-wrapper {
        width: 100%;
        height: 500px;
    }
    .center-hub {
        width: 130px;
        height: 130px;
    }
    .center-hub .count { font-size: 2.5rem; }
    .specialty-item {
        width: 110px;
        height: 110px;
    }
    .specialty-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .detail-image {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .specialties-section {
        padding: 6rem 0;
    }
    /* Switch to grid/list for mobile reliability */
    .specialties-container {
        display: block;
        height: auto;
    }
    .specialties-circle-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        width: 100%;
        height: auto;
        padding: 1rem;
    }
    .center-hub, .specialties-orbit, .specialties-inner-orbit {
        display: none !important;
    }
    .specialty-item {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100%;
        height: auto;
    }
    .specialty-content {
        aspect-ratio: 1;
        border-radius: 24px;
        padding: 1.5rem 1rem;
    }
    .specialty-content h4 { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .specialties-circle-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 0.5rem !important;
    }
    .specialty-content {
        padding: 1rem 0.5rem !important;
    }
    .specialty-content h4 {
        font-size: 0.75rem !important;
    }
    .detail-content h2 {
        font-size: 2rem;
    }
}
