/* ============================================
   PINNACLE AI SOLUTIONS — UI ENHANCEMENTS
   ============================================ */

/* ---- 1. PAGE FADE TRANSITION ---- */
body {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

body.page-exit {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ---- 2. SCROLL ANIMATIONS (extended) ---- */
.enhance-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.enhance-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.enhance-fade-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.enhance-fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.enhance-fade-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.enhance-fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.enhance-scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.enhance-scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children delays */
.enhance-stagger>*:nth-child(1) {
    transition-delay: 0s;
}

.enhance-stagger>*:nth-child(2) {
    transition-delay: 0.1s;
}

.enhance-stagger>*:nth-child(3) {
    transition-delay: 0.2s;
}

.enhance-stagger>*:nth-child(4) {
    transition-delay: 0.3s;
}

.enhance-stagger>*:nth-child(5) {
    transition-delay: 0.4s;
}

.enhance-stagger>*:nth-child(6) {
    transition-delay: 0.5s;
}

/* ---- 3. BLOG CARD 3D TILT + GLOW ---- */
.blog-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease !important;
    transform-style: preserve-3d;
    will-change: transform;
}

.blog-card:hover {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(139, 92, 246, 0.15) !important;
}

.blog-card .card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.blog-card:hover .card-glow {
    opacity: 1;
}

/* ---- 6. STICKY DESKTOP CTA ---- */
.sticky-cta {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    background: rgba(3, 7, 18, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.sticky-cta.visible {
    bottom: 30px;
}

.sticky-cta-text {
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
}

.sticky-cta-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.sticky-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

@media (max-width: 768px) {
    .sticky-cta {
        display: none !important;
    }
}

/* ---- 7. MICRO-INTERACTIONS ---- */

/* Button ripple effect */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Nav link underline slide */
.enhance-nav-link {
    position: relative;
}

.enhance-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

.enhance-nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* Form input focus glow */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 0 15px rgba(59, 130, 246, 0.1) !important;
    border-color: #3b82f6 !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* ---- 8. READING PROGRESS BAR ---- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #22c55e, #a855f7);
    z-index: 999999;
    transition: width 0.1s linear;
}

/* ---- 9. BACK-TO-TOP BUTTON ---- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9990;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: translateY(-3px);
}

/* ---- 10. ENHANCED FOOTER ---- */
.enhanced-footer {
    background: rgba(3, 7, 18, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 60px 40px 30px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto 40px;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 20px;
}

.footer-col a {
    display: block;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 0;
    transition: color 0.2s, transform 0.2s;
}

.footer-col a:hover {
    color: #3b82f6;
    transform: translateX(4px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #475569;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-col a:hover {
        transform: none;
    }
}

/* ---- 11. GLOBAL MODERN HEADER ---- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 99999;
    display: flex;
    justify-content: center;
    overflow: visible;
}

.header-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.logo-animated {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #00f3ff, #bd00ff, #ff00aa, #00ff9d, #00f3ff);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    text-transform: uppercase;
    animation: logoGradientMove 4s ease infinite;
    text-shadow: 0 0 30px rgba(0, 243, 255, 0.5);
    white-space: nowrap;
}

@keyframes logoGradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.header-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.header-link:hover,
.header-link.active {
    color: #fff;
}

.header-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header-link:hover::after,
.header-link.active::after {
    width: 80%;
}

.shader-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 30px;
    overflow: hidden;
    flex: 1;
    max-width: 350px;
    margin: 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.shader-pill canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-secondary-nav {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.btn-primary-nav {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 32px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(3, 7, 18, 0.98);
    backdrop-filter: blur(20px);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 99998;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-link {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 12px;
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
}

.mobile-nav-btn {
    font-size: 1rem;
    font-weight: 700;
    padding: 16px;
    text-decoration: none;
    text-align: center;
    border-radius: 12px;
    display: block;
    margin-bottom: 5px;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.mobile-nav-btn.primary {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.mobile-cta-bar {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: rgba(3, 7, 18, 0.95);
    z-index: 9990;
    gap: 12px;
}

.mobile-cta-btn {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 5px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 1024px) {

    .header-nav-links,
    .shader-pill,
    .header-buttons {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-cta-bar {
        display: flex;
    }
}

/* ---- 12. MOBILE & NAVIGATION GLOBAL FIXES ---- */
/* Migrated from index.html inline styles */

.mobile-nav-link:active {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.mobile-nav-btn {
    font-size: 1rem;
    font-weight: 700;
    padding: 16px;
    text-decoration: none;
    text-align: center;
    border-radius: 12px;
    display: block;
    margin-bottom: 5px;
}

.mobile-nav-btn {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.mobile-nav-btn.primary {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Body Padding Fix */
/* CRITICAL RESET AND OVERFLOW FIX */
html,
body.enhanced-body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* Strict overflow hiding */
    position: relative;
    margin: 0;
    padding: 0;
    padding-top: 70px !important;
}

/* Prevent media from causing overflow */
iframe,
canvas,
img,
video,
svg {
    max-width: 100%;
}

/* Specifically target Codepen iframes */
.codepen-full-bg-iframe {
    max-width: 100vw;
    width: 100%;
}

/* Mobile CTA Bar Styles */
.mobile-cta-bar {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9990;
    /* Below header */
    justify-content: center;
    gap: 12px;
    box-sizing: border-box;
}

.mobile-cta-btn {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 5px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s;
}

.mobile-cta-btn:active {
    transform: scale(0.98);
}

.mobile-cta-btn.secondary {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.mobile-cta-btn.primary {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Media Queries */
@media (max-width: 1024px) {

    /* Hide desktop nav elements on mobile */
    .header-nav-links,
    .header-shader-spacer,
    .header-buttons {
        display: none !important;
    }

    .mobile-cta-bar {
        display: flex;
        /* Show CTA bar on mobile */
    }

    body {
        padding-top: 110px !important;
        /* Adjusted to remove gap */
    }

    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .header-container {
        justify-content: center;
        /* Center the logo */
        position: relative;
        width: 100%;
        padding: 0 70px 0 20px;
        /* Right padding for hamburger */
    }

    .header-logo {
        margin: 0 auto;
        text-align: center;
    }

    .header-logo a,
    .logo-animated {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {

    .header-logo a,
    .logo-animated {
        font-size: 0.95rem !important;
        letter-spacing: 1px !important;
    }

    .header-container {
        padding: 0 60px 0 15px;
    }

    .mobile-menu-toggle {
        right: 15px;
    }
}


/* --- PINNACLE AI MASTER UI: MOBILE & DESKTOP UNIFICATION --- */

/* 1. GLOBAL BUTTON & LINK FIXES */
.btn-free-resources,
.header-buttons a,
.contact-btn {
    width: auto !important;
    max-width: fit-content;
    padding: 10px 22px !important;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Enhanced Contact Button Glow */
.contact-btn,
[href*="contact"] {
    background: linear-gradient(45deg, #00f2ff, #7000ff) !important;
    color: white !important;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
    border: none;
}

.contact-btn:hover {
    box-shadow: 0 0 25px rgba(112, 0, 255, 0.6);
    transform: translateY(-2px);
}

/* 2. MOBILE SIDEBAR (Starry Night, Left-Side, Fitted Width) */
@media (max-width: 991px) {

    .mobile-nav-container,
    .mobile-nav-drawer,
    .explore-sidebar,
    #side-menu {
        position: fixed;
        top: 0;
        left: 0 !important;
        width: 270px !important;
        /* Ends right after the text for a cleaner look */
        height: 100vh;
        background: #05070a !important;
        border-right: 2px solid #00f2ff;
        border-right: 2px solid #00f2ff;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
        z-index: 10000;
        padding: 70px 20px 20px 20px;
    }

    .mobile-nav-container a,
    .mobile-nav-drawer a,
    .explore-sidebar a {
        display: block;
        color: #e0e0e0 !important;
        padding: 18px 12px;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-family: Orbitron, sans-serif;
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .mobile-nav-container a:hover {
        color: #00f2ff !important;
        background: rgba(0, 242, 255, 0.05);
    }
}

/* 3. DESKTOP HEADER NAVIGATION */
@media (min-width: 992px) {
    .mobile-nav-container {
        position: static;
        width: 100% !important;
        height: auto;
        background: transparent !important;
        display: flex !important;
        flex-direction: row;
        justify-content: flex-end;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .mobile-nav-container a {
        color: white;
        padding: 0 20px;
        font-size: 1rem;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
}

/* 4. CONTACT POPUP (Modal) STYLING */
/* Ensures the contact info pops up correctly over any page content */
#contact-popup,
.contact-modal {
    background: rgba(10, 11, 22, 0.98) !important;
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.contact-info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
}

/* 5. CLEANUP: HIDE CODE FRAGMENTS & "LEAD SCRAPER" LABELS */
/* This hides the visible tags and the extra text under buttons */
[class*="hero-section"],
[class*="demo-section"],
.indent-text,
.lead-scraper-label {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none;
}