/* ==========================================================================
   KTD VN - ACETERNITY UI & MAGIC UI 2026 DIGITAL MARKETPLACE SYSTEM
   Inspired by Aceternity UI, Magic UI, Shadcn UI, Linear, Whop, Vercel
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@600;700;800;900&family=JetBrains+Mono:wght@500;600;700;800&display=swap');

:root {
    --bg-canvas: #020408;
    --bg-card: rgba(10, 14, 24, 0.75);
    --bg-card-hover: rgba(16, 22, 38, 0.88);
    --bg-surface: #070a12;
    --bg-elevated: #0f1422;
    --bg-input: #05070e;

    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(99, 102, 241, 0.45);
    --border-subtle: rgba(255, 255, 255, 0.04);

    --text-pure: #ffffff;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-glow: rgba(99, 102, 241, 0.35);
    --cyan-400: #22d3ee;
    --emerald-400: #34d399;
    --amber-400: #fbbf24;
    --rose-400: #fb7185;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-color: var(--bg-canvas);
    position: relative;
}

.font-display {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   ACETERNITY SPOTLIGHT & AMBIENT MESH
   ========================================================================== */
.spotlight-cone {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 500px;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.18) 0%, rgba(34, 211, 238, 0.08) 35%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ambient-dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 20%, #000 70%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 20%, #000 70%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   GRADIENT TEXT UTILITIES
   ========================================================================== */
.text-gradient-brand {
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 35%, #818cf8 70%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-neon {
    background: linear-gradient(135deg, #a7f3d0 0%, #34d399 50%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #fef08a 0%, #facc15 50%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   ACETERNITY 3D CARDS & BENTO PANELS
   ========================================================================== */
.aceternity-card, .bento-card, .market-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.aceternity-card:hover, .bento-card:hover, .market-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-hover);
    transform: translateY(-3px);
    box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.75), 0 0 24px var(--brand-glow);
}

/* Glow Border Beam Animation */
@keyframes borderBeamMove {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.border-beam-card {
    position: relative;
    border-radius: 24px;
    padding: 1px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(34, 211, 238, 0.2), transparent 60%);
}

/* Laser Scan Animation for QR */
@keyframes laserScan {
    0% { top: 5%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 95%; opacity: 0; }
}

.laser-scan-line {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #34d399, #22d3ee, transparent);
    box-shadow: 0 0 12px #34d399, 0 0 24px #22d3ee;
    animation: laserScan 2.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 20;
}

/* Radar Pulse */
@keyframes radarPing {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 0.2; }
    100% { transform: scale(1.45); opacity: 0; }
}

.radar-ping {
    animation: radarPing 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ==========================================================================
   LUXURY ACTION BUTTONS
   ========================================================================== */
.btn-aceternity-primary, .btn-luxury-primary, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-aceternity-primary:hover, .btn-luxury-primary:hover, .btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 8px 26px rgba(99, 102, 241, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-aceternity-secondary, .btn-luxury-secondary, .btn-secondary, .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(12px);
}

.btn-aceternity-secondary:hover, .btn-luxury-secondary:hover, .btn-secondary:hover, .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-1.5px);
}

.btn-aceternity-discord, .btn-luxury-discord, .btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #5865F2;
    color: #ffffff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(88, 101, 242, 0.35);
}

.btn-aceternity-discord:hover, .btn-luxury-discord:hover, .btn-discord:hover {
    background: #4752c4;
    transform: translateY(-1.5px);
    box-shadow: 0 8px 26px rgba(88, 101, 242, 0.55);
}

.btn-aceternity-success, .btn-luxury-success, .btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
}

.btn-aceternity-success:hover, .btn-luxury-success:hover, .btn-success:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 8px 26px rgba(16, 185, 129, 0.55);
}

/* ==========================================================================
   FLOATING PILL TABS & INPUTS
   ========================================================================= */
.floating-pill-container {
    background: rgba(8, 12, 22, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 0.4rem;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.floating-pill-container::-webkit-scrollbar {
    display: none;
}

.floating-pill-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.4rem 0.2rem;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.floating-pill-container::-webkit-scrollbar {
    display: none;
}

.category-pill-btn, .category-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    white-space: nowrap;
}

.category-pill-btn:hover, .category-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.category-pill-btn.active, .category-tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(79, 70, 229, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
}

/* Category Glow Card */
.category-glow-card {
    background: rgba(12, 16, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.25rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
}

.category-glow-card:hover {
    background: rgba(18, 24, 42, 0.9);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Modern Input */
.form-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    padding: 0.8rem 1.1rem;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
    background-color: #080b14;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   MODALS & FLOATING ISLAND NAV
   ========================================================================== */
.floating-nav {
    background: rgba(6, 9, 16, 0.85);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(2, 3, 6, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 999;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container {
    background: rgba(11, 15, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 36px 72px -16px rgba(0, 0, 0, 0.95), 0 0 36px rgba(99, 102, 241, 0.2);
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    min-width: 280px;
    max-width: 380px;
    padding: 0.9rem 1.2rem;
    border-radius: 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    background-color: rgba(11, 15, 26, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.2s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Live Purchase Toast Popup */
#live-purchase-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 900;
    max-width: 320px;
    padding: 0.85rem 1.1rem;
    border-radius: 18px;
    background: rgba(11, 15, 26, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

#live-purchase-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   LIVE CHAT WIDGET & POPUP STYLES
   ========================================================================== */
#ktd-live-chat-trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 850;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#ktd-live-chat-trigger:hover {
    transform: scale(1.08) translateY(-2px);
}

#ktd-live-chat-box {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 860;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 540px;
    max-height: calc(100vh - 7rem);
    display: flex;
    flex-direction: column;
    background: rgba(8, 12, 22, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.2);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

#ktd-live-chat-box.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chat-bubble-user {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border-radius: 18px 18px 4px 18px;
    padding: 0.65rem 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    max-width: 82%;
    word-break: break-word;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.chat-bubble-admin {
    background: rgba(18, 24, 38, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px 18px 18px 4px;
    padding: 0.65rem 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    max-width: 84%;
    word-break: break-word;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Custom Chat Scrollbar */
.chat-scroll-container::-webkit-scrollbar {
    width: 5px;
}
.chat-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}
.chat-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}
.chat-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Star Rating Picker */
.star-rating-btn {
    color: #475569;
    transition: color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}
.star-rating-btn.active, .star-rating-btn:hover {
    color: #f59e0b;
    transform: scale(1.15);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE PERFECTION
   ========================================================================== */
@media (max-width: 1023px) {
    /* Đảm bảo nội dung trang không bị che khuất bởi Mobile Bottom Bar */
    main {
        padding-bottom: 5.5rem !important;
    }

    /* Đẩy nút Live Chat lên trên Bottom Bar để không bị đè nút */
    #ktd-live-chat-trigger {
        bottom: 4.8rem !important;
        right: 1rem !important;
    }

    /* Live purchase toast trên mobile */
    #live-purchase-toast {
        bottom: 5rem !important;
        left: 1rem !important;
        max-width: calc(100vw - 6rem) !important;
    }
}

@media (max-width: 640px) {
    /* Popup chat phủ vừa vặn màn hình điện thoại */
    #ktd-live-chat-box {
        bottom: 4.8rem !important;
        right: 0.6rem !important;
        left: 0.6rem !important;
        width: auto !important;
        max-width: calc(100vw - 1.2rem) !important;
        height: calc(100vh - 6.5rem) !important;
        max-height: calc(100vh - 6.5rem) !important;
        border-radius: 20px !important;
    }

    /* Modal trên mobile hiển thị gọn gàng */
    .modal-container {
        padding: 1.25rem !important;
        border-radius: 22px !important;
        max-height: 86vh !important;
        margin: auto 0.5rem !important;
    }

    /* Bảng dữ liệu có thể vuốt ngang mượt mà trên mobile */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Toasts trên mobile */
    #toast-container {
        top: 0.75rem !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
    }

    .toast-item {
        min-width: unset !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Utility: Ẩn thanh cuộn nhưng vẫn cuộn ngang được */
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-none::-webkit-scrollbar {
    display: none;
}


