*{
box-sizing:border-box;
}

body{
margin:0;
font-family:Arial, sans-serif;
background:#0f0f0f;
color:white;
height:100vh;
overflow:hidden;
}

/* =========================
   MAIN LAYOUT
========================= */

.chat-container{
display:flex;
height:100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar{
width:260px;
background:#111;
border-right:1px solid #222;
padding:20px;
overflow-y:auto;
transition:0.3s;
}

.logo{
margin-top:0;
color:#00ffc8;
}

.new-chat{
width:100%;
padding:10px;
border:none;
border-radius:8px;
background:linear-gradient(45deg,#00ffc8,#0077ff);
font-weight:bold;
cursor:pointer;
margin-bottom:15px;
}

.history div{
padding:8px;
margin-bottom:6px;
background:#1a1a1a;
border-radius:6px;
cursor:pointer;
font-size:14px;
}

/* =========================
   CHAT AREA
========================= */

.chat-area{
flex:1;
display:flex;
flex-direction:column;
height:100vh;
}

/* HEADER */

.chat-header{
display:flex;
align-items:center;
gap:10px;
padding:10px 15px;
border-bottom:1px solid #222;
background:#111;
}

/* =========================
   MESSAGES
========================= */

.messages{
flex:1;
overflow-y:auto;
padding:20px;
display:flex;
flex-direction:column;
gap:12px;
}

/* MESSAGE */

.message{
padding:12px;
border-radius:12px;
max-width:75%;
white-space:pre-wrap;
word-wrap:break-word;
}

.user{
align-self:flex-end;
background:#0077ff;
}

.bot{
align-self:flex-start;
background:#1a1a1a;
border:1px solid #333;
}

/* =========================
   MARKDOWN
========================= */

.message pre{
background:#000;
padding:10px;
border-radius:6px;
overflow-x:auto;
}

.message code{
color:#00ffc8;
}

/* =========================
   INPUT AREA
========================= */

.input-area{
display:flex;
align-items:center;
padding:10px;
gap:8px;
border-top:1px solid #222;
background:#111;
}

textarea{
flex:1;
resize:none;
border:none;
border-radius:10px;
padding:10px;
font-size:16px;
background:#1a1a1a;
color:white;
max-height:120px;
overflow-y:auto;
}

textarea:focus{
outline:none;
}

/* BUTTONS */

.input-area button{
width:40px;
height:40px;
border:none;
border-radius:50%;
background:linear-gradient(45deg,#00ffc8,#0077ff);
cursor:pointer;
font-size:16px;
}

/* =========================
   MOBILE
========================= */

.menu-toggle{
display:none;
}

@media (max-width:768px){

.sidebar{
position:fixed;
left:-260px;
top:0;
height:100%;
z-index:1000;
}

.sidebar.active{
left:0;
}

.menu-toggle{
display:block;
background:none;
border:none;
color:white;
font-size:20px;
cursor:pointer;
}

.messages{
padding:15px;
}

.message{
max-width:90%;
}

}