/* ================= GLOBAL ================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;

   background: #0b0f14;

}

body {
    display: flex;
    flex-direction: column;


    height: var(--app-height);
    overflow: hidden;

    margin: 0;

    background: #050505;
    color: #eaeaea;

    overflow: hidden;

    font-family: Consolas, monospace;
}



/* reset inputs blancs iOS/Chrome */
input, button, textarea {
    font-family: inherit;
    color: inherit;
    background: none;
}

/* ================= LOGIN ================= */



#login {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 9999;

  display: flex;
    flex-direction: column;

    align-items: center;

    gap: 20px; /* espace entre tous les éléments */


}

#login form,
#login > div {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    max-width: 380px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 20px;

    background: #121212;
    border: 1px solid #2a2a2a;
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

#login input {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    
    height: 44px;
    min-height: 44px;
    max-height: 44px;

    box-sizing: border-box;

    flex: 0 0 auto; /* empêche flex de les redimensionner */

    border: none;
    outline: none;

    border-radius: 10px;

    padding: 0 12px;

    background: #1e1e1e;
    color: #eaeaea;

    font-size: 14px;
}



.login-btn {
    width: 100%;
    height: 46px;

    border: none;
    border-radius: 12px;

    background: linear-gradient(135deg, #00aaff, #0066ff);
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    transition: all 0.2s ease;

    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.25);
}

/* hover desktop */
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(0, 102, 255, 0.35);
    filter: brightness(1.05);
}

/* clic */
.login-btn:active {
    transform: scale(0.98);
    box-shadow: 0 6px 15px rgba(0, 102, 255, 0.2);
}

/* état loading (option futur JS) */
.login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* spinner optionnel */
.login-btn.loading::after {
    content: "";
    width: 14px;
    height: 14px;

    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================= TOPBAR ================= */
#topbar {

    position: fixed;

    top: 0;
    left: 0;
    right: 0;

     height: 60px;
    
     flex: 0 0 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 12px;

    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    z-index: 999;

}

#back-btn {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: lightblue;
    color: #338feb;
    border: 1px solid #338feb;

    font-size:18px;  
    cursor: pointer;
}

#title-pill {
    padding: 8px 16px;
    border-radius: 999px;

    background: #222;
    border: 1px solid #333;

    font-size: 16px;
}

#user-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;
    object-fit: cover;
}

/* ================= TERMINAL ================= */
#terminal {

    position: absolute;
    top: 60px;
    bottom: 60px;

    left: 0;
    right: 0;

    overflow-y: auto;

    flex: 1;
    min-height: 0;
   
    height: calc(100vh - 160px);

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    overflow-x: hidden;

    box-sizing: border-box;
 
    font-size: 18px;
    line-height: 1.5;


    background-color: #0b3d2e;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.03), transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(0,0,0,0.25), transparent 50%);

   
    /* effet feutre léger */
    box-shadow: inset 0 0 80px rgba(0,0,0,0.35);


}

#terminal::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.02) 0px,
            rgba(0,0,0,0.02) 2px,
            transparent 4px
        );

    opacity: 0.15;
}


/* ================= INPUT BAR ================= */
#input-bar {
    position: fixed;

    box-sizing: border-box;
    height: 60px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));

    background: #141414;
    border-top: 1px solid #2a2a2a;

    left: 0;
    right: 0;
    bottom: 44px;

    z-index: 999;
}

.icon-btn {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: #2b2b2b;

    cursor: pointer;
    transition: 0.2s;
}

.icon-btn:active {
    transform: scale(0.95);
}

/* trombone */
#attach-btn svg {
    stroke: #9a9a9a;
    stroke-width: 1.2px;
    fill: none;
}

/* input */
#cmdInput {
    flex: 1;
    height: 44px;

    border: none;
    outline: none;

    border-radius: 999px;

    padding: 0 14px;

    background: #222;
    color: #eaeaea;

    font-size: 15px;
}

/* ================= MIC / SEND ================= */
.icon-send,
.icon-mic {
    display: flex;
    align-items: center;
    justify-content: center;
}

#input-bar.has-content #mic-btn {
    background: #0088cc;
}

/* toggle icons */
#input-bar.has-content .icon-mic { display: none; }
#input-bar:not(.has-content) .icon-send { display: none; }

/* ================= LINES ================= */
.line {
    margin: 4px 0;
}


/* ================= MENU ================= */



.menu-box {

    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* IMPORTANT : chaque row garde ses enfants */

.menu-row {
    display: flex;
    gap: 8px;
}



.menu-btn {
    flex: 1 1 0;
    min-width: 0;

    padding: 12px;
    background: #eaf4fc;
    color : #338feb;
    border-radius: 6px;
    border: 1px solid lightblue;

    text-align: center;
    cursor: pointer;

    white-space: pre-line;

    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

}


.menu-box.burst .menu-btn {
    animation: burst 0.25s ease forwards;
}

@keyframes burst {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(1.4) translate(var(--x), var(--y));
        opacity: 0;
        filter: blur(6px);
    }
}


/* ================= AUDIO ================= */
.audio-message {
    margin: 10px 0;
    padding: 5px;
}

/* ❌ SUPPRESSION DU BLANC INVERT FORCÉ (important) */
.audio-message audio {
    height: 35px;

    background: #1a1a1a;
    border-radius: 12px;

    outline: none;
}



.user {
    color: #eafff2;   /* texte principal lumineux (lisible sur vert) */
}

.system {
 //   color: #a7d7c5;   /* vert-gris doux, neutre système */
 color: #000;

}

.error {
 //   color: #ff6b6b;
 color: #000;
 }

.success {
//    color: #3ddc97;
color: #338feb;
 }

.lime-text {
    color: #9effb8;
}



.file-msg {
    display: flex;
    justify-content: flex-start;
    margin: 6px 0;
}

.file-card {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #161616;
    border: 1px solid #2a2a2a;

    padding: 10px 12px;
    border-radius: 14px;

    width: 85%;
    max-width: 340px;

    color: #eaeaea;
}

.file-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 24px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;

    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 11px;
    opacity: 0.5;
}

.file-actions {
    display: flex;
    gap: 6px;
}

.file-actions button {
    background: #222;
    border: none;
    color: #fff;

    padding: 6px 8px;
    border-radius: 8px;

    cursor: pointer;
}

.file-actions .delete {
    background: #ff3b30;
}



.confirm-box{
    background:#1f1f1f;
    border:1px solid #333;
    border-radius:16px;
    padding:15px;
    max-width:320px;
    margin:10px auto;
    box-shadow:0 4px 20px rgba(0,0,0,.4);
}

.confirm-title{
    font-size:18px;
    font-weight:bold;
    margin-bottom:10px;
    color:#fff;
}

.confirm-text{
    color:#ccc;
    margin-bottom:15px;
}

.confirm-buttons{
    display:flex;
    gap:10px;
}

.confirm-buttons button{
    flex:1;
    border:none;
    border-radius:10px;
    padding:12px;
    font-weight:bold;
    cursor:pointer;
}

.btn-ok{
    background:#2ecc71;
    color:#fff;
}

.btn-cancel{
    background:#e74c3c;
    color:#fff;
}






