/* =========================================================
   TRIONOVA AI — ULTRA PREMIUM UI
========================================================= */

:root{

    --tn-bg:#050b18;
    --tn-card:#0b1528;
    --tn-card-2:#101d35;

    --tn-border:rgba(255,255,255,.07);

    --tn-primary:#2563eb;
    --tn-primary-light:#60a5fa;

    --tn-white:#ffffff;

    --tn-text:#dce8ff;
    --tn-text-soft:#8ea7d5;

    --tn-user:#2563eb;
    --tn-bot:#121f38;

    --tn-green:#22c55e;

    --tn-radius:32px;

    --tn-shadow:
        0 40px 120px rgba(0,0,0,.65),
        0 10px 40px rgba(0,0,0,.35);

    --tn-font:'Inter',sans-serif;
}


/* =========================================================
   LAUNCHER
========================================================= */

.tn-launcher-container{
    position:fixed;
    left:50%;
    transform:translateX(-50%);
    bottom:22px;
    z-index:1040;
}

#tn-launcher{
    background:none;
    border:none;
    padding:0;
    cursor:pointer;
}


#tn-launcher{
    background:none;
    border:none;
    cursor:pointer;

    display:flex;
    flex-direction:column;
    align-items:center;

    gap:12px;
}

/* LABEL */

.tn-ai-label{

    position: relative;

    padding: 4px;

    border-radius: 999px;

    background: rgba(12,20,38,.85);

    backdrop-filter: blur(20px);

    border: 1px solid rgba(255,255,255,.08);

    color: #fff;

    font-size: 12px;
    font-weight: 600;

    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(0,0,0,.25),
        0 0 20px rgba(37,99,235,.15);

    animation:
        tnFloat 3s ease-in-out infinite,
        tnGlowText 2s ease-in-out infinite;

        line-height:normal;
}

/* Floating motion */

@keyframes tnFloat{

    0%,100%{
        transform: translateY(0);
    }

    50%{
        transform: translateY(-5px);
    }

}

/* Soft glow pulse */

@keyframes tnGlowText{

    0%,100%{
        box-shadow:
            0 10px 30px rgba(0,0,0,.25),
            0 0 15px rgba(37,99,235,.15);
    }

    50%{
        box-shadow:
            0 10px 30px rgba(0,0,0,.25),
            0 0 35px rgba(37,99,235,.4);
    }

}

/* Shimmer effect */

.tn-ai-label::before{

    content:"";

    position:absolute;

    top:0;
    left:-120%;

    width:60%;
    height:100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.35),
            transparent
        );

    transform: skewX(-25deg);

    animation: tnShimmer 3s infinite;
}

@keyframes tnShimmer{

    0%{
        left:-120%;
    }

    100%{
        left:160%;
    }

}

.tn-ai-title{

    font-size:14px;
    font-weight:700;

    color:#ffffff;

    letter-spacing:.3px;
}

.tn-ai-subtitle{

    font-size:11px;

    color:#9fb8e7;

    margin-top:2px;
}

/* Hover Animation */

#tn-launcher:hover .tn-ai-title{
    color:#60a5fa;
}

#tn-launcher:hover .tn-ai-subtitle{
    color:#c7dcff;
}


@keyframes tnGlow{

    0%{
        transform:translateX(-40%);
    }

    50%{
        transform:translateX(40%);
    }

    100%{
        transform:translateX(-40%);
    }

}

.cyber-btn{
    width:60px;
    height:60px;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

/* MAIN CIRCLE */
.cyber-inner{
    width:60px;
    height:60px;

    border-radius:50%;
    overflow:hidden;

    display:flex;
    align-items:center;
    justify-content:center;

    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);

    border:1px solid rgba(255,255,255,0.18);

    box-shadow:
        inset 0 1px 10px rgba(255,255,255,0.2),
        0 10px 25px rgba(0,0,0,0.35);

    transition: transform 0.3s ease;
}

/* VIDEO */
.cyber-video{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
    transform: scale(1.15);
}



.tn-search-icon{
    width:18px;
    height:18px;
    color:#8ea7d5;
}


/* ==========================================
   FLOATING AI BUTTON
========================================== */

.tn-launcher-container{

    position:fixed;

    right:25px;
    bottom:25px;

    left:auto;

    transform:none;

    z-index:99999;
}

#tn-launcher{

    border:none;
    background:none;

    padding:0;

    cursor:pointer;
}


/* MAIN AI */

.tn-ai-launcher{

    position:relative;

    width:75px;
    height:75px;

    display:flex;
    align-items:center;
    justify-content:center;
}


/* OUTER RINGS */

.tn-ai-ring{

    position:absolute;

    width:100%;
    height:100%;

    border-radius:50%;

    border:1px solid rgba(37,99,235,.45);

    animation:tnOrbit 4s linear infinite;
}

.tn-ai-ring-2{

    width:100px;
    height:100px;

    animation-direction:reverse;
    animation-duration:6s;

    opacity:.6;
}

@keyframes tnOrbit{

    from{
        transform:rotate(0deg);
    }

    to{
        transform:rotate(360deg);
    }

}


/* CORE */

.tn-ai-core{

    width:65px;
    height:65px;

    border-radius:50%;

    overflow:hidden;

    display:flex;
    align-items:center;
    justify-content:center;

    background:
        radial-gradient(
            circle,
            rgba(37,99,235,.35),
            rgba(37,99,235,.05)
        );

    backdrop-filter:blur(20px);

    border:1px solid rgba(255,255,255,.15);

    box-shadow:
        0 0 30px rgba(37,99,235,.45),
        0 0 60px rgba(37,99,235,.25);

    transition:.35s ease;
}

.tn-ai-core:hover{

    transform:scale(1.08);

    box-shadow:
        0 0 40px rgba(37,99,235,.65),
        0 0 90px rgba(37,99,235,.35);
}


/* VIDEO */

.cyber-video{

    width:100%;
    height:100%;

    object-fit:cover;

    border-radius:50%;
}


/* PULSE */

.tn-ai-core::before{

    content:"";

    position:absolute;

    inset:-10px;

    border-radius:50%;

    border:2px solid rgba(37,99,235,.3);

    animation:tnPulse 2.5s infinite;
}

@keyframes tnPulse{

    0%{
        transform:scale(.9);
        opacity:1;
    }

    100%{
        transform:scale(1.5);
        opacity:0;
    }

}

@media(max-width:768px){

    .tn-launcher-container{

        right:16px;
        bottom:16px;
    }

    .tn-ai-launcher{

        width:70px;
        height:70px;
    }

    .tn-ai-core{

        width:60px;
        height:60px;
    }

    .tn-ai-ring-2{

        width:90px;
        height:90px;
    }
}


/* =========================================================
   WINDOW
========================================================= */

#tn-window{

    display:none;
    flex-direction:column;

    position:fixed;

    inset:22px;

    border-radius:34px;

    overflow:hidden;

    background:
        linear-gradient(
            180deg,
            rgba(7,15,30,.97),
            rgba(3,8,18,.98)
        );

    border:1px solid rgba(255,255,255,.06);

    backdrop-filter:blur(30px);

    box-shadow:var(--tn-shadow);

    z-index:999999;

    isolation:isolate;
}

#tn-window.tn-open{
    display:flex;
    animation:tnWindow .35s cubic-bezier(.22,1,.36,1);
}

@keyframes tnWindow{
    from{
        opacity:0;
        transform:scale(.96);
    }
    to{
        opacity:1;
        transform:scale(1);
    }
}


/* =========================================================
   BACKGROUND FX
========================================================= */

.tn-bg-orb{
    position:absolute;
    border-radius:50%;
    filter:blur(100px);
    opacity:.18;
    pointer-events:none;
    z-index:-1;
}

.tn-bg-orb-1{
    width:420px;
    height:420px;

    background:#2563eb;

    top:-140px;
    left:-80px;
}

.tn-bg-orb-2{
    width:360px;
    height:360px;

    background:#7c3aed;

    bottom:-120px;
    right:-60px;
}

.tn-grid{
    position:absolute;
    inset:0;

    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);

    background-size:42px 42px;

    mask-image:
        radial-gradient(circle at center, black 35%, transparent 100%);

    pointer-events:none;

    z-index:-1;
}


/* =========================================================
   HEADER
========================================================= */

.tn-header{

    height:92px;

    padding:0 30px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    border-bottom:1px solid rgba(255,255,255,.05);

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.03),
            rgba(255,255,255,.01)
        );

    backdrop-filter:blur(20px);
}

.tn-header-left{
    display:flex;
    align-items:center;
    gap:14px;
}

.tn-avatar{

    width:48px;
    height:48px;
    min-width:48px;

    border-radius:50%;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #dce8ff
        );

    color:#071633;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:18px;
    font-weight:800;
}

.tn-header-name{
    font-size:24px;
    font-weight:700;
    color:#fff;
}

.tn-header-sub{
    margin-top:5px;

    color:#8ea7d5;
    font-size:13px;

    display:flex;
    align-items:center;
    gap:6px;
}

.tn-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:#22c55e;
}

.tn-header-actions{
    display:flex;
    gap:10px;
}

.tn-header-actions button{

    width:42px;
    height:42px;

    border:none;

    border-radius:14px;

    background:
        rgba(255,255,255,.04);

    border:1px solid rgba(255,255,255,.04);

    color:#9db6e0;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;

    transition:.25s ease;
}

.tn-header-actions button:hover{
    background:rgba(255,255,255,.08);
    transform:translateY(-2px);
    color:#fff;
}


/* =========================================================
   MESSAGES
========================================================= */

#tn-messages{

    flex:1;

    overflow-y:auto;

    padding:34px;

    display:flex;
    flex-direction:column;

    gap:28px;

    scroll-behavior:smooth;
    background-color: #fff;
}

#tn-messages::-webkit-scrollbar{
    width:6px;
}

#tn-messages::-webkit-scrollbar-thumb{
    background:#2b426b;
    border-radius:999px;
}


/* rows */

.tn-msg-row{
    display:flex;
    gap:14px;

    animation:tnMessage .28s ease;
}

.tn-msg-row.tn-user{
    flex-direction:row-reverse;
}

@keyframes tnMessage{
    from{
        opacity:0;
        transform:translateY(10px);
    }
    to{
        opacity:1;
        transform:none;
    }
}


/* body */

/* BOT MESSAGE AREA */

.tn-msg-row.tn-bot .tn-msg-body{
    width:100%;
    max-width:1200px;
}

/* FORM CONTAINER */

.tn-chat-form-wrap{
    width:min(100%, 980px);
    max-width:980px;
    margin-top:24px;
}

/* BOT BUBBLE */

.tn-msg-row.tn-bot .tn-msg-bubble{
    width:fit-content;
    min-width:720px;
    max-width:1000px;
}

.tn-msg-row.tn-user .tn-msg-body{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
}


/* labels */

.tn-msg-name{
    font-size:12px;
    font-weight:600;

    color:#88a2d5;

    margin-bottom:8px;
}


/* bubbles */

.tn-msg-bubble{

    position:relative;

    padding:18px 22px 25px;

    border-radius:24px;

    font-size:15px;
    line-height:1.85;

    color:#eaf2ff;

    border:1px solid rgba(255,255,255,.05);

    backdrop-filter:blur(16px);

    box-shadow:
        0 10px 30px rgba(0,0,0,.15);
}

.tn-msg-row.tn-bot .tn-msg-bubble{

    background:
        linear-gradient(
            180deg,
            rgba(19,34,61,.94),
            rgba(11,20,38,.94)
        );

    border-bottom-left-radius:10px;
}

.tn-msg-row.tn-user .tn-msg-bubble{

    background:
        linear-gradient(
            180deg,
            #3478ff,
            #2563eb
        );

    border-bottom-right-radius:10px;
}

.tn-msg-bubble strong{
    color:#fff;
}

.tn-msg-bubble a{
    color:#ffd86e;
    text-decoration:none;
}


/* =========================================================
   TYPING
========================================================= */

.tn-typing{
    display:flex;
    align-items:center;
    gap:5px;
    padding:14px 16px;
}

.tn-typing span{
    width:8px;
    height:8px;

    border-radius:50%;

    background:#8ea7d5;

    animation:tnTyping 1.2s infinite;
}

.tn-typing span:nth-child(2){
    animation-delay:.2s;
}

.tn-typing span:nth-child(3){
    animation-delay:.4s;
}

@keyframes tnTyping{
    0%,80%,100%{
        transform:translateY(0);
        opacity:.4;
    }
    40%{
        transform:translateY(-5px);
        opacity:1;
    }
}


/* =========================================================
   SUGGESTIONS
========================================================= */

#tn-suggestions{

    padding:0 30px 22px;

    display:flex;
    flex-wrap:wrap;

    gap:12px;
    background-color: #fff;
}

.tn-sugg{

    height:42px;

    padding:0 18px;

    border-radius:999px;

    background:
        #070e1c;

    border:1px solid rgba(255,255,255,.06);

    color:#dbe8ff;

    font-size:13px;
    font-weight:500;

    cursor:pointer;

    transition:.25s ease;
}

.tn-sugg:hover{

    background:
        rgba(37,99,235,.14);

    border-color:
        rgba(37,99,235,.28);

    transform:
        translateY(-2px);
        color:#2563eb;
}


/* =========================================================
   INPUT
========================================================= */

.tn-input-wrap{

    padding:24px 30px 28px;

    border-top:1px solid rgba(255,255,255,.05);

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.02),
            rgba(255,255,255,.01)
        );
}

.tn-input-inner{

    min-height:70px;

    border-radius:28px;

    padding:0 18px;

    display:flex;
    align-items:center;
    gap:14px;

    background:
        rgba(255,255,255,.05);

    border:1px solid rgba(255,255,255,.07);

    transition:.25s ease;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.03);
}

.tn-input-inner:focus-within{

    border-color:
        rgba(59,130,246,.45);

    box-shadow:
        0 0 0 5px rgba(37,99,235,.1);
}

.tn-input-icon{
    color:#8ea7d5;
}

#tn-input{

    flex:1;

    background:transparent;
    border:none;
    outline:none;

    color:#fff;

    font-size:16px;
}

#tn-input::placeholder{
    color:#8ea7d5;
}

#tn-send-btn{

    width:48px;
    height:48px;

    border:none;

    border-radius:18px;

    background:
        linear-gradient(
            180deg,
            #3b82f6,
            #2563eb
        );

    color:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;

    transition:.25s ease;

    box-shadow:
        0 12px 28px rgba(37,99,235,.35);
}

#tn-send-btn:hover{
    transform:translateY(-2px) scale(1.04);
}

#tn-messages{
    scroll-padding-bottom:40px;
    padding-bottom:40px !important;
}


/* =========================================================
   FOOTER
========================================================= */

.tn-footer-note{
    margin:12px 0 0;

    text-align:center;

    color:#8ea7d5;

    font-size:12px;
}

.tn-footer-note a{
    color:#bdd5ff;
}


/* =========================================================
   FORM
========================================================= */

.tn-chat-form-wrap{
    width:100%;
    max-width:920px;
    margin-top:22px;
}

.tn-chat-form-title{
    font-size:20px;
    color:#fff;
    margin-bottom:16px;
}

.tn-form-group{
    margin-bottom:14px;
}

.tn-form-group input,
.tn-form-group textarea{

    width:100%;

    background:
        rgba(255,255,255,.04);

    border:1px solid rgba(255,255,255,.06);

    border-radius:18px;

    padding:16px 18px;

    color:#fff;

    font-size:15px;

    outline:none;

    transition:.25s ease;
}

.tn-form-group textarea{
    min-height:140px;
    resize:none;
}

.tn-form-group input:focus,
.tn-form-group textarea:focus{

    border-color:
        rgba(59,130,246,.4);

    box-shadow:
        0 0 0 4px rgba(37,99,235,.1);
}

.tn-chat-submit-btn{

    width:100%;
    height:54px;

    border:none;

    border-radius:18px;

    background:
        linear-gradient(
            180deg,
            #3b82f6,
            #2563eb
        );

    color:#fff;

    font-size:15px;
    font-weight:600;

    cursor:pointer;

    transition:.25s ease;
}

.tn-chat-submit-btn:hover{
    transform:translateY(-2px);
}

.tn-chat-success{
    margin-top:14px;
    color:#22c55e;
}



/* =========================================================
   MOBILE
========================================================= */

@media(max-width:768px){

    .tn-launcher-container{
        right:18px;
        left:auto;
        transform:none;
        bottom:18px;
    }

    .tn-launcher-circle{
        width:50px;
        height:50px;
    }

    #tn-window{
        inset:0;
        border-radius:0;
    }

    .tn-header{
        height:78px;
        padding:0 16px;
    }

    .tn-header-name{
        font-size:18px;
    }

    .tn-header-sub{
        font-size:12px;
    }

    #tn-messages{
        padding:16px;
        gap:20px;
    }

    .tn-msg-row{
        width:100%;
        align-items:flex-start;
    }

    .tn-avatar{
        width:42px;
        height:42px;
        min-width:42px;
        font-size:16px;
    }

    /* IMPORTANT FIX */

    .tn-msg-row.tn-bot .tn-msg-body{
        width:100%;
        max-width:calc(100% - 54px);
    }

    .tn-msg-row.tn-bot .tn-msg-bubble{
        width:auto;
        min-width:unset;
        max-width:100%;
        word-break:break-word;
        overflow-wrap:break-word;
    }

    .tn-msg-row.tn-user .tn-msg-bubble{
        max-width:85%;
        word-break:break-word;
        overflow-wrap:break-word;
    }

    .tn-msg-bubble{
        font-size:14px;
        line-height:1.7;
        padding:14px 16px;
        border-radius:20px;
    }

    .tn-input-wrap{
        padding:14px;
    }

    .tn-input-inner{
        min-height:58px;
        border-radius:22px;
        gap:10px;
        padding:0 14px;
    }

    #tn-input{
        font-size:15px;
    }

    #tn-send-btn{
        width:44px;
        height:44px;
        border-radius:14px;
        flex-shrink:0;
    }

    #tn-mic-btn{
        width:38px;
        height:38px;
        flex-shrink:0;
    }

    #tn-suggestions{
        overflow-x:auto;
        flex-wrap:nowrap;
        padding:0 16px 14px;
        gap:10px;

        scrollbar-width:none;
    }

    #tn-suggestions::-webkit-scrollbar{
        display:none;
    }

    .tn-sugg{
        flex-shrink:0;
        height:38px;
        padding:0 16px;
        font-size:12px;
        white-space:nowrap;
    }

    .tn-footer-note{
        font-size:11px;
        margin-top:10px;
        padding-bottom:2px;
    }

}

/* MIC BUTTON */

#tn-mic-btn{

    width:42px;
    height:42px;

    border:none;

    border-radius:50%;

    background:transparent;

    color:#8aa3d1;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;

    transition:.25s ease;

    flex-shrink:0;
}

#tn-mic-btn:hover{

    background:rgba(255,255,255,.06);

    color:#ffffff;

    transform:scale(1.05);
}

/* ACTIVE LISTENING */

#tn-mic-btn.tn-mic-active{

    background:#2563eb;

    color:#ffffff;

    animation:tnMicPulse 1.2s infinite;
}

/* PULSE */

@keyframes tnMicPulse{

    0%{
        box-shadow:0 0 0 0 rgba(37,99,235,.7);
    }

    70%{
        box-shadow:0 0 0 14px rgba(37,99,235,0);
    }

    100%{
        box-shadow:0 0 0 0 rgba(37,99,235,0);
    }

}