/* =====================================================
   REDI v2 - Redeban
===================================================== */

:root{

    --primary:#003DA5;
    --secondary:#00A3E0;
    --accent:#00C2FF;

    --background:#F5F7FB;
    --card:#FFFFFF;

    --text:#1E293B;
    --muted:#64748B;

    --border:#E2E8F0;

    --success:#16A34A;
    --danger:#DC2626;

    --shadow:0 10px 30px rgba(0,0,0,.08);

    --radius:18px;

}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{

    height:100%;
    font-family:
    "Segoe UI",
    Arial,
    sans-serif;

    background:var(--background);

    color:var(--text);

}

/* =======================
   Layout
======================= */

.app{

    display:flex;

    min-height:100vh;

}

/* =======================
   Sidebar
======================= */

.sidebar{

    width:270px;

    background:linear-gradient(
        180deg,
        #003DA5,
        #002F85
    );

    color:white;

    display:flex;

    flex-direction:column;

    padding:28px;

}

.logo{

    text-align:center;

    margin-bottom:40px;

}

.logo img{

    width:180px;

}

.sidebar nav{

    display:flex;

    flex-direction:column;

    gap:12px;

}

.menu{

    border:none;

    background:transparent;

    color:white;

    text-align:left;

    padding:16px;

    border-radius:12px;

    cursor:pointer;

    transition:.25s;

    font-size:15px;

}

.menu:hover{

    background:rgba(255,255,255,.12);

}

.menu.active{

    background:white;

    color:var(--primary);

    font-weight:bold;

}

.version{

    margin-top:auto;

    font-size:12px;

    opacity:.8;

    line-height:22px;

}

/* =======================
   Main
======================= */

main{

    flex:1;

    padding:40px;

}

/* =======================
   Header
======================= */

.header{

    margin-bottom:30px;

}

.header h1{

    font-size:34px;

    font-weight:700;

}

.header h1 span{

    color:var(--primary);

}

.header p{

    color:var(--muted);

    margin-top:8px;

}

/* =======================
   Chat
======================= */

#chatContainer{

    display:flex;

    flex-direction:column;

    gap:20px;

    background:white;

    border-radius:20px;

    padding:30px;

    min-height:420px;

    max-height:60vh;

    overflow:auto;

    box-shadow:var(--shadow);

}

/* Scroll */

#chatContainer::-webkit-scrollbar{

    width:8px;

}

#chatContainer::-webkit-scrollbar-thumb{

    background:#D0D7E2;

    border-radius:20px;

}

/* =======================
   Burbujas
======================= */

.message{

    display:flex;

}

.message.user{

    justify-content:flex-end;

}

.message.bot{

    justify-content:flex-start;

}

.bubble{

    max-width:75%;

    padding:18px;

    border-radius:20px;

    line-height:1.6;

    animation:fade .25s ease;

    white-space:pre-wrap;

}

.user .bubble{

    background:var(--primary);

    color:white;

    border-bottom-right-radius:6px;

}

.bot .bubble{

    background:#EEF5FF;

    border-bottom-left-radius:6px;

}

/* =======================
   Estado
======================= */

.status{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:15px;

    margin:25px 0;

    font-weight:600;

    color:var(--primary);

}

/* =======================
   Micrófono
======================= */

.voiceArea{

    display:flex;

    justify-content:center;

    margin-bottom:25px;

}

#micButton{

    width:88px;

    height:88px;

    border-radius:50%;

    border:none;

    cursor:pointer;

    font-size:34px;

    color:white;

    background:linear-gradient(
        180deg,
        var(--secondary),
        var(--primary)
    );

    box-shadow:

    0 12px 35px rgba(0,61,165,.25);

    transition:.25s;

}

#micButton:hover{

    transform:scale(1.05);

}

/* =======================
   Ondas
======================= */

.pulse{

    width:18px;

    height:18px;

    border-radius:50%;

    background:var(--secondary);

}

.pulse.listening{

    animation:pulse 1.2s infinite;

}

.pulse.speaking{

    animation:pulseFast .6s infinite;

}

/* =======================
   Pregunta manual
======================= */

.manualQuestion{

    margin-top:20px;

    display:flex;

    gap:15px;

}

.manualQuestion textarea{

    flex:1;

    resize:none;

    min-height:90px;

    border:1px solid var(--border);

    border-radius:15px;

    padding:18px;

    font-size:15px;

    outline:none;

}

.manualQuestion textarea:focus{

    border-color:var(--secondary);

}

.manualQuestion button{

    width:170px;

    border:none;

    border-radius:15px;

    cursor:pointer;

    background:var(--primary);

    color:white;

    font-size:15px;

}

/* =======================
   Upload
======================= */

.card{

    background:white;

    padding:35px;

    border-radius:20px;

    box-shadow:var(--shadow);

    max-width:700px;

}

.card h2{

    margin-bottom:12px;

}

.card p{

    color:var(--muted);

    margin-bottom:25px;

}

.card input{

    width:100%;

    padding:14px;

    border:2px dashed var(--border);

    border-radius:12px;

    margin-bottom:20px;

}

.card button{

    background:var(--primary);

    color:white;

    border:none;

    padding:14px 28px;

    border-radius:12px;

    cursor:pointer;

}

#uploadStatus{

    margin-top:25px;

    white-space:pre-wrap;

}

/* =======================
   Loader
======================= */

#thinking{

    position:fixed;

    inset:0;

    display:none;

    justify-content:center;

    align-items:center;

    flex-direction:column;

    background:rgba(255,255,255,.75);

    backdrop-filter:blur(3px);

    z-index:999;

}

.loader{

    width:70px;

    height:70px;

    border-radius:50%;

    border:8px solid #E2E8F0;

    border-top:8px solid var(--primary);

    animation:spin .8s linear infinite;

}

#thinking p{

    margin-top:18px;

    font-weight:bold;

    color:var(--primary);

}

/* =======================
   Utilidades
======================= */

.hidden{

    display:none;

}

/* =======================
   Animaciones
======================= */

@keyframes spin{

    from{

        transform:rotate(0deg);

    }

    to{

        transform:rotate(360deg);

    }

}

@keyframes fade{

    from{

        opacity:0;

        transform:translateY(10px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}

@keyframes pulse{

    0%{

        transform:scale(.9);

        opacity:1;

    }

    100%{

        transform:scale(2.2);

        opacity:0;

    }

}

@keyframes pulseFast{

    0%{

        transform:scale(1);

        opacity:1;

    }

    100%{

        transform:scale(3);

        opacity:0;

    }

}

/* =======================
   Responsive
======================= */

@media(max-width:900px){

    .app{

        flex-direction:column;

    }

    .sidebar{

        width:100%;

    }

    main{

        padding:20px;

    }

    .manualQuestion{

        flex-direction:column;

    }

    .manualQuestion button{

        width:100%;

        height:55px;

    }

    .bubble{

        max-width:92%;

    }

}