/**
 * Mobile Logo Fix
 * Sevenfold Consulting Website
 *
 * Fixes logo cutoff issue on mobile devices
 * Applied ONLY to mobile viewports
 */

/* Mobile-specific logo fixes */
@media screen and (max-width: 768px) {
    /* Hero section padding adjustment */
    .hero {
        padding-top: 100px !important; /* Reduced from 120px to give more room */
        padding-bottom: 60px !important;
    }

    /* Logo container fixes */
    .logo-hero-container {
        margin-bottom: 30px !important; /* Reduced margin */
        padding: 0 !important; /* Remove extra padding */
        min-height: auto !important; /* Allow natural height */
        overflow: visible !important; /* Ensure nothing is clipped */
    }

    /* Logo scaling and positioning - OVERRIDE INLINE STYLES */
    .hero .logo-full,
    .hero-content .logo-full,
    .logo-hero-container .logo-full {
        transform: scale(1.0) !important; /* Match index.html mobile breakpoint */
        transform-origin: center center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important; /* Adjusted gap to match scale increase */
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        top: 0 !important; /* Reset any positioning */
    }

    /* Override the animated dots size */
    .logo-dots-animated,
    .logo-dots-hero {
        width: 80px !important; /* Smaller on mobile */
        height: 80px !important;
        position: relative !important;
    }

    /* Individual dots sizing and positioning */
    .logo-dots-animated div,
    .logo-dots-hero div {
        width: 12px !important;
        height: 12px !important;
        border-radius: 50% !important;
        position: absolute !important;
    }

    /* Reposition dots for mobile to prevent overlap */
    .logo-dots-animated div:nth-child(1) { top: 0 !important; left: 0 !important; }
    .logo-dots-animated div:nth-child(2) { top: 0 !important; left: 20px !important; }
    .logo-dots-animated div:nth-child(3) { top: 0 !important; left: 40px !important; }
    .logo-dots-animated div:nth-child(4) { top: 0 !important; left: 60px !important; }
    .logo-dots-animated div:nth-child(5) { top: 20px !important; left: 45px !important; }
    .logo-dots-animated div:nth-child(6) { top: 40px !important; left: 35px !important; }
    .logo-dots-animated div:nth-child(7) { bottom: 0 !important; left: 20px !important; }

    /* Logo text - Override inline styles */
    .logo-text-hero,
    .logo-text-main {
        font-size: 2.5em !important; /* Match index.html mobile breakpoint */
        font-weight: 300 !important;
        letter-spacing: -1.5px !important;
        white-space: nowrap !important; /* Prevent text wrapping */
        overflow: visible !important; /* Ensure text isn't clipped */
    }
}

/* Smaller mobile devices */
@media screen and (max-width: 480px) {
    .hero {
        padding-top: 90px !important; /* Even less top padding */
    }

    .logo-hero-container {
        margin-bottom: 25px !important;
    }

    .hero .logo-full,
    .hero-content .logo-full,
    .logo-hero-container .logo-full {
        transform: scale(0.85) !important; /* Proportionally adjusted for 480px */
        gap: 12px !important;
    }

    .logo-dots-animated,
    .logo-dots-hero {
        width: 70px !important;
        height: 70px !important;
    }

    .logo-dots-animated div,
    .logo-dots-hero div {
        width: 10px !important;
        height: 10px !important;
    }

    /* Adjust dot positions for smaller screens */
    .logo-dots-animated div:nth-child(1) { top: 0 !important; left: 0 !important; }
    .logo-dots-animated div:nth-child(2) { top: 0 !important; left: 17px !important; }
    .logo-dots-animated div:nth-child(3) { top: 0 !important; left: 34px !important; }
    .logo-dots-animated div:nth-child(4) { top: 0 !important; left: 51px !important; }
    .logo-dots-animated div:nth-child(5) { top: 17px !important; left: 38px !important; }
    .logo-dots-animated div:nth-child(6) { top: 34px !important; left: 29px !important; }
    .logo-dots-animated div:nth-child(7) { bottom: 0 !important; left: 17px !important; }

    .logo-text-hero,
    .logo-text-main {
        font-size: 2.1em !important;
        letter-spacing: -1px !important;
    }
}

/* Very small mobile devices */
@media screen and (max-width: 375px) {
    .hero {
        padding-top: 85px !important;
    }

    .logo-hero-container {
        margin-bottom: 20px !important;
    }

    .hero .logo-full,
    .hero-content .logo-full,
    .logo-hero-container .logo-full {
        transform: scale(0.75) !important;
        gap: 10px !important;
    }

    .logo-dots-animated,
    .logo-dots-hero {
        width: 60px !important;
        height: 60px !important;
    }

    .logo-dots-animated div,
    .logo-dots-hero div {
        width: 9px !important;
        height: 9px !important;
    }

    /* Further adjust dot positions for very small screens */
    .logo-dots-animated div:nth-child(1) { top: 0 !important; left: 0 !important; }
    .logo-dots-animated div:nth-child(2) { top: 0 !important; left: 15px !important; }
    .logo-dots-animated div:nth-child(3) { top: 0 !important; left: 30px !important; }
    .logo-dots-animated div:nth-child(4) { top: 0 !important; left: 45px !important; }
    .logo-dots-animated div:nth-child(5) { top: 15px !important; left: 34px !important; }
    .logo-dots-animated div:nth-child(6) { top: 30px !important; left: 25px !important; }
    .logo-dots-animated div:nth-child(7) { bottom: 0 !important; left: 15px !important; }

    .logo-text-hero,
    .logo-text-main {
        font-size: 1.9em !important;
        letter-spacing: -0.5px !important;
    }
}

/* iPhone SE and similar small devices */
@media screen and (max-width: 320px) {
    .hero {
        padding-top: 80px !important;
    }

    .hero .logo-full,
    .hero-content .logo-full,
    .logo-hero-container .logo-full {
        transform: scale(0.65) !important;
    }

    .logo-dots-animated,
    .logo-dots-hero {
        width: 50px !important;
        height: 50px !important;
    }

    .logo-text-hero,
    .logo-text-main {
        font-size: 1.6em !important;
    }
}

/* Ensure logo is never cut off at the top */
@media screen and (max-width: 768px) {
    /* Add safe area for iOS devices */
    .hero {
        padding-top: calc(80px + env(safe-area-inset-top)) !important;
    }

    /* Prevent any overflow clipping */
    body,
    html {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    /* Ensure hero content doesn't overflow */
    .hero-content {
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

/* CRITICAL FIX: Disable dropFlipSequence animations on mobile */
@media screen and (max-width: 768px) {
    /* Force disable ALL animations on logo dots for mobile */
    .logo-dots-animated div,
    .logo-dots-hero div {
        animation: none !important;
        animation-name: none !important;
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        animation-fill-mode: none !important;
        animation-play-state: paused !important;

        /* Set static visible state - override dropFlipSequence transforms */
        transform: translateY(0) scale(1) rotateY(0deg) !important;
        opacity: 1 !important;

        /* Ensure dots are visible and properly positioned */
        display: block !important;
        visibility: visible !important;

        /* Force static positioning */
        position: absolute !important;
    }

    /* Additional safety - disable any remaining glow animations */
    .logo-dots-animated div:nth-child(1),
    .logo-dots-animated div:nth-child(2),
    .logo-dots-animated div:nth-child(3),
    .logo-dots-animated div:nth-child(4),
    .logo-dots-animated div:nth-child(5),
    .logo-dots-animated div:nth-child(6),
    .logo-dots-animated div:nth-child(7) {
        animation: none !important;
        transform: translateY(0) scale(1) rotateY(0deg) !important;
        opacity: 1 !important;
    }

    /* Ensure logo container itself has no conflicting animations */
    .logo-dots-animated,
    .logo-dots-hero {
        animation: none !important;
        transform: none !important;
    }
}

/* Debug helper - remove in production */
@media screen and (max-width: 768px) {
    /* Visual boundary helper - comment out when not debugging */
    /*
    .logo-hero-container {
        border: 1px dashed red !important;
    }

    .logo-full {
        border: 1px dashed blue !important;
    }
    */
}