:root{
    --bg: #0a0a0c;
    --surface: #111114;
    --surface-light: #17171b;
    --border: #26262d;
    --text: #f5f5f7;
    --muted: #96969f;
    --accent: #a78bfa;
    --accent-hover: #8b5cf6;
}
*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body{
    font-family: Inter, Arial, sans-serif;
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero{
    color:#d3d3d3;
    font-size: 14px;
}
.Chat{
    width: 90%;
    max-width: 800px;
    margin: 40px auto 24px;
    flex: 1;
    display: flex;
    gap: 18px;
    overflow-y:auto;
    flex-direction: column;
}
.Botmsg{
    margin-top: 12px;
    background-color: transparent;
    color:var(--text);
    padding: 4px 0;
    border-radius: 14px 14px 14px 4px;
    width: fit-content;
    max-width: 92%;
    line-height: 1.7;
    align-self: flex-start;
    border: none;
    

}
.Botmesg{
    font-size: 15px;
}
.input{
    width: 90%;
    max-width: 800px;
    margin: 0 auto 20px;
    display: flex;
    gap: 10px;
    background-color: var(--surface-light);
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--border);
    border-radius: 28px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
}
.input textarea{
    flex:1;
    padding : 12px 15px;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    background-color: transparent;
    color: white;
    resize: none;
    overflow-y: auto;
    max-height: 140px;
    line-height: 20px;
    height: 44px;
}
.input textarea::placeholder{
    color: #777;
}
.input textarea:focus{
    outline: none;
}
.input:focus-within{
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.08),
            0 8px 30px rgba(167, 139, 250, 0.08);
}
button{
    padding: 0 20px;
    border: none;
    border-radius: 7px;
    background: rgb(139,65,139);
    color: white;
    font-weight:bold;
    font-size: 15px;
    cursor: pointer;
    
}
button:hover{
    background: rgb(97, 45, 97);
}
.UserBubble{
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.32), rgba(89, 61, 102, 0.75));
    color:#ffffff;
    padding: 12px 15px;
    border-radius: 22px;
    width: fit-content;
    max-width: 75%;
    line-height: 1.5;
    align-self: flex-end;
    border: 1px solid rgba(167, 139, 250, 0.18);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

#status{
    display: block;
    font-size: 20px;
    margin: 20px;
}
.Thinking{
    display: none;
    background-color:var(--surface-light);
    color: var(--muted);
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: fit-content;
    max-width: 70%;
    line-height: 1.4;
    align-self: flex-start;
    flex-direction: column;
    font-style: italic;
}
.sidebar{
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 250px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background-color: var(--surface);
    color: white;
    padding: 20px;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1000;
}
.sidebar.open{
    transform: translateX(0);
}
.main{
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.chatpiece{
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.2s ease, transform 0.2s ease;

}
.chatpiece:hover{
    background-color: rgba(167, 139, 250, 0.08);
    transform: translateX(3px);

}
.sidebar h3{
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    
}
.sendbtn{
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}
.sendbtn:hover{
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.25);
    transform: scale(1.06);
    background: linear-gradient(135deg, #b9a0ff, #9d70ff);
}
.newchat{
    width: 100%;
    height: 42px;
    border-radius: 10px;
    margin-top: 6px;
    background-color: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.22);
    color: #eeeeee;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.newchat:hover{
    background-color: rgba(167, 139, 250, 0.14);
    border-color: rgba(167, 139, 250, 0.45);
    transform: translateY(-1px);
}
.sidebrand{
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebrand span{
    font-size: 24px;
    color:var(--accent);
    text-shadow: 0 0 14px rgba(167, 139, 250, 0.45);
}
.sidebrand h2{
    font-size: 18px;
    margin-bottom: 2px;
    letter-spacing: -0.4px;
}
.sidebrand p{
    font-size: 12px;
    color: #999;
}
.welcometxt{
    margin: auto;
    text-align: center;
    color: #eeeeee;
}
.welcometxt::before{
    content: "";
    position: absolute;
    width: 520px;
    height: 280px;
    background: radial-gradient(
        ellipse,
        rgba(167, 139, 250, 0.16) 0%,
        rgba(139, 92, 246, 0.08) 35%,
        transparent 70%
    );
    filter: blur(18px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}
.welcometxt h2{
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text);
}
.welcometxt p{
    color: var(--muted);
    font-size: 14px;
}
.suggestions{
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
    

}
.suggestion strong{
    font-size: 14px;
    color: var(--text);
}
.suggestion span{
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}
.suggestion:hover{
    border-color: rgba(167, 139, 250, 0.45);
    transform: translateY(-2px);
}
.suggestion{
    background-color: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    width: 230px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: 0.2s ease;
}
.chatpiece.active{
    background-color: rgba(167, 139, 250, 0.10);
    border-left: 3px solid var(--accent);
}
.list{
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.input textarea::-webkit-scrollbar{
    width: 8px;
}
.input textarea::-webkit-scrollbar-thumb{
    background: #555;
    border-radius: 10px;
}
.input textarea::-webkit-scrollbar-track{
    background: #1a1a1a;
}
.sidebaroverlay{
    position: fixed;
    inset:0;
    background-color: rgb(0,0,0,0.45);
    z-index: 950;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebaroverlay.open{
    opacity: 1;
    pointer-events: auto;
}
.quizstatus{
    display: none;
    justify-content: space-between;
    align-items: center;
    color: #bdbdbd;
    font-size: 13px;
    padding:8px 12px;
    border-bottom: 1px solid #303030;
    position: sticky;
    top : 0;
    z-index: 10;
    background-color: var(--bg);

}
.explainstatus{
    display: none;
    align-items: center;
    color: #bdbdbd;
    font-size: 13px;
    padding: 8px 12px;
    border-bottom: 1px solid #303030;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg);
}
.flashcardbox{
    display: none;
    width: 90%;
    margin: auto;
    max-width: 560px;
    background-color: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 18px;
    flex-direction: column;
    padding: 28px;
    align-items: center;
    text-align: center;
    gap: 20px;
}
.flashcardcontent{
    color: var(--text);
    font-size: 18px;
    line-height:1.5;
}
.flashcardbtn{
    height: 40px;
    padding: 0 18px;
    border-radius:10px;
}
.sidebarbtn{
    position: fixed;
    top: 18px;
    left: 18px;
    width: 36px;
    background: transparent;
    height: 36px;
    padding: 0;
    z-index: 900;
    font-size: 25px;
    color: var(--muted);
    border-radius: 8px;
    border: none;
    
}
.sidebarbtn:hover{
    background-color: #242424;
    border-radius: 8px;
}
.sideclose{
    position: absolute;
    top: 16px;
    right:16px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    font-size: 22px;
    font-weight: normal;
    border-radius: 8px;
    color: var(--muted);   
}
.sideclose:hover{
    background-color: #2a2a2a;
    color:white;
}
.sidebarbtn svg{
    width: 25px;
    height:25px;
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.sideclose svg{
    width: 22px;
    height:22px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.sendbtn:disabled{
    opacity: 0.4;
    cursor: not-allowed;
}
@media(max-width: 768px){
    .sidebar{
        width: 82%;
        max-width: 280px;
        min-width: 240px;
    }
    .sidebar{
        padding: 18px;
    }
    .newchat{
        height: 44px;
    }
    .filechip{
        max-width: 90%;
    }
    .main{
        margin-left: 0;
        width: 100%;
        min-width: 0;
        height: 100dvh;
    }
    .Chat{
    width: 100%;
    max-width: none;
    margin: 56px 0 12px;
    padding: 0 16px;
    gap: 12px;
}
    .input{
        width: 94%;
        margin: 0 auto 12px;
        padding: 5px 5px 5px 10px;
    }
    .sendbtn{
        width: 38px;
        height: 38px;
    }
    .attachbtn{
        font-size: 20px;
        padding: 6px;
    }
    .input textarea{
        height: 42px;
        padding: 11px 10px;
    }
    .welcometxt::before{
        width: 380px;
        height: 220px;
    }
    .welcometxt{
    width: 100%;
    padding: 0 8px;
}
    .suggestions{
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
    .suggestion{
        width: 100%;
        max-width: 340px;
        padding: 13px 15px;
    }
    .welcometxt h2{
        font-size: clamp(21px, 6vw, 24px);
        text-align: center;
    }
    .welcometxt > p{
        font-size: 14px;
        text-align: center;
        padding: 0 16px;
    }
    .Botmsg{
        max-width: 90%;
    }
    .UserBubble{
        max-width: 90%;
    }
    .flashcardbox{
        width: 100%;
        padding: 22px;

        
    }
    .Botmsg,
    .UserBubble{
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .input textarea{
    font-size: 16px;
}
}
.attachbtn{
    background: transparent;
    border:none;
    color:var(--muted);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.attachbtn:hover{
    color: var(--text);
    background-color: rgba(167, 139, 250, 0.12);
    transform: scale(1.05);
}
.filechip{
    display: none;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 7px 10px;
    max-width: 300px;
    margin : 0 auto 8px;
    background-color: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    border-radius: 10px;
}
.removefile{
    background: transparent;
    border: none;
    color: var(--muted);
    cursor:pointer;
    font-size: 17px;
    padding: 0;
}
.removefile:hover{
    color: var(--text);
}
