/* ============================================================
   HZX LABS — SHARED COMPONENTS (components.css)
   Buttons, Cards, Navigation, Footer, and UI Elements
   ============================================================ */

/* --- Navigation & Glass Effect --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

.nav-link {
    position: relative;
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(30, 41, 59, 0.6);
    /* text-secondary/60 */
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: var(--color-accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1), transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translateX(-50%);
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.glass {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Mobile Menu Drawer */
.mob-menu {
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mob-menu.open {
    transform: translateX(0);
}

/* --- Buttons --- */
.btn-mag {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
}

.btn-mag::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
    z-index: -1;
}

.btn-mag::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-accent-hover), var(--color-accent-dark));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-mag:hover::after {
    opacity: 1;
}

.btn-mag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent-lg);
}

/* --- Gradient Text --- */
.grad-text {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-cyan) 50%, var(--color-accent) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

/* --- Cards --- */
.card-hover {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    background: var(--color-white);
    border: 1px solid var(--color-border);
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(37, 99, 235, 0.1);
}

/* Glowing Border Card (Premium Effect) */
.card-glowing-border {
    position: relative;
    border-radius: var(--radius-2xl);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-glowing-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 25px;
    /* match inner + 1px */
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    --webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    --webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: opacity 0.4s;
    opacity: 0;
}

.card-glowing-border:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-glowing-border:hover::before {
    opacity: 1;
}

/* --- Section Badges --- */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-full);
}

.section-badge span {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- FAQ Accordion --- */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item.active {
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.1);
}

.faq-ans {
    display: none;
}

.faq-item.active .faq-ans {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

.faq-item.active .faq-ico {
    transform: rotate(45deg);
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Browser Mockup --- */
.mockup-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* --- Form Elements --- */
.input-field {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-xl);
    font-size: var(--text-sm);
    color: var(--color-primary);
    transition: all 0.3s ease;
    outline: none;
}

.input-field:focus {
    background: var(--color-white);
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.05);
}

.input-field::placeholder {
    color: rgba(30, 41, 59, 0.35);
}

/* --- Newsletter Input (Dark Theme) --- */
.nl-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.nl-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.1);
}

.nl-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* --- Dynamic Navbar dark/light backgrounds --- */
.nav-dark-bg:not(.glass) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: transparent !important;
}

.nav-dark-bg:not(.glass) .nav-link {
    color: rgba(255, 255, 255, 0.6) !important;
}

.nav-dark-bg:not(.glass) .nav-link:hover {
    color: var(--color-white) !important;
}

.nav-dark-bg:not(.glass) .nav-link.active {
    color: var(--color-white) !important;
}

.nav-dark-bg:not(.glass) .logo-text {
    color: var(--color-white) !important;
}

.nav-dark-bg:not(.glass) #menuBtn {
    color: var(--color-white) !important;
}

/* Glass override states */
.nav.glass {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.nav.glass .nav-link {
    color: rgba(30, 41, 59, 0.6) !important;
}

.nav.glass .nav-link:hover {
    color: var(--color-primary) !important;
}

.nav.glass .nav-link.active {
    color: var(--color-accent) !important;
}

.nav.glass .logo-text {
    color: var(--color-primary) !important;
}

.nav.glass #menuBtn {
    color: var(--color-primary) !important;
}

/* Chatbot */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000
}

.chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB, #06B6D4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.35);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative
}

.chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.45)
}

.chat-btn .ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.3);
    animation: pulse-ring 2s ease-out infinite
}

.chat-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: bottom right;
    overflow: hidden
}

.chat-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all
}

.chat-msg {
    animation: msgIn 0.4s ease forwards
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.quick-btn {
    transition: all 0.3s
}

.quick-btn:hover {
    background: #2563EB;
    color: #fff;
    border-color: #2563EB;
    transform: translateY(-2px)
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94A3B8;
    animation: typingBounce 1.4s ease-in-out infinite
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0)
    }

    30% {
        transform: translateY(-6px)
    }
}

/* Tech pill active glow */
.tech-pill {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.tech-pill:hover {
    background: #2563EB;
    color: #fff;
    border-color: #2563EB;
    box-shadow: 0 10px 25px -8px rgba(37, 99, 235, 0.5);
}

@media(max-width:768px) {
    .chat-panel {
        width: calc(100vw - 32px);
        right: -4px;
        bottom: 68px;
        border-radius: 20px
    }
}

/* PREMIUM PRELOADER */
#preloader {
    position: fixed !important;
    inset: 0 !important;
    background: #ffffff !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.8s ease;
}

/* Showcase Content */
#showcase-text-content,
#showcase-visual-content {
    min-height: 300px;
    display: block;
    width: 100%;
}

#showcase-text-content {
    opacity: 1;
    visibility: visible;
}

#showcase-visual-content {
    opacity: 1;
    visibility: visible;
    min-height: 400px;
}

#preloader.loaded {
    transform: translateY(-100%);
    pointer-events: none;
}

.preloader-logo {
    transform: scale(0.9);
    opacity: 0;
    animation: preloaderReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes preloaderReveal {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.loader-bar-bg {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1px;
    overflow: hidden;
    margin-top: 24px;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #06B6D4);
    transition: width 0.1s linear;
}

.loader-counter {
    font-family: monospace;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* WELCOME POPUP */
#welcome-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#welcome-popup.show {
    opacity: 1;
    pointer-events: all;
}

.popup-card {
    background: #fff;
    width: 500px;
    max-width: calc(100vw - 32px);
    border-radius: 28px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.15);
    padding: 36px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#welcome-popup.show .popup-card {
    transform: scale(1) translateY(0);
}