@import url('./breakpoints.css');

/* Scroll reveal — nội dung hiển thị ngay; animation chỉ khi JS bật .reveal-animate */
html { scroll-behavior: smooth; }

.reveal-on-load,
.reveal-on-scroll,
.reveal-grid-item {
    opacity: 1;
    transform: none;
}

html.reveal-animate .reveal-on-load:not(.is-visible),
html.reveal-animate .reveal-on-scroll:not(.is-visible) {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--reveal-delay, 0) * 0.1s);
}

html.reveal-animate .reveal-grid-item:not(.is-visible) {
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-load.is-visible,
.reveal-on-scroll.is-visible,
.reveal-grid-item.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html.reveal-animate .reveal-on-load,
    html.reveal-animate .reveal-on-scroll,
    html.reveal-animate .reveal-grid-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
/* Page load & scroll performance — shared */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-overflow-scrolling: touch;
    text-rendering: optimizeLegibility;
}

html.page-loading body {
    opacity: 1;
}

html.page-ready body {
    opacity: 1;
    transition: none;
}

img {
    max-width: 100%;
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html.page-ready body { transition: none; }
}
/* Technex primary buttons — đồng bộ technex-login-btn (#5B5FF8) */
:root {
    --technex-btn-primary: #5B5FF8;
    --technex-btn-primary-hover: #5054ff;
    --technex-btn-radius: 10px;
}

.technex-login-btn,
.btn-primary,
.btn-generate,
.custom-auth-btn,
.custom-auth-btn-submit,
.footer-subscribe-btn,
.cyber-filter-submit-btn,
.btn-get-started,
button[type="submit"]:not(.demo-chip):not(.nav-search-btn):not(.menu-toggle) {
    background: var(--technex-btn-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--technex-btn-radius) !important;
    font-weight: 500 !important;
    transition: background-color 0.2s ease, filter 0.2s ease !important;
    box-shadow: none !important;
}

.technex-login-btn:hover,
.btn-primary:hover,
.btn-generate:hover,
.custom-auth-btn:hover,
.custom-auth-btn-submit:hover,
.footer-subscribe-btn:hover,
.cyber-filter-submit-btn:hover,
.btn-get-started:hover,
button[type="submit"]:not(.demo-chip):not(.nav-search-btn):not(.menu-toggle):hover {
    background: var(--technex-btn-primary-hover) !important;
    filter: none !important;
}

.btn-signup {
    background: transparent !important;
    color: #111827 !important;
    border: none !important;
    border-radius: var(--technex-btn-radius) !important;
    font-weight: 500 !important;
}

.btn-signup:hover {
    background: #ececf0 !important;
    color: #111827 !important;
}

.btn-panel-link {
    background: color-mix(in srgb, var(--technex-btn-primary) 10%, transparent) !important;
    color: var(--technex-btn-primary) !important;
    border-radius: var(--technex-btn-radius) !important;
}

.btn-panel-link:hover {
    background: color-mix(in srgb, var(--technex-btn-primary) 18%, transparent) !important;
}

/* Ghi đè nút inline cũ */
button[style*="#6323ec"],
button[style*="#5100D6"],
a.technex-login-btn[style*="background"] {
    background: var(--technex-btn-primary) !important;
    border-radius: var(--technex-btn-radius) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   TECHNEX RESPONSIVE — 2 nhánh layout
   Compact  < 1024px : Mobile + Tablet dùng chung (class gốc / max-lg)
   Desktop  ≥ 1024px : PC (tiền tố lg:)
   ========================================================================== */

/* ==========================================================================
   COMPACT (Mobile + Tablet): max-width 1023px — kế thừa luồng mobile
   ========================================================================== */
@media (max-width: 1023px) {

    /* Search dialog full bleed — tablet */
    .nav-search-dialog {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        top: 0 !important;
        border-radius: 0 0 16px 16px !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* ── INDEX: Hero column layout cho tablet ── */
    .hero-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 32px !important;
        min-height: unset !important;
        padding-top: 48px !important;
        padding-bottom: 38px !important;
    }

    .slogan-left {
        max-width: 100% !important;
        padding-left: clamp(12px, 2vw, 28px) !important;
        padding-right: clamp(8px, 1.5vw, 16px) !important;
    }

    .slogan-card {
        max-width: 100% !important;
        padding: clamp(14px, 2vw, 20px) !important;
    }

    /* Hero right: static trong flow */
    .hero-right {
        position: relative !important;
        width: 100% !important;
        max-width: 540px !important;
        display: flex !important;
        justify-content: center !important;
        transform: none !important;
        left: auto !important;
        bottom: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        pointer-events: auto !important;
    }

    .robot-container {
        width: min(30vw, 100%) !important;
        max-width: 280px !important;
        height: var(--technex-robot-height, calc(100vh - 136px)) !important;
        min-height: var(--technex-robot-height, 260px) !important;
        max-height: var(--technex-robot-max-height, calc(100vh - 136px)) !important;
    }

    /* Hero desc: hiện bản Desktop, ẩn bản Mobile */
    .hero-desc .hero-desc-line.desktop-only {
        display: block !important;
    }
    .hero-desc .hero-desc-line.mobile-only {
        display: none !important;
    }

    /* Cyber glow tablet */
    .cyber-glow-bg {
        left: 70% !important;
        top: 50% !important;
    }

    /* ── MAIN CONTAINER: không cần padding-top vì navbar sticky ── */
    .main-container {
        padding: 0 !important;
    }

    /* ── CTA FORM: giữ dạng row như Desktop ── */
    .cta-input-group {
        flex-direction: row !important;
        max-width: 400px !important;
        padding: 6px 6px 6px 12px !important;
        gap: 0 !important;
    }

    .email-field {
        width: auto !important;
        min-width: 0 !important;
        flex: 1 !important;
    }

    .btn-get-started {
        width: auto !important;
        flex-shrink: 0 !important;
        padding: 10px 20px !important;
    }

    /* ── HERO TITLE: giảm nhẹ cho tablet ── */
    .hero-title {
        font-size: clamp(30px, 4vw + 8px, 52px) !important;
    }

    .hero-desc {
        font-size: clamp(14px, 1.4vw + 3px, 18px) !important;
    }

    /* ── NAVBAR: full-width, khít trên cùng ── */
    .technex-navbar {
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }

    /* ── TINTUC / BAIVIET: chống tràn khung tablet ── */
    .news-page,
    .post-page {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    .news-main.main-container,
    .post-main.main-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .community-layout,
    .bv-layout,
    .community-main,
    .bv-main-col,
    .community-sidebar,
    .bv-sidebar,
    .posts-feed-column {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .posts-list-column {
        max-width: 100% !important;
    }
    .blog-card-custom {
        padding: 22px 28px !important;
    }

    /* ── AUTH PAGES (dangky/login): căn giữa rộng hơn ── */
    .auth-card,
    .auth-panel,
    .auth-form-wrap {
        max-width: 560px !important;
        width: 90% !important;
    }

    /* ── ADMIN: padding nội dung tablet ── */
    .admin-main-content,
    .admin-content-area {
        padding: 20px !important;
    }

}

/* ==========================================================================
   MOBILE ONLY: ≤767px  (điện thoại — dọc như ảnh)
   ========================================================================== */
@media (max-width: 767px) {

    /* ── INDEX showcase: không kéo xa CTA ── */
    /* Typography & components — không transform hero (che badge dưới header) */
    .capabilities-section,
    .experience-section {
        transform: none !important;
    }

    .hero-section:has(.floating-showcase),
    .hero-section:has(.hero-showcase-wrap),
    .hero-section:has(#floatingShowcase) {
        min-height: unset !important;
        gap: clamp(12px, 2.8vw, 22px) !important;
        padding-top: clamp(20px, 5vw, 32px) !important;
        padding-bottom: clamp(20px, 5vw, 32px) !important;
        justify-content: flex-start !important;
        transform: none !important;
    }

    .hero-section:has(.floating-showcase) .hero-right,
    .hero-section:has(.hero-showcase-wrap) .hero-right,
    .hero-section:has(#floatingShowcase) .hero-right {
        flex: none !important;
        align-items: center !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ── INDEX: Hero dọc (trang cũ có robot) ── */
    .hero-section:not(:has(.floating-showcase)):not(:has(.hero-showcase-wrap)):not(:has(#floatingShowcase)) {
        min-height: calc(100vh - var(--technex-header-height, 88px) - var(--technex-footer-height, 44px)) !important;
        gap: 0 !important;
        padding-top: 8px !important;
    }

    .hero-section:not(:has(.floating-showcase)):not(:has(.hero-showcase-wrap)):not(:has(#floatingShowcase)) .hero-right {
        flex: 1 !important;
        align-items: flex-end !important;
        padding-top: 24px !important;
    }

    .slogan-left {
        max-width: 100% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        width: 100% !important;
    }

    .slogan-card {
        max-width: 100% !important;
        padding: 12px 8px !important;
    }

    /* Robot về static và căn giữa — chỉ trang robot cũ */
    .hero-section:not(:has(.floating-showcase)):not(:has(.hero-showcase-wrap)):not(:has(#floatingShowcase)) .hero-right {
        position: static !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        padding-bottom: 0 !important;
        pointer-events: auto !important;
    }

    .hero-section:has(.floating-showcase) .hero-right,
    .hero-section:has(.hero-showcase-wrap) .hero-right,
    .hero-section:has(#floatingShowcase) .hero-right {
        position: relative !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex: none !important;
        padding-top: 0 !important;
        margin: 0 !important;
    }

    .robot-container {
        width: 72vw !important;
        max-width: 300px !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        animation: none !important;
        flex-shrink: 1 !important;
    }
    .hero-right .robot-image {
        width: auto !important;
        height: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        object-position: bottom center !important;
    }

    .robot-image {
        width: auto !important;
        height: 100% !important;
        max-height: 100% !important;
        max-width: 100% !important;
        object-fit: contain !important;
        object-position: bottom center !important;
    }

    /* hero-title: luôn 2 dòng — font tự scale theo width màn hình */
    .hero-title {
        font-size: clamp(19px, 6.2vw, 26px) !important;
        line-height: 1.15 !important;
        margin-bottom: 12px !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: keep-all !important;
    }

    .hero-desc .hero-desc-line {
        display: inline !important;
    }
    .hero-desc .hero-desc-line::after {
        content: ' ' !important;
    }
    .hero-desc {
        display: block !important;
        overflow: visible !important;
        font-size: clamp(12px, 3.5vw, 14px) !important;
        line-height: 1.65 !important;
        margin-bottom: 16px !important;
        text-align: center !important;
        hyphens: none !important;
    }

    .badge-tool {
        font-size: 11px !important;
        margin-top: 4px !important;
        margin-bottom: 12px !important;
        align-self: center !important;
        transform: none !important;
    }
    .badge-tool.reveal-on-load.is-visible {
        transform: none !important;
    }

    /* CTA form: column trên phone */
    .cta-input-group {
        flex-direction: row !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 6px 6px 6px 12px !important;
        border-radius: 100px !important;
        align-items: center !important;
    }

    .email-field {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 8px !important;
    }

    .btn-get-started {
        flex-shrink: 0 !important;
        width: auto !important;
        padding: 10px 16px !important;
        text-align: center !important;
    }

    /* Main container — navbar là sticky nên không cần padding-top */
    .main-container {
        padding: 0 !important;
    }

    /* ── NAVBAR: full-width, khít trên cùng ── */
    .technex-navbar {
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }

    .nav-container-inner {
        padding: 14px 18px !important;
    }

    html:not(.admin-page):not(.nexchat-page) .technex-logo-img {
        height: 20px !important;
        max-height: 20px !important;
        object-fit: contain !important;
    }

    /* ── FOOTER: căn giữa 1 dòng ── */
    .technex-footer {
        width: 100% !important;
        min-height: unset !important;
        max-height: none !important;
        height: auto !important;
    }

    .footer-inner,
    .footer-text-wrap {
        justify-content: center !important;
        text-align: center !important;
        height: 44px !important;
        padding: 0 12px !important;
    }

    .footer-links { display: none !important; }

    /* ── AUTH PAGES: full width trên phone ── */
    .auth-card,
    .auth-panel,
    .auth-form-wrap {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 16px !important;
    }

    /* ── COMMUNITY / BLOG: card nhỏ gọn ── */
    .blog-card-custom {
        padding: 18px 16px !important;
        border-radius: 16px !important;
    }

    .post-card-title-text {
        font-size: 18px !important;
    }

    /* ── ADMIN: 1 cột trên phone nhỏ ── */
    .admin-stats-grid,
    .admin-cards-grid {
        grid-template-columns: 1fr !important;
    }
}
/* ==========================================================================
   PC HẸP: 993px – 1200px
   ========================================================================== */
@media (min-width: 1081px) and (max-width: 1200px) {
    .hero-title {
        font-size: clamp(34px, 3vw + 8px, 58px) !important;
    }
}