/* 3D Anatomical Figure in Hero - Small Floating Hologram */

/* Periodic glow for floating hologram */
@keyframes hologramPeriodicGlow {
    0%, 85%, 100% {
        box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3), 0 0 0 2px rgba(76, 175, 80, 0.2);
    }
    86%, 94% {
        box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3), 0 0 0 2px rgba(76, 175, 80, 0.2), 0 0 25px 8px rgba(76, 175, 80, 0.5);
    }
}

/* Floating Hologram - Small icon on hero section */
.floating-hologram {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 130px;
    cursor: pointer;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: hologramPeriodicGlow 6s ease-in-out infinite;
}

.floating-hologram:hover {
    transform: scale(1.1) translateY(-5px);
    animation-play-state: paused;
}

.hologram-glow {
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: hologramPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hologramPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.hologram-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3),
                0 0 0 2px rgba(76, 175, 80, 0.2);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.mini-body-icon {
    width: 60%;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(76, 175, 80, 0.4));
}

.hologram-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-top: 4px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Anatomy Viewer Modal */
.anatomy-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.anatomy-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.anatomy-modal-content {
    background: #0d1b2a;
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    height: 90vh;
    max-height: 820px;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 180, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.anatomy-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 180, 255, 0.15);
    border: 1.5px solid rgba(0, 180, 255, 0.4);
    color: #a0d8f0;
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 10;
    font-weight: 300;
}

.anatomy-modal-close:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
    transform: rotate(90deg);
}

.anatomy-modal-header {
    background: linear-gradient(135deg, #0d2137 0%, #0a3055 100%);
    color: #e0f4ff;
    padding: 1.5rem 2.5rem;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid rgba(0, 180, 255, 0.25);
    flex-shrink: 0;
}

.anatomy-modal-header h2 {
    font-size: 1.7rem;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.anatomy-modal-header p {
    font-size: 0.95rem;
    opacity: 0.85;
    margin: 0;
    color: rgba(0, 200, 255, 0.9);
}

.anatomy-modal-header .tag-joint {
    background: rgba(255, 107, 107, 0.35);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #ffaaaa;
}

.anatomy-modal-header .tag-resp {
    background: rgba(77, 171, 247, 0.35);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #a0d8ff;
}

/* anatomy-viewer-body is a direct flex child of anatomy-modal-content */
.anatomy-viewer-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f1923;
}

.threejs-container {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

.threejs-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.viewer-controls {
    flex-shrink: 0;
    padding: 0.75rem 2rem;
    background: rgba(10, 20, 35, 0.97);
    border-top: 1px solid rgba(0, 180, 255, 0.2);
    text-align: center;
}

.viewer-controls p {
    margin: 0;
    color: rgba(0, 200, 255, 0.75);
    font-size: 0.9rem;
}

/* Hotspot pulse animation */
@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 0 4px transparent, 0 0 10px var(--hs-color, #ff6b6b); transform: translate(-50%, -50%) scale(1); }
    50%       { box-shadow: 0 0 0 8px rgba(255,107,107,0.2), 0 0 20px var(--hs-color, #ff6b6b); transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scaleX(1); }
    50%       { opacity: 1;   transform: translateX(-50%) scaleX(1.15); }
}
/* Mobile responsive */
@media (max-width: 768px) {
    .floating-hologram {
        width: 60px;
        height: 80px;
        bottom: 20px;
        right: 15px;
    }

    .hologram-content {
        padding: 8px;
    }

    .hologram-label {
        font-size: 0.55rem;
    }

    .mini-body-icon {
        width: 80%;
    }

    /* Conditions section — prevent horizontal overflow */
    .body-diagram-section {
        overflow-x: hidden;
        width: 100%;
    }

    .body-diagram-container {
        overflow-x: hidden;
        width: 100%;
        padding: 0 1rem;
    }

    .diagram-legend {
        padding: 0.75rem 0;
        width: 100%;
    }

    /* Single column with compact horizontal rectangles on mobile */
    .legend-items {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        max-width: 100%;
        width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .legend-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.875rem 1rem;
        gap: 0.5rem;
        border-radius: 12px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.95);
    }

    /* Icon and title on the same line */
    .legend-item {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .legend-icon {
        font-size: 1.35rem;
        flex-shrink: 0;
    }

    .legend-text {
        flex: 1;
        min-width: 0;
    }

    .legend-text h4 {
        font-size: 0.95rem;
        margin: 0;
        line-height: 1.2;
    }

    .legend-text p {
        font-size: 0.8rem;
        margin: 0.35rem 0 0 0;
        line-height: 1.3;
        width: 100%;
    }

    .hologram-label {
        font-size: 0.65rem;
    }

    .anatomy-modal-content {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .anatomy-modal-header {
        padding: 1.5rem;
        border-radius: 0;
    }

    .anatomy-modal-header h2 {
        font-size: 1.5rem;
    }

    .anatomy-modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
    }
}

/* Old section styles */
.body-diagram-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 80px 0;
    width: 100%;
    overflow-x: hidden;
}

.body-diagram-container {
    max-width: 1400px;
    margin: 0 auto;
    display: block;
    padding: 0 2rem;
    width: 100%;
    overflow-x: hidden;
}

.diagram-intro {
    text-align: center;
    padding: 2rem;
}

.diagram-intro h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.diagram-intro p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
}

.diagram-legend {
    text-align: center;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    justify-items: center;
    align-items: stretch;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.legend-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.legend-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.legend-text {
    text-align: left;
}

.legend-text h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.legend-text p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.body-diagram-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.body-diagram-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Body part hover states */
.body-part {
    cursor: pointer;
    transition: all 0.3s ease;
}

.body-part:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
    transform-origin: center;
}

.body-part.joint {
    fill: #ff6b6b;
    stroke: #c92a2a;
    stroke-width: 2;
}

.body-part.respiratory {
    fill: #4dabf7;
    stroke: #1971c2;
    stroke-width: 2;
}

.body-part:hover {
    opacity: 0.8;
}

.body-part.active {
    fill: #ffd43b;
    stroke: #f59f00;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

/* Condition Explainer Modal */
.condition-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.condition-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.condition-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.condition-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #45a049 100%);
    color: var(--white);
    padding: 2.5rem;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.condition-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.condition-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.condition-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.condition-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.condition-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.condition-body {
    padding: 2.5rem;
}

.condition-section {
    margin-bottom: 2.5rem;
}

.condition-section:last-child {
    margin-bottom: 0;
}

.condition-section h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.3rem;
}

.condition-section p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.condition-section ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.condition-section li {
    padding: 0.8rem 0;
    color: var(--text-light);
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.condition-section li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.treatment-timeline {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.timeline-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.timeline-step {
    text-align: center;
    position: relative;
}

.timeline-step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.timeline-step h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.timeline-step p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.comparison-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.comparison-card.homeopathy {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
}

.comparison-card.conventional {
    border-color: #e0e0e0;
}

.comparison-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.comparison-card ul li:before {
    content: "•";
}

.comparison-card.homeopathy ul li:before {
    content: "✓";
    color: var(--primary-color);
}

.comparison-card.conventional ul li:before {
    content: "⚠";
    color: #ff9800;
}

.condition-cta {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
}

.condition-cta h4 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.condition-cta p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.success-stats {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 1200px) {
    .legend-items {
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    /* keep 4 per row at 1200px */
}

@media (max-width: 768px) {
    .body-diagram-section {
        padding: 60px 0;
    }

    .hero-3d-figure {
        height: 450px;
        max-width: 100%;
    }

    .figure-3d-wrapper {
        width: 280px;
        height: 400px;
    }

    .interactive-guide-cta {
        padding: 0.8rem 1rem;
        max-width: 300px;
    }

    .interactive-guide-cta h4 {
        font-size: 1rem;
    }

    .interactive-guide-cta p {
        font-size: 0.85rem;
    }

    .condition-content {
        margin: 1rem;
        max-height: 95vh;
    }

    .condition-header {
        padding: 2rem;
    }

    .condition-header h2 {
        font-size: 1.8rem;
    }

    .condition-body {
        padding: 1.5rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .timeline-steps {
        grid-template-columns: 1fr;
    }

    .success-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    /* Keep single column with compact horizontal rectangles on mobile */
    .legend-items {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        max-width: 100%;
        width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .legend-item {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.875rem 1rem;
        gap: 0.5rem;
        border-radius: 12px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.95);
    }

    .legend-icon {
        font-size: 1.35rem;
        flex-shrink: 0;
    }

    .legend-text {
        flex: 1;
        min-width: 0;
    }

    .legend-text h4 {
        font-size: 0.95rem;
        margin: 0;
        line-height: 1.2;
    }

    .legend-text p {
        font-size: 0.8rem;
        margin: 0.35rem 0 0 0;
        line-height: 1.3;
        width: 100%;
    }
    
    @keyframes rotate3D {
        0% {
            transform: rotateY(0deg) rotateX(0deg) scale(0.95);
        }
        50% {
            transform: rotateY(180deg) rotateX(0deg) scale(1);
        }
        100% {
            transform: rotateY(360deg) rotateX(0deg) scale(0.95);
        }
    }
}

/* Anatomy viewer loader spinner */
@keyframes anatSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Mobile: stack 3D viewer above cards */
@media (max-width: 600px) {
    .threejs-container {
        flex-direction: column !important;
    }
}
