/* ==============================================================================
 * Xenax Cloud Corporate Style Sheet
 * Configures transitions, custom scrollbars, animations, and high-tech backdrops.
 * ============================================================================== */

/* Glassmorphism panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.dark .glass-panel {
    background: rgba(18, 17, 32, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 240, 255, 0.08);
}

/* Custom UI Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.dark ::-webkit-scrollbar-track {
    background: #080710;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Infinite Marquee Loop (Client logo list) */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* Tech server rack layout scanning grids */
.grid-overlay {
    background-size: 35px 35px;
    background-image: 
        linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
}

.dark .grid-overlay {
    background-image: 
        linear-gradient(to right, rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
}

/* Terminal line cursor */
@keyframes blink {
    50% { opacity: 0; }
}
.terminal-cursor {
    animation: blink 0.9s step-end infinite;
}

/* Theme body settings */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* High-tech pulsing server light simulations */
@keyframes cyan-glow {
    0%, 100% { filter: drop-shadow(0 0 1px rgba(0, 240, 255, 0.5)); opacity: 0.7; }
    50% { filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.95)); opacity: 1; }
}

@keyframes blue-glow {
    0%, 100% { filter: drop-shadow(0 0 1px rgba(0, 76, 255, 0.5)); opacity: 0.7; }
    50% { filter: drop-shadow(0 0 8px rgba(0, 76, 255, 0.95)); opacity: 1; }
}

.neon-glow-cyan {
    animation: cyan-glow 2.5s infinite ease-in-out;
}

.neon-glow-blue {
    animation: blue-glow 3.5s infinite ease-in-out;
}

/* Neon border glow classes */
.neon-border-cyan {
    border-color: rgba(0, 240, 255, 0.3) !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
    transition: all 0.3s ease;
}
.neon-border-cyan:hover {
    border-color: rgba(0, 240, 255, 0.7) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.neon-border-blue {
    border-color: rgba(38, 126, 246, 0.3) !important;
    box-shadow: 0 0 10px rgba(38, 126, 246, 0.15);
    transition: all 0.3s ease;
}
.neon-border-blue:hover {
    border-color: rgba(38, 126, 246, 0.7) !important;
    box-shadow: 0 0 15px rgba(38, 126, 246, 0.4);
}

/* Neon text glow classes */
.neon-text-cyan {
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
.neon-text-blue {
    text-shadow: 0 0 8px rgba(38, 126, 246, 0.5);
}

/* Custom premium hover glowing cards */
.neon-card {
    transition: all 0.3s ease;
}
.dark .neon-card:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.12), inset 0 0 8px rgba(0, 240, 255, 0.04);
    border-color: rgba(0, 240, 255, 0.25) !important;
}

/* Neon pulsers for buttons */
@keyframes neon-pulse-cyan {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 240, 255, 0.25); }
    50% { box-shadow: 0 0 18px rgba(0, 240, 255, 0.55); }
}
.neon-btn-cyan {
    animation: neon-pulse-cyan 2s infinite ease-in-out;
}

/* Light mode overrides for brand-cyan elements to guarantee high contrast */
.light .text-brand-cyan {
    color: #267ef6 !important;
}
.light .border-brand-cyan {
    border-color: #267ef6/30 !important;
}
.light .bg-brand-cyan {
    background-color: #267ef6 !important;
}
.light .group-hover\:text-brand-cyan:hover {
    color: #267ef6 !important;
}

/* Restore neon cyan specifically inside dark containers (such as the global header) */
.dark .text-brand-cyan,
.dark *.text-brand-cyan {
    color: #00f0ff !important;
}
.dark .border-brand-cyan,
.dark *.border-brand-cyan {
    border-color: rgba(0, 240, 255, 0.3) !important;
}
.dark .bg-brand-cyan,
.dark *.bg-brand-cyan {
    background-color: #00f0ff !important;
}
.dark .group-hover\/tile\:text-brand-cyan:hover,
.dark * .group-hover\/tile\:text-brand-cyan:hover {
    color: #00f0ff !important;
}

/* ==============================================================================
 * DESIGN POLISH LAYER v2 — Modern Data-Center Refinement
 * Pure presentation layer: no markup or content changes required.
 * ============================================================================== */

/* ---- 1. Rendering & Typography ------------------------------------------- */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

h1, h2, h3 {
    text-wrap: balance;
    letter-spacing: -0.015em;
}

p {
    text-wrap: pretty;
}

/* Anchored sections should never hide under the sticky header */
section[id], div[id^="mob-"], [id^="enterprise"], [id^="infrastructure"] {
    scroll-margin-top: 96px;
}

/* Brand-tinted text selection */
::selection {
    background: rgba(38, 126, 246, 0.22);
    color: #0e123e;
}
.dark ::selection {
    background: rgba(0, 240, 255, 0.25);
    color: #ffffff;
}

/* Visible, consistent keyboard focus */
:focus-visible {
    outline: 2px solid #267ef6;
    outline-offset: 2px;
    border-radius: 6px;
}

a, button {
    -webkit-tap-highlight-color: transparent;
}

/* ---- 2. Refined Data-Center Grid Backdrop --------------------------------- */
/* Finer engineering grid + soft ambient brand glow rising from the top edge   */
.grid-overlay {
    background-size: 100% 100%, 32px 32px, 32px 32px;
    background-image:
        radial-gradient(ellipse 65% 55% at 50% -5%, rgba(38, 126, 246, 0.055), transparent 70%),
        linear-gradient(to right, rgba(100, 116, 139, 0.055) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(100, 116, 139, 0.055) 1px, transparent 1px);
}

.dark .grid-overlay {
    background-size: 100% 100%, 32px 32px, 32px 32px;
    background-image:
        radial-gradient(ellipse 65% 55% at 50% -5%, rgba(0, 240, 255, 0.05), transparent 70%),
        linear-gradient(to right, rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
}

/* ---- 3. Header & Footer Energy Beams -------------------------------------- */
@keyframes beam-slide {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 240, 255, 0.55) 30%,
        rgba(91, 58, 242, 0.55) 55%,
        rgba(38, 126, 246, 0.45) 75%,
        transparent 100%);
    background-size: 200% 100%;
    animation: beam-slide 7s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Deepen the header once the page is scrolled (class toggled from app.js) */
header.header-scrolled {
    background-color: rgba(7, 10, 26, 0.94) !important;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55), 0 4px 20px rgba(0, 240, 255, 0.05) !important;
}

footer {
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(38, 126, 246, 0.4) 30%,
        rgba(0, 240, 255, 0.45) 50%,
        rgba(91, 58, 242, 0.4) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ---- 4. CTA Button Shine Sweep -------------------------------------------- */
/* Targets solid gradient call-to-action buttons only (white-text gradients)   */
a[class*="bg-gradient-to-r"][class*="text-white"] {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

a[class*="bg-gradient-to-r"][class*="text-white"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.65s ease;
    pointer-events: none;
    z-index: 1;
}

a[class*="bg-gradient-to-r"][class*="text-white"]:hover::after {
    left: 130%;
}

/* ---- 5. Marquee Edge Fades ------------------------------------------------- */
/* Logo / review marquees now dissolve softly at both edges                    */
div:has(> .animate-marquee),
div:has(> .animate-marquee-reverse) {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

/* ---- 6. Scroll Reveal System ----------------------------------------------- */
/* Elements are tagged with [data-reveal] by app.js — pure progressive          */
/* enhancement: without JS nothing is ever hidden.                              */
html.js-anim [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

html.js-anim [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ---- 7. Card & Panel Micro-polish ------------------------------------------ */
.glass-panel {
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.dark .glass-panel {
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

/* Comparison / spec tables: gentle row hover */
table tbody tr {
    transition: background-color 0.2s ease;
}
table tbody tr:hover {
    background-color: rgba(38, 126, 246, 0.035);
}
.dark table tbody tr:hover {
    background-color: rgba(0, 240, 255, 0.04);
}

/* Slightly richer hover ring on pricing cards (existing snap-start cards) */
.snap-start.group:hover {
    box-shadow: 0 18px 45px -12px rgba(91, 58, 242, 0.16), 0 0 0 1px rgba(91, 58, 242, 0.08);
}

/* ---- 9. Frosted Card Depth -------------------------------------------------- */
/* Rounded white/dark cards get a soft frosted-glass hover lift — a lighter,
 * sitewide-safe companion to .glass-panel for the many plain rounded-2xl
 * cards that don't opt into the full glass treatment. Pure hover state, no
 * layout shift (transform only), so it can never disturb existing spacing. */
[class*="rounded-2xl"][class*="border"] {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

@media (hover: hover) {
    a[class*="rounded-2xl"][class*="border"]:hover,
    .group:hover > [class*="rounded-2xl"][class*="border"] {
        transform: translateY(-3px);
    }
}

/* ---- 10. Pricing Card Frosted Glow ------------------------------------------ */
/* Targets the shared pricing-card-template.php output (identified by its own
 * snap-start marker) with a subtle top-edge light sheen on hover, echoing the
 * header's glass mega-menus for a consistent premium feel across the site. */
.snap-start.group {
    position: relative;
    isolation: isolate;
}
.snap-start.group::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}
.dark .snap-start.group::before {
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.06) 0%, transparent 45%);
}
.snap-start.group:hover::before {
    opacity: 1;
}

/* ---- 11. Icon Chip Micro-glow ------------------------------------------------ */
/* The small rounded icon boxes used throughout feature grids and mega-menus
 * (h-10 w-10 / h-12 w-12 rounded-xl) get a gentle scale + glow on the hover
 * of their nearest interactive ancestor — matches the header's mega-item
 * icon "lift" without needing any markup changes. */
.group:hover [class*="rounded-xl"][class*="flex items-center justify-center"] {
    transform: scale(1.06);
}
[class*="rounded-xl"][class*="flex items-center justify-center"] {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- 8b. Accessibility: Reduced Motion -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html.js-anim [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
}
