/* Mobile Menu Spacing */

@media(max-width:900px){







.logo{

font-size:24px;
align-items:left;
align-content:left;
align-self: left;

}

}



.app{

display:flex;

height:100vh;

}


/* Sidebar */

#sidebar{

width:300px;

padding:25px;

background:

rgba(255,255,255,.06);

backdrop-filter:blur(20px);

border-right:

1px solid rgba(255,255,255,.15);

}



.brand{

font-size:28px;

margin-bottom:30px;

}



#newChatBtn{

width:100%;

height:50px;

margin-bottom:30px;
background-color:#ffffff;

}



#sidebar h3{

color:#c4b5fd;

margin-bottom:15px;

}



#history{

overflow-y:auto;

height:70vh;

}



.history-item{

padding:14px;

border-radius:15px;

margin-bottom:10px;

cursor:pointer;

background:

rgba(255,255,255,.08);

transition:.3s;

}


.history-item:hover{

background:

rgba(255,255,255,.18);

}




*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Inter", "Segoe UI", sans-serif;
}


body{
    margin:0;
    background:#070707;
    color:white;
    font-family:Arial, sans-serif;
    overflow:hidden;
}


/* Header */

header{

    height:80px;

    display:flex;
    align-items:center;

    padding:0 30px;

    background:
    none;
    
    
    

}


.logo{

    font-size:28px;

    font-weight:700;

    letter-spacing:1px;

    background:
    linear-gradient(
    90deg,
    #fff,
    #d8b4fe
    );

    -webkit-background-clip:text;

    color:transparent;

}



/* Chat */



#newChatWelcome{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    text-align:center;
    color:white;
    pointer-events:none;
    z-index:1;
}

#newChatWelcome.hide{
    display:none;
}



.message{
    max-width: 750px;
    padding: 20px 24px;
    margin-bottom: 22px;
    border-radius: 24px;

    font-size: 18px;
line-height: 1.9;   /* More spacing between lines */

    animation: slide .3s ease;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: auto;
}
.message p{
    margin-bottom: 14px;
}

.message p:last-child{
    margin-bottom: 0;
}

@keyframes slide{

from{

opacity:0;

transform:translateY(15px);

}

to{

opacity:1;

transform:translateY(0);

}

}



.user{

    margin-left:auto;

    background:

    linear-gradient(
    135deg,
    #7c3aed,
    #4f46e5
    );

    

}



.ai{

    background:

    rgba(255,255,255,.08);

    backdrop-filter:blur(20px);

    border:

    1px solid rgba(255,255,255,.15);

}

main{
    flex:1;
    display:flex;
    flex-direction:column;
    position:relative;
    overflow:hidden;
    min-width:0;
}

/* Input Area */

/* Floating AI input bar */
.input-area{
    position:absolute;
    left:24px;
    right:24px;
    bottom:20px;
    
    display:flex;
    align-items:center;      /* Center everything */
    gap:12px;

    padding:12px;

    background:#343541;
    border:1px solid #4d4d4d;
    border-radius:28px;
}










/* Mobile */
@media(max-width:600px){

    .input-area{

        width: 92%;

        bottom:15px;

        border-radius:22px;

    }

    #prompt{

        font-size:15px;

    }

}



textarea{

    flex:1;

    height:65px;

    resize:none;

    padding:20px;

    border-radius:30px;

    border:none;

    outline:none;


    background:

    rgba(255,255,255,.1);

    backdrop-filter:blur(20px);


    color:white;

    font-size:16px;


    border:

    1px solid rgba(255,255,255,.2);

}



textarea::placeholder{

    color:#c4b5fd;

}



button{
    border:none;
    cursor:pointer;
    font-family:inherit;
}


button:hover{

    transform:
    translateY(-3px);


  

}



/* Scrollbar */

::-webkit-scrollbar{

width:8px;

}


::-webkit-scrollbar-thumb{

background:#8b5cf6;

border-radius:10px;

}



/* Mobile */

@media(max-width:600px){







button{

width:80px;

}

}
@media(max-width:800px){

#sidebar{

position:absolute;

left:-300px;

height:100%;

z-index:10;

transition:.3s;

}




}
.history-item-wrapper{

display:flex;

align-items:center;

gap:8px;

margin-bottom:10px;

}


.history-item{

flex:1;

padding:14px;

border-radius:15px;

cursor:pointer;

background:

rgba(255,255,255,.08);

transition:.3s;

overflow:hidden;

white-space:nowrap;

text-overflow:ellipsis;

}


.history-item:hover{

background:

rgba(255,255,255,.18);

}



.delete-chat{

    width:40px;
    height:40px;

    padding:0;

    border-radius:50%;

    background:rgba(255,255,255,.1);

    

    transform:none;

}


.delete-chat:hover{

    background:#ef4444;

    transform:none;

    

}
.account-box{

position:absolute;

bottom:25px;

left:25px;

right:25px;

}


#loginBtn{

width:100%;

height:50px;

border-radius:25px;

}


#profile{

display:flex;

align-items:center;

gap:12px;

background:
rgba(255,255,255,.1);

padding:10px;

border-radius:20px;

}


#profileImg{

width:45px;

height:45px;

border-radius:50%;

}

#logoutBtn{
    width:100px;
    height:40px;
}
.preview-btn{

margin-top:15px;

padding:10px 20px;

border-radius:20px;

border:none;

cursor:pointer;

background:
linear-gradient(
135deg,
#8b5cf6,
#6366f1
);

color:white;

font-weight:600;

}


.preview-btn:hover{

transform:translateY(-2px);

}
#menuBtn{

display:block;

width:45px;
height:45px;

border-radius:50%;

font-size:22px;

flex-shrink:0;
align-items:right;


}


@media(max-width:900px){





#sidebar{

position:fixed;

top:0;

left:-320px;

height:100vh;

z-index:15;

transition:.3s;

}


#sidebar.open{

left:0;

}





}
#closeMenu{

display:none;

position:absolute;

right:20px;

top:20px;

width:40px;

height:40px;

border-radius:50%;

font-size:18px;

}


#overlay{

display:none;

position:fixed;

inset:0;

background:rgba(0,0,0,.4);

z-index:10;

}



@media(max-width:800px){


#closeMenu{

display:block;

}



#sidebar{

z-index:20;

}



#sidebar.open + #overlay{

display:block;

}

}

#menuBtn:hover,
#closeMenu:hover,
.delete-chat:hover{

transform:none;



}






#mic.listening{

background:#ef4444;

animation:pulse 1s infinite;

}


@keyframes pulse{

0%{
transform:scale(1);
}

50%{
transform:scale(1.1);
}

100%{
transform:scale(1);
}

}




#plusMenu{

position:absolute;

bottom:100px;

left:25px;

display:none;

flex-direction:column;

gap:10px;

padding:15px;

background:

rgba(20,20,30,.9);

backdrop-filter:blur(20px);

border-radius:20px;

border:1px solid rgba(255,255,255,.15);

}


#plusMenu button{

width:220px;

height:45px;

border-radius:15px;

font-size:15px;

text-align:left;

padding-left:20px;

}



#plusMenu.show{

display:flex;

}
.credits{
    margin-top:14px;
    text-align:center;
    font-size:12px;
    color:#9ca3af;
    line-height:1.5;
}

.credits strong{
    color:#ffffff;
    font-weight:600;
}
#logomine{
    width:70px;
    height:70px;
    object-fit:contain;
    flex-shrink:0;
}

.ai-logo{
    width:120px;
    height:120px;
    border-radius:24px;
    display:block;
    margin:15px auto;
    object-fit:cover;
}
.ai-logo{
    width:70px;
    height:70px;
    display:block;
    margin:15px auto;
    border-radius:18px;
}


.preview-btn{
    margin-top:10px;
    padding:8px 16px;
    background:#2563eb;
    color:#fff;
    border:none;
    border-radius:10px;
    cursor:pointer;
    font-size:14px;
    font-weight:600;
    transition:.2s;
}

.preview-btn:hover{
    background:#1d4ed8;
}

.code-actions{
    display:flex;
    gap:8px;

    padding:10px 14px;

    background:#1f1f1f;

    border-top:1px solid #333;
}

.code-actions button{

    width:auto;

    height:32px;

    padding:0 12px;

    display:flex;

    align-items:center;

    gap:7px;


    background:#2f2f2f;

    color:#d1d5db;

    border:1px solid #444;

    border-radius:8px;


    font-size:13px;

    font-weight:500;


    cursor:pointer;

    transition:.2s;

}


.code-actions button:hover{

    background:#3a3a3a;

    color:white;

}
.code-actions i{

    font-size:13px;

}
.copy-btn{
    background:#2563eb;
}

.preview-btn{
    background:#16a34a;
}

.retry-btn{
    background:#ea580c;
}

.helpful-btn{
    background:#7c3aed;
}

.code-actions{
    display:flex;
    gap:10px;
    margin-top:10px;
}

.code-actions button{
    padding:8px 14px;
    border:none;
    border-radius:8px;
    cursor:pointer;
}
.message{
max-width:100%;
overflow-wrap:anywhere;

}

.message pre{

overflow:auto;

max-width:100%;

white-space:pre;

padding:15px;

border-radius:15px;

}

.message code{

display:block;

min-width:max-content;

}


.code-block{
    margin-top:15px;
    background:#111827;
    border:1px solid #374151;
    border-radius:18px;
    overflow:hidden;
}

.code-header{
    background:#1f2937;
    padding:12px 18px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-weight:600;
    color:white;
}

.code-block pre{
    margin: 0;
    padding: 20px;
    overflow: auto;

    font-family: Consolas, monospace;
    font-size: 15px;
    line-height: 1.7;
}

.code-actions{
    display:flex;
    gap:10px;
    padding:15px;
    background:#1f2937;
}

.code-actions button{
    width:auto;
    padding:8px 18px;
}

#menuBtn,
#plusBtn,
#mic,
#send{

    width:42px;
    height:42px;

    min-width:42px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:none;
    border-radius:50%;

    background:#ffffff;
    color:#111827;

    font-size:18px;

    cursor:pointer;

    transition:.15s;
}


#menuBtn:hover,
#plusBtn:hover,
#mic:hover,
#send:hover{

    background:#e5e5e5;

}
#send{
    background:#ffffff;
    color:#000000;
}


.message-actions{
    display:flex;
    justify-content:flex-end;
    margin-top:10px;
}

.copy-message-btn{
    background:#1f1f1f;
    color:white;
    border:none;
    border-radius:10px;
    padding:8px 14px;
    cursor:pointer;
    transition:.2s;
    font-size:14px;
}

.copy-message-btn:hover{
    background:#303030;
}

.message-actions{
    display:flex;
    gap:8px;
    margin-top:12px;
    opacity:.6;
    transition:.2s;
}

.message.ai:hover .message-actions{
    opacity:1;
}

.message-actions button{
    width:34px;
    height:34px;
    border:none;
    border-radius:10px;
    background:transparent;
    color:#d7d7d7;
    cursor:pointer;
    font-size:18px;
    transition:.2s;
}

.message-actions button:hover{
    background:#2b2b2b;
    transform:scale(1.08);
}

.message-actions button.active{
    background:#3b82f6;
    color:white;
}

/* ==============================
   Floating Pillow AI Input Bar
============================== */




/* Text box */

#prompt {

    flex: 1;

    min-height: 55px;

    max-height: 180px;


    resize: none;


    background: rgba(255,255,255,0.05);


    border: none;

    outline: none;


    color: white;


    font-size: 16px;


    padding: 15px 18px;


    border-radius: 22px;


    line-height: 1.5;

}


#prompt::placeholder {

    color: rgba(255,255,255,0.55);

}



/* Buttons */








#plusBtn:hover,
#mic:hover,
#send:hover {

    background:rgba(255,255,255,0.2);

}



/* Mobile */

@media(max-width:600px){

    .input-area{

        width:92%;

        bottom:15px;

        padding:10px;

    }




    #send{

        padding:0 12px;

    }

}




#chat{
    flex:1;
    overflow-y:auto;

    padding:30px;
    padding-bottom:150px; /* space for input */

    scroll-behavior:smooth;
}
.input-area.hide-input{
    opacity:0;
    pointer-events:none;
    transform:translateX(-50%) translateY(30px);
}

.credits{
    margin-bottom:20px;
}

#loginBtn,
#profile{
    margin-top:10px;
}
/* New Chat + Login + Logout buttons */

#newChatBtn,
#loginBtn,
#logoutBtn{

    width:100%;

    height:42px;

    display:flex;
    align-items:center;
    justify-content:center;

    gap:10px;

    background:#ffffff;

    color:#111827;

    border:none;

    border-radius:10px;

    font-size:15px;

    font-weight:500;

    cursor:pointer;

    transition:.15s;
}


#newChatBtn:hover,
#loginBtn:hover,
#logoutBtn:hover{

    background:#e5e5e5;

}

.canvasPanel{

    position:fixed;

    top:50%;
    left:50%;

    width:70%;
    height:80vh;

    transform:translate(-50%,-50%) scale(.95);

    background:#212121;

    border-radius:20px;

    border:1px solid #444;

    display:flex;
    flex-direction:column;

    opacity:0;
    pointer-events:none;

    transition:.25s;

    z-index:100;

}


.canvasPanel.open{

    opacity:1;

    pointer-events:auto;

    transform:translate(-50%,-50%) scale(1);

}



.canvas-header{

    height:55px;

    padding:0 18px;


    display:flex;

    align-items:center;

    justify-content:space-between;


    border-bottom:1px solid #333;

    font-weight:600;

}



#closeCanvas{

    width:35px;

    height:35px;

    border-radius:50%;

    background:#333;

    color:white;

}



#canvasEditor{

    flex:1;

    resize:none;


    padding:20px;


    background:#171717;


    color:white;


    border:none;

    outline:none;
    display:none;

    font-size:16px;

    line-height:1.6;

}



.canvas-tools{

    padding:12px;

    display:flex;

    gap:10px;

}


.canvas-tools button{

    background:white;

    color:black;

    padding:8px 18px;

    border-radius:10px;

}


.CodeMirror{

height:auto;
width:100%;

background:#212121;

color:white;

font-size:15px;

line-height:1.6;

padding:20px;
flex: 1;
}


#canvasOverlay{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.5);

    backdrop-filter:blur(5px);

    opacity:0;

    pointer-events:none;

    z-index:90;

}



#canvasOverlay.show{

    opacity:1;

    pointer-events:auto;

}

.canvas-dropdown{
    position:relative;
}


#canvasOptions{

    position:absolute;

    left:100%;
    top:0;

    margin-left:5px;

    width:220px;

    padding:10px;

    background:#2f2f2f;

    border:1px solid #444;

    border-radius:14px;

    display:none;

    flex-direction:column;

    gap:8px;
}


#canvasOptions button{

    width:100%;

    height:42px;

    display:flex;

    align-items:center;

    gap:12px;

    background:transparent;

    color:white;

    border-radius:10px;

    padding:0 15px;

}


#canvasOptions button:hover{

    background:#444;

}



#canvasOptions{
    display:none;
}


#canvasOptions.show{
    display:flex;
}



.canvas-dropdown::after{

    content:"";

    position:absolute;

    top:0;

    left:100%;

    width:20px;

    height:100%;

}

#customizePanel{

position:fixed;

top:50%;
left:50%;

transform:translate(-50%,-50%);

width:400px;

padding:25px;

background:#18181b;

border:1px solid #333;

border-radius:25px;

display:none;

z-index:100;


}


#customizePanel.show{

display:block;

}


.custom-header{

display:flex;

justify-content:space-between;

align-items:center;

margin-bottom:20px;

}


#customizePanel select,
#customizePanel input{

width:100%;

height:45px;

margin:10px 0 20px;

border-radius:12px;

padding:10px;

}


#saveCustomize{

width:100%;

height:45px;

background:white;

color:black;

border-radius:20px;

}


/* =========================
   CUSTOMIZE BUTTON
========================= */

#customizeBtn {
    width: 100%;
    padding: 11px 16px;

    border: none;
    border-radius: 12px;

    background: #ffffff;
    color: #000000;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#customizeBtn:hover {
    background: #eeeeee;
}

#customizeBtn:active {
    transform: scale(0.97);
}

/* =========================
   CUSTOMIZATION BUTTONS
========================= */

#customizePanel button {
    border: none;
    border-radius: 12px;

    background: #ffffff;
    color: #000000;

    padding: 11px 16px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#customizePanel button:hover {
    background: #eeeeee;
}

#customizePanel button:active {
    transform: scale(0.97);
}

#customizePanel {
    position: fixed;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%) scale(0.95);

    width: min(420px, calc(100% - 30px));

    padding: 24px;

    background: #181818;
    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 20px;

    box-shadow: 0 20px 60px rgba(0,0,0,0.45);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;

    z-index: 9999;
}

#customizePanel.show {
    opacity: 1;
    visibility: visible;

    transform: translate(-50%, -50%) scale(1);
}

#customizePanel select {
    width: 100%;

    padding: 11px 14px;

    margin-top: 6px;

    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;

    background: #222;
    color: white;

    outline: none;

    font-size: 14px;
}

.customize-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin-top: 20px;
}

.customize-actions button {
    width: 100%;
}

/* =========================
   CANVAS CLOSE BUTTON
========================= */

.closeCanvas {
    position: absolute;
    top: 14px;
    right: 14px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;

    font-size: 22px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease;
}

.closeCanvas:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(90deg);
}

.closeCanvas:active {
    transform: rotate(90deg) scale(0.9);
}

body.light .closeCanvas {
    background: rgba(0, 0, 0, 0.06);
    color: #111;
}

body.light .closeCanvas:hover {
    background: rgba(0, 0, 0, 0.12);
}
@media (min-width: 900px) {
    #menuBtn {
        display: none !important;
    }
}
@media (max-width: 768px) {

    #chat {
        padding-bottom: 135px;
    }

    .input-area {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;

        padding-bottom: calc(
            10px + env(safe-area-inset-bottom)
        );
    }

    #sidebar {
        height: 100dvh;
        max-height: 100dvh;

        overflow-y: auto;

        padding-bottom: calc(
            50px + env(safe-area-inset-bottom)
        );

        box-sizing: border-box;
    }

    #history {
        padding-bottom: 40px;
    }

}