/**
 * Services Infographic Mobile Fix
 * Sevenfold Consulting
 *
 * Displays the desktop version scaled down proportionally for mobile
 * Maintains exact desktop layout with all elements visible
 */

/* Mobile devices - 768px and below */
@media screen and (max-width: 768px) {
    /* Container - adjusted for proper spacing */
    .services-infographic {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 450px !important;
        margin: 20px auto !important;
        padding: 10px !important;
        transform: scale(0.45) !important;
        transform-origin: center center !important;
    }

    /* Hub container - maintain desktop positioning */
    .services-hub {
        position: relative !important;
        width: 1000px !important;
        height: 700px !important;
        display: block !important;
        margin: 0 auto !important;
    }

    /* Central hub - smaller for mobile */
    .hub-center {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 120px !important;
        height: 120px !important;
        background: linear-gradient(135deg, var(--primary-blue), var(--sky-blue)) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
    }

    .hub-text {
        font-size: 1.1em !important;
        line-height: 1.2 !important;
        text-align: center !important;
        color: white !important;
        font-weight: 600 !important;
    }

    /* Service nodes - uniform size to prevent overlap */
    .service-node {
        position: absolute !important;
        width: 200px !important;
        height: 140px !important; /* Fixed height for uniform sizing */
        background: white !important;
        border-radius: 15px !important;
        padding: 18px !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border: 3px solid transparent !important; /* Uniform 3px border */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
        box-sizing: border-box !important; /* Include border in dimensions */
    }

    /* Node positioning - increased radius to 280px to prevent overlap */
    /* Math: Hub radius (60px) + clearance (20px) + node half-width (100px) + buffer (100px) = 280px */

    /* Node 1 - Top (12 o'clock position) */
    .service-node.node-1 {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) translateY(-280px) !important;
        border-color: var(--primary-blue) !important;
    }

    /* Node 2 - Top Right (2 o'clock position - 60 degrees) */
    .service-node.node-2 {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) rotate(60deg) translateY(-280px) rotate(-60deg) !important;
        border-color: var(--sky-blue) !important;
    }

    /* Node 3 - Bottom Right (4 o'clock position - 120 degrees) */
    .service-node.node-3 {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) rotate(120deg) translateY(-280px) rotate(-120deg) !important;
        border-color: var(--golden-yellow) !important;
        height: 140px !important; /* Ensure same height as node 1 */
        width: 200px !important; /* Ensure same width as node 1 */
    }

    /* Node 4 - Bottom (6 o'clock position - 180 degrees) */
    .service-node.node-4 {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) translateY(280px) !important;
        border-color: var(--vibrant-orange) !important;
        height: 140px !important; /* Ensure same height as node 1 */
        width: 200px !important; /* Ensure same width as node 1 */
    }

    /* Node 5 - Bottom Left (8 o'clock position - 240 degrees) */
    .service-node.node-5 {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) rotate(240deg) translateY(-280px) rotate(-240deg) !important;
        border-color: var(--soft-pink) !important;
    }

    /* Node 6 - Top Left (10 o'clock position - 300 degrees) */
    .service-node.node-6 {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) rotate(300deg) translateY(-280px) rotate(-300deg) !important;
        border-color: var(--navy) !important;
    }

    /* Node icons - adjusted for uniform nodes */
    .service-node .node-icon {
        width: 35px !important;
        height: 35px !important;
        margin-bottom: 8px !important;
        margin-top: 0 !important;
        background: linear-gradient(135deg, #f0f7ff, #e6f2ff) !important;
        border-radius: 8px !important;
        padding: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .service-node .node-icon svg {
        width: 25px !important;
        height: 25px !important;
    }

    /* Node content - compact and uniform for mobile */
    .service-node .node-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        height: 100% !important;
        justify-content: center !important;
    }

    .service-node .node-content h3 {
        font-size: 0.85em !important;
        color: var(--navy) !important;
        margin-bottom: 6px !important;
        margin-top: 0 !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        max-height: 2.4em !important; /* Limit to 2 lines */
        overflow: hidden !important;
    }

    /* Show descriptions but smaller and constrained */
    .service-node .node-content p {
        display: block !important;
        font-size: 0.7em !important;
        color: var(--gray) !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        max-height: 2.8em !important; /* Limit to 2 lines */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Hover effects - maintaining increased radius */
    .service-node:hover {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    }

    .service-node.node-1:hover {
        transform: translate(-50%, -50%) translateY(-285px) scale(1.02) !important;
    }

    .service-node.node-2:hover {
        transform: translate(-50%, -50%) rotate(60deg) translateY(-285px) rotate(-60deg) scale(1.02) !important;
    }

    .service-node.node-3:hover {
        transform: translate(-50%, -50%) rotate(120deg) translateY(-285px) rotate(-120deg) scale(1.02) !important;
    }

    .service-node.node-4:hover {
        transform: translate(-50%, -50%) translateY(285px) scale(1.02) !important;
    }

    .service-node.node-5:hover {
        transform: translate(-50%, -50%) rotate(240deg) translateY(-285px) rotate(-240deg) scale(1.02) !important;
    }

    .service-node.node-6:hover {
        transform: translate(-50%, -50%) rotate(300deg) translateY(-285px) rotate(-300deg) scale(1.02) !important;
    }
}

/* Smaller mobile devices - 480px */
@media screen and (max-width: 480px) {
    .services-infographic {
        height: 380px !important;
        transform: scale(0.38) !important;
    }
}

/* Very small devices - 375px */
@media screen and (max-width: 375px) {
    .services-infographic {
        height: 320px !important;
        transform: scale(0.32) !important;
    }
}

/* iPhone SE and similar - 320px */
@media screen and (max-width: 320px) {
    .services-infographic {
        height: 280px !important;
        transform: scale(0.28) !important;
    }
}

/* Override any conflicting styles from other CSS files */
@media screen and (max-width: 768px) {
    /* Maintain desktop block layout */
    .services-hub {
        display: block !important;
        position: relative !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }

    /* Keep absolute positioning for desktop-like layout */
    .service-node {
        position: absolute !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        height: 140px !important; /* Fixed height for uniform sizing */
    }

    /* Remove any animation but keep positioning transforms */
    .service-node.node-1,
    .service-node.node-2,
    .service-node.node-3,
    .service-node.node-4,
    .service-node.node-5,
    .service-node.node-6 {
        animation: none !important;
        rotate: none !important;
        transition: box-shadow 0.3s ease, transform 0.3s ease !important;
    }

    /* Ensure visibility */
    .services-infographic * {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Ensure content displays correctly */
    .service-node .node-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Disable grid layout from mobile-styles.css */
    .services-hub[style*="display: grid"] {
        display: block !important;
    }

    /* Override any inline transforms that break layout */
    .service-node[style*="rotate"] {
        rotate: none !important;
    }
}