/*
Theme Name: SEO Next Gen
Theme URI: https://graphicshopllc.com
Author: GraphicShop LLC
Author URI: https://graphicshopllc.com
Description: A modern, high-performance SEO agency theme specialized for conversion and aesthetics. Elementor compatible.
Version: 2.1.1
Text Domain: seo-next-gen
*/

/* 
   =========================================
   1. BASE & WORDPRESS
   =========================================
*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: #000F1E;
    color: #CDCDCD;
    overflow-x: hidden;
    max-width: 100vw;
    background-image: radial-gradient(circle at 50% 0%, #112240 0%, #000F1E 60%);
    perspective: 1200px;
    /* Base perspective for 3D elements */
}

/* Admin Bar Fixes */
.admin-bar nav.fixed {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar nav.fixed {
        top: 46px !important;
    }
}

/* 
   =========================================
   2. NAVBAR & LINKS
   =========================================
*/
.glass-nav {
    background: rgba(0, 15, 30, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: #CDCDCD;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #FF4438;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #FF4438;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* CTA Button */
.cta-btn {
    background: linear-gradient(90deg, #FF4438, #ff6b61) !important;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
    z-index: 10;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-btn:hover {
    background: linear-gradient(90deg, #d63328, #e64a40) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 68, 56, 0.3);
    color: #ffffff !important;
}

/* 
   =========================================
   3. GLASS CARDS (Hybrid)
   =========================================
*/
.glass-card {
    /* Base Look */
    background: linear-gradient(145deg, rgba(2, 21, 38, 0.9), rgba(2, 21, 38, 0.6));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;

    /* Default to overflow hidden for shine effect, 
       BUT overridden by js-tilt for 3D elements */
    overflow: hidden;
}

/* 3D Variation (Services Page) */
.glass-card.js-tilt {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s;
    /* Faster response for tilt */
    background: linear-gradient(145deg, rgba(2, 21, 38, 0.8), rgba(2, 21, 38, 0.4));
    overflow: visible;
    /* Needed for 3D children */
}

.glass-card.js-tilt .glass-card-content {
    transform: translateZ(20px);
}

.glass-card.js-tilt .icon-box {
    transform: translateZ(40px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Shine Effect (::before) - Default */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
    pointer-events: none;
    z-index: 1;
}

.glass-card:hover::before {
    left: 100%;
}

/* Spotlight/Glow Effect (::after) - All Cards */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 68, 56, 0.15), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 0;
    pointer-events: none;
}

.glass-card:hover::after {
    opacity: 1;
}

.glass-card:hover {
    border-color: rgba(0, 80, 255, 0.4);
    box-shadow: 0 15px 50px -10px rgba(0, 80, 255, 0.3);
}

/* Disable generic lift on 3D cards because Tilt handles it */
.glass-card:not(.js-tilt):hover {
    transform: translateY(-8px) scale(1.02);
}

/* 
   =========================================
   4. ANIMATIONS
   =========================================
*/
/* Reveal */
.reveal {
    opacity: 0;
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Fades */
.fade-in-up {
    transform: translateY(50px);
    opacity: 0;
    transition: 0.8s;
}

.fade-in-up.visible,
.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    transform: translateX(-50px);
}

.fade-in-down {
    transform: translateY(-50px);
}

.fade-in-right {
    transform: translateX(50px);
}

.zoom-in {
    transform: scale(0.8);
}

/* Continuous Anims */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 56, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 68, 56, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 56, 0);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes drift {
    0% {
        transform: translate(0px, 0px) scale(1);
        opacity: 0.3;
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
        opacity: 0.5;
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.3;
    }

    100% {
        transform: translate(0px, 0px) scale(1);
        opacity: 0.3;
    }
}

.animate-drift {
    animation: drift 10s ease-in-out infinite;
}

.animate-drift-slow {
    animation: drift 15s ease-in-out infinite reverse;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-scroll {
    animation: scroll 30s linear infinite;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

@keyframes float-seo {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.seo-floater {
    position: absolute;
    animation: float-seo 6s ease-in-out infinite;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: -1;
}

.seo-floater:nth-child(even) {
    animation-duration: 8s;
    animation-direction: reverse;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-animated-bg {
    background: linear-gradient(-45deg, #000F1E, #1a0505, #001a33, #000F1E);
    background-size: 400% 400%;
    animation: gradient-flow 15s ease infinite;
}

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

/* 
   =========================================
   5. PAGE SPECIFIC UTILITIES
   =========================================
*/
/* 3D Utils */
.preserve-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

.perspective {
    perspective: 1000px;
}

/* 3D Tag Cloud */
#tag-cloud-container {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

.tag-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.tag-item:hover {
    color: #FF4438;
    text-shadow: 0 0 15px rgba(255, 68, 56, 0.8);
    z-index: 100 !important;
}

/* FAQ 3D Stack */
.faq-stack-container {
    position: relative;
    perspective: 2000px;
}

.faq-item-3d {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 2rem;
    padding: 2rem;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    transform: rotateX(10deg) scale(0.95);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.faq-item-3d:hover {
    border-color: rgba(255, 68, 56, 0.3);
    transform: rotateX(5deg) scale(0.98) translateZ(20px);
    background: rgba(255, 255, 255, 0.05);
}

.faq-item-3d.active {
    transform: rotateX(0deg) scale(1) translateZ(60px);
    border-color: #FF4438;
    background: rgba(2, 21, 38, 0.95);
    box-shadow: 0 0 50px rgba(255, 68, 56, 0.2);
    z-index: 50;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s;
    opacity: 0.8;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-item-3d.active .faq-answer {
    max-height: 300px;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

/* SEO Grid (Services) */
.seo-grid-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.seo-letter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    padding: 5px;
    filter: drop-shadow(0 0 1px #FF4438) drop-shadow(0 0 3px rgba(255, 68, 56, 0.5));
}

.seo-cell {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    transition: all 0.3s;
}

.seo-cell.fill {
    background: #FF4438;
    box-shadow: 0 0 5px #FF4438;
    opacity: 0;
}

.seo-cell.build-in {
    animation: buildIn 0.5s forwards;
}

@keyframes buildIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* About / Void Card */
.void-card {
    background: linear-gradient(145deg, #021526, #000F1E);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s;
}

.void-card:hover {
    transform: translateY(-10px);
    border-color: #FF4438;
}

.liquid-blob {
    width: 100%;
    height: 100%;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    overflow: hidden;
    animation: blob-morph 8s ease-in-out infinite;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes blob-morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* Icon Box Helper */
.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: rgba(255, 68, 56, 0.05);
    border: 1px solid rgba(255, 68, 56, 0.1);
    color: #FF4438;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

/* Footer Portal Buttons */
.portal-btn-wrap {
    display: inline-block;
}

.portal-btn {
    transition: all 0.3s ease;
}

.portal-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 68, 56, 0.4);
}

/* Text Shimmer */
.text-shimmer {
    background-size: 200% auto;
    animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* CTA Outline Button */
.cta-btn-outline {
    border: 2px solid rgba(255, 68, 56, 0.5);
    color: #FF4438;
    background: transparent;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-btn-outline:hover {
    background: rgba(255, 68, 56, 0.1);
    border-color: #FF4438;
    color: #FF4438;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 68, 56, 0.2);
}

/* Delays */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

/* 
   =========================================
   6. RESPONSIVE OVERRIDES
   =========================================
*/

/* ---- Large Tablet / Small Desktop (max-width: 1024px) ---- */
@media (max-width: 1024px) {

    /* Disable hero parallax 3D on non-desktop */
    .hero-content {
        transform: none !important;
    }

    /* Disable tilt on touch-capable screens */
    .glass-card.js-tilt {
        transform: none !important;
        transform-style: flat;
    }

    .glass-card.js-tilt .glass-card-content,
    .glass-card.js-tilt .icon-box {
        transform: none;
    }

    /* Reduce section vertical padding */
    section {
        padding-top: clamp(3rem, 6vw, 6rem);
        padding-bottom: clamp(3rem, 6vw, 6rem);
    }
}

/* ---- Tablet (max-width: 768px) ---- */
@media (max-width: 768px) {

    /* Global: prevent any horizontal overflow */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Force all sections contained */
    section {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Headings: prevent long words from overflowing */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    /* Container safe padding */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        max-width: 100%;
    }

    /* Disable 3D hover transforms on touch devices */
    .glass-card:not(.js-tilt):hover {
        transform: translateY(-4px);
    }

    .glass-card:hover {
        box-shadow: 0 8px 25px -5px rgba(0, 80, 255, 0.2);
    }

    /* Glass card padding reduction */
    .glass-card {
        padding: 1.25rem;
    }

    /* Flatten FAQ 3D stack on mobile */
    .faq-item-3d {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .faq-item-3d:hover {
        transform: translateY(-4px);
    }

    .faq-item-3d.active {
        transform: translateY(-2px);
        box-shadow: 0 0 30px rgba(255, 68, 56, 0.15);
    }

    .faq-answer {
        font-size: 0.9rem;
    }

    .faq-item-3d .flex span {
        font-size: 1.1rem;
    }

    /* Shrink icon box */
    .icon-box {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    /* Tag cloud responsive height */
    #tag-cloud-container {
        height: 300px;
    }

    /* SEO Grid mobile scale */
    .seo-grid-wrapper {
        transform: scale(0.6);
        transform-origin: center center;
        margin: -20px 0;
    }

    /* Void card (team) auto height on mobile */
    .void-card {
        border-radius: 16px;
    }

    /* Floating SEO elements: smaller on mobile */
    .seo-floater {
        transform: scale(0.85);
    }

    /* Liquid blob image smaller */
    .liquid-blob {
        width: 100%;
        height: 100%;
    }

    /* Portal / CTA buttons: full width on mobile */
    .portal-btn-wrap {
        display: block;
        width: 100%;
        padding: 0 1rem;
    }

    .portal-btn {
        width: 100%;
        text-align: center;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* CTA buttons: mobile-appropriate sizing */
    .cta-btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
    }

    .cta-btn-outline {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
    }

    /* Text shimmer scale */
    .text-shimmer {
        font-size: inherit;
    }

    /* Reduce floating animation amplitude */
    @keyframes float {
        0% {
            transform: translateY(0px);
        }

        50% {
            transform: translateY(-8px);
        }

        100% {
            transform: translateY(0px);
        }
    }

    /* Reduce drift animation on mobile */
    @keyframes drift {
        0% {
            transform: translate(0px, 0px) scale(1);
            opacity: 0.2;
        }

        33% {
            transform: translate(15px, -25px) scale(1.05);
            opacity: 0.3;
        }

        66% {
            transform: translate(-10px, 10px) scale(0.95);
            opacity: 0.2;
        }

        100% {
            transform: translate(0px, 0px) scale(1);
            opacity: 0.2;
        }
    }

    /* Perspective: reduce for mobile */
    .perspective {
        perspective: 600px;
    }

    .preserve-3d {
        transform-style: flat;
    }
}

/* ---- Small Mobile (max-width: 480px) ---- */
@media (max-width: 480px) {

    /* Container tighter padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Further shrink icon boxes */
    .icon-box {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    /* Tag cloud even smaller */
    #tag-cloud-container {
        height: 220px;
    }

    /* SEO Grid extra small */
    .seo-grid-wrapper {
        transform: scale(0.45);
        margin: -30px 0;
    }

    /* SEO cell size reduction */
    .seo-cell {
        width: 16px;
        height: 16px;
    }

    /* Compact FAQ */
    .faq-item-3d {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .faq-item-3d .flex span {
        font-size: 1rem;
    }

    /* Glass card extra compact */
    .glass-card {
        padding: 1rem;
    }

    /* CTA buttons: smaller on tiny screens */
    .cta-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .cta-btn-outline {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    /* Floating elements: hide most on very small screens */
    .seo-floater {
        transform: scale(0.7);
    }

    /* Void card padding */
    .void-card {
        border-radius: 12px;
    }

    /* Portal buttons */
    .portal-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }

    /* Nav link spacing */
    .nav-link {
        font-size: 0.85rem;
    }
}