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

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

body{
    background:#0d0d1a;
    font-family:'Inter',-apple-system,sans-serif;
    color:#e8e8f0;
    display:flex;
    flex-direction:column;
    align-items:center;
    min-height:100vh
}

/* LOADING */

#load{
    position:fixed;
    inset:0;
    z-index:999;
    background:#0d0d1a;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:16px;
    cursor:pointer;
    transition:opacity 0.35s
}
#load.hide{opacity:0;pointer-events:none}

.typing-indicator{
    display:flex;
    gap:5px
}
.typing-indicator span{
    width:8px;height:8px;
    background:#00e5ff;
    border-radius:50%;
    animation:ty 0.6s ease infinite alternate
}
.typing-indicator span:nth-child(1){animation-delay:0s}
.typing-indicator span:nth-child(2){animation-delay:0.15s}
.typing-indicator span:nth-child(3){animation-delay:0.3s}

@keyframes ty{
    0%{opacity:0.2;transform:translateY(0)}
    100%{opacity:0.7;transform:translateY(-10px)}
}

.l-msg{
    font-size:12px;
    font-weight:500;
    color:#e8e8f0;
    opacity:0.15;
    letter-spacing:0.5px
}

/* MAIN */

.hide{display:none!important}

#main{
    width:100%;
    max-width:400px;
    display:flex;
    flex-direction:column;
    padding:0;
    animation:ff 0.4s ease
}
@keyframes ff{
    from{opacity:0;transform:translateY(10px)}
    to{opacity:1;transform:translateY(0)}
}

/* CHAT */

.chat{
    background:#131326;
    border-radius:0;
    display:flex;
    flex-direction:column;
    min-height:100vh
}

.ch-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px 16px;
    background:#0a0a18;
    border-bottom:1px solid rgba(255,255,255,0.03);
    position:sticky;
    top:0;
    z-index:10
}

.ch-left{
    display:flex;
    align-items:center;
    gap:12px
}
.ch-left .fa-chevron-left{
    font-size:16px;
    color:#e8e8f0;
    opacity:0.2
}

.ch-av{
    width:36px;height:36px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0;
    border:1.5px solid #00e5ff;
    opacity:0.7
}
.ch-av img{
    width:100%;height:100%;
    object-fit:cover
}

.ch-info{
    display:flex;
    flex-direction:column;
    gap:1px
}
.ch-name{
    font-size:14px;
    font-weight:700;
    color:#e8e8f0
}
.ch-status{
    font-size:10px;
    font-weight:500;
    color:#00e5ff;
    opacity:0.5;
    letter-spacing:1px;
    text-transform:uppercase
}
.ch-right .fa-ellipsis-v{
    font-size:16px;
    color:#e8e8f0;
    opacity:0.15
}

.ch-body{
    flex:1;
    padding:12px 14px;
    display:flex;
    flex-direction:column;
    gap:8px
}

/* MESSAGES */

.msg-row{
    display:flex;
    gap:8px;
    align-items:flex-end
}
.msg-in{justify-content:flex-start}

.msg-av{
    width:28px;height:28px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0
}
.msg-av img{
    width:100%;height:100%;
    object-fit:cover
}

.msg-bubble{
    background:#1c1c3a;
    border-radius:16px 16px 16px 4px;
    padding:10px 14px;
    max-width:85%;
    display:flex;
    flex-direction:column;
    gap:4px
}

.msg-text{
    font-size:13px;
    font-weight:400;
    line-height:1.4;
    color:#e8e8f0
}

.msg-time{
    font-size:9px;
    font-weight:500;
    color:#e8e8f0;
    opacity:0.12;
    align-self:flex-end;
    margin-top:2px
}

/* MUSIC BUBBLE */

.msg-music{background:#1c1c3a;padding:12px 14px;gap:8px}

.msg-label{
    font-size:9px;
    font-weight:600;
    letter-spacing:2px;
    text-transform:uppercase;
    color:#00e5ff;
    opacity:0.3
}

.mm-info{
    display:flex;
    align-items:center;
    gap:10px
}
.mm-info i{
    font-size:16px;
    color:#00e5ff;
    opacity:0.2
}
.mm-info div{
    display:flex;
    flex-direction:column;
    gap:0
}
.mm-title{
    font-size:14px;
    font-weight:700;
    color:#e8e8f0
}
.mm-artist{
    font-size:11px;
    font-weight:400;
    color:#e8e8f0;
    opacity:0.12
}

.mm-bar{
    height:3px;
    background:rgba(255,255,255,0.04);
    border-radius:3px;
    overflow:hidden
}
.mm-fill{
    height:100%;
    width:0%;
    background:#00e5ff;
    border-radius:3px;
    transition:width 0.3s linear
}

.mm-ctrl{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:2px
}

#pb-btn{
    width:32px;height:32px;
    border-radius:50%;
    border:none;
    background:#00e5ff;
    color:#0d0d1a;
    font-size:12px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    transition:opacity 0.15s
}
#pb-btn:hover{opacity:0.8}
#pb-btn:active{transform:scale(0.93)}

.mm-vol{
    flex:1;height:2px;
    background:rgba(255,255,255,0.04);
    border-radius:2px;
    position:relative
}
#vol{
    position:absolute;inset:0;
    width:100%;
    -webkit-appearance:none;
    appearance:none;
    background:transparent;
    outline:none;cursor:pointer;margin:0;height:2px
}
#vol::-webkit-slider-thumb{
    -webkit-appearance:none;
    width:8px;height:8px;
    border-radius:50%;
    background:#00e5ff;
    cursor:pointer;border:none;
    box-shadow:0 0 8px rgba(0,229,255,0.2)
}
#vol::-moz-range-thumb{
    width:8px;height:8px;
    border-radius:50%;
    background:#00e5ff;
    cursor:pointer;border:none
}

/* TIKTOK BUBBLE */

.msg-tk{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:4px
}
.msg-tk i{
    font-size:16px;
    color:#e8e8f0;
    opacity:0.2
}
.msg-tk span{
    font-size:13px;
    font-weight:600;
    flex:1;
    color:#e8e8f0
}
.tk-copy{
    font-size:9px;
    font-weight:700;
    letter-spacing:1.5px;
    text-transform:uppercase;
    padding:6px 12px;
    border-radius:12px;
    border:none;
    background:rgba(0,229,255,0.08);
    color:#00e5ff;
    cursor:pointer;
    font-family:inherit;
    transition:all 0.15s
}
.tk-copy:hover{background:rgba(0,229,255,0.15)}
.tk-copy:active{transform:scale(0.95)}

/* DIVIDER */

.msg-divider{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px 0 4px
}
.msg-divider span{
    font-size:9px;
    font-weight:500;
    letter-spacing:1px;
    color:#e8e8f0;
    opacity:0.06
}

/* JOIN */

.msg-join{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:14px;
    margin:0 0 4px;
    border-radius:14px;
    background:rgba(88,101,242,0.04);
    border:1px solid rgba(88,101,242,0.06);
    text-decoration:none;
    transition:all 0.15s
}
.msg-join:hover{background:rgba(88,101,242,0.08)}
.msg-join i{font-size:16px;color:#5865f2;opacity:0.3}
.msg-join span{
    font-size:11px;
    font-weight:700;
    letter-spacing:2px;
    text-transform:uppercase;
    color:#e8e8f0;
    opacity:0.2;
    flex:1;
    text-align:center
}
.msg-join .fa-arrow-right{
    font-size:13px;
    color:#e8e8f0;
    opacity:0.04
}
.msg-join:hover .fa-arrow-right{opacity:0.1}

/* CHAT INPUT */

.ch-input{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    background:#0a0a18;
    border-top:1px solid rgba(255,255,255,0.03);
    position:sticky;
    bottom:0
}
.ch-input i{
    font-size:20px;
    color:#e8e8f0;
    opacity:0.08;
    cursor:pointer
}
.ch-field{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:8px 14px;
    background:rgba(255,255,255,0.03);
    border-radius:20px
}
.ch-field span{
    font-size:12px;
    color:#e8e8f0;
    opacity:0.06
}
.ch-field i{
    font-size:16px;
    opacity:0.04
}

/* FOOTER */

.ft{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:16px 0 20px;
    font-size:8px;
    font-weight:400;
    letter-spacing:2px;
    text-transform:uppercase;
    color:#e8e8f0;
    opacity:0.04;
    background:#0d0d1a
}
.ft-d{font-size:10px;color:#00e5ff;opacity:0.15}

/* TOAST */

#toast{
    position:fixed;
    bottom:80px;
    left:50%;
    transform:translateX(-50%) translateY(16px);
    z-index:1000;
    background:#1c1c3a;
    border-radius:16px;
    padding:10px 22px;
    font-size:12px;
    font-weight:600;
    color:#e8e8f0;
    box-shadow:0 4px 20px rgba(0,0,0,0.3);
    opacity:0;
    transition:all 0.3s ease;
    pointer-events:none;
    white-space:nowrap;
    border:1px solid rgba(255,255,255,0.03)
}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media(max-width:400px){
    #main{max-width:100%}
    .chat{border-radius:0;min-height:100vh}
}
