:root { --sidebar-bg: #202123; --main-bg: #343541; --text-color: #ececf1; --input-bg: #40414f; --ai-bubble: #444654; }

html, body { height: 100%; margin: 0; padding: 0; background-color: var(--main-bg); overflow: hidden; }
.app-container { display: flex; height: 100%; width: 100%; position: relative; }

/* Sidebar */
.sidebar { 
    width: 280px; background: var(--sidebar-bg); height: 100%; 
    position: fixed; left: -280px; top: 0; z-index: 1050; 
    transition: transform 0.3s ease; display: flex; flex-direction: column; padding: 15px;
}
.sidebar.show { transform: translateX(280px); }

@media (min-width: 992px) {
    .sidebar { left: 0; position: relative; transform: none; }
    .mobile-header { display:'' !important; }
}

/* Chat Area */
.main-content { flex: 1; display: flex; flex-direction: column; height: 100%; width: 100%; position: relative; }
.mobile-header { background: var(--sidebar-bg); padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #4d4d4f; }
#chat-area { flex: 1; overflow: auto; padding: 15px; display: flex; flex-direction: column; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

.msg-row { padding: 30px; display: flex; border-radius: 8px; margin-bottom: 15px; width: 93%;  word-break: break-word;  }
.ai-row { background: var(--ai-bubble);  overflow: none;word-break: break-word; }
.avatar { width: 32px; height: 32px; border-radius: 4px; margin-right: 12px; flex-shrink: 0; }
.msg-text { font-size: 0.95rem; word-break: break-word; color: var(--text-color); overflow:auto;}

/* Input */
.input-wrapper { padding: 15px; background: var(--main-bg); border-top: 1px solid #4d4d4f; }

.input-box {
    display: flex;
    align-items: flex-end; /* Textarea upar badhega, icon niche rahenge */
    background: var(--input-bg); /* Gemini dark theme color */
    border: 1px solid #3c4043;
    border-radius: 24px;
    padding: 8px 15px;
    transition: border 0.3s ease;
    width:95%;
    margin: 0 auto;
}

.input-box:focus-within {
    border: 1px solid #8ab4f8;
}

#userInput {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    outline: none;
    resize: none; /* User manually resize na kar sake */
    max-height: 200px; /* Isse zyada bada na ho, scrollbar aa jaye */
    padding: 8px;
    line-height: 1.5;
    font-family: inherit; 
}
/* Icons alignment fix */
#micBtn, #sendBtn, #stopBtn {
    margin-bottom: 10px; /* Ye icons ko ekdum bottom edge se thoda upar rakhega */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
}



/* Components */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1040; }
.sidebar-overlay.show { display: block; }
.new-chat-btn { border: 1px solid #555; padding: 10px; border-radius: 5px; cursor: pointer; margin-bottom: 20px; text-align: center; color: white; }
.history-item { padding: 12px; cursor: pointer; border-radius: 5px; font-size: 0.9rem; color: #c5c5d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item:hover { background: #2b2c2f; }
.hidden { display: none !important; }
.typing-cursor { font-weight: bold; animation: blink 0.7s infinite; }
@keyframes blink { 50% { opacity: 0; } } 
.msg-text p { margin-bottom: 1rem; width:95%; word-break: break-word;  }
.msg-text ul, .msg-text ol { margin-bottom: 1rem; padding-left: 1.5rem; }




/* IDE Background & Container */
pre[class*="language-"] {
    position: relative;
    padding: 30px 15px 15px 15px !important;
    background: #1a1b26 !important; /* Professional Dark Blue/Black */
    border-radius: 10px;
    border: 1px solid #3b3d4b;
    margin: 15px 0;
    width:90%;
}

/* Language Label (Top Left) */
pre[class*="language-"]::before {
    content: attr(data-language);
    position: absolute;
    top: 5px;
    left: 15px;
    font-size: 11px;
    color: #565f89;
    text-transform: uppercase;
    font-weight: bold;
    width:90%;
}
/* Ensure code text is visible and colorful */
code[class*="language-"],
pre[class*="language-"] {
    color: #ccc; 
    text-shadow: none !important;
    font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace !important;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;
}
/* Floating Copy Button (Top Right) */
.code-copy-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: #24283b;
    color: #a9b1d6;
    border: 1px solid #414868;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.3s;
}

.code-copy-btn:hover {
    background: #414868;
    color: #fff;
}

/* Code block ke andar faltu ki spacing hatane ke liye */
pre code {
    display: block;
    padding: 0;
    margin: 0;
    line-height: 1.5; /* Line spacing ko maintain karne ke liye */
}

pre {
    margin-bottom: 15px !important;
    white-space: pre-wrap; /* Lambi lines ko wrap karega par extra space nahi dega */
}

/*Query copy & modify*/
.msg-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.msg-row:hover .msg-actions {
    opacity: 1;
}

.action-btn {
    cursor: pointer;
    font-size: 0.85rem;
    color: #acacbe;
}

.action-btn:hover {
    color: #ffffff;
}

.copy-success {
    color: #4ade80 !important; /* Green color on success */
}
.msg-actions .action-btn:hover { opacity: 1; color: #fff; }