/* Base styles */
body {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top Navigation - COPY of index.html style */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: transparent;
    border-bottom: 1px solid #eaeaea;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(90deg, #9C27B0, #673AB7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a.nav-button {
    margin-left: 15px;
    padding: 8px 16px;
    border: 2px solid #A84DF2;
    border-radius: 20px;
    background-color: white;
    color: #A84DF2;
    font-weight: 600;
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    transition: background 0.2s, color 0.2s;
}

.nav-links a.nav-button:hover,
.nav-links a.nav-button.active {
    background: linear-gradient(90deg, #9C27B0, #673AB7);
    color: white;
}

/* Chat Section */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
}

.user-message {
    align-self: flex-end;
    background: #f0eaff;
    color: #333;
    border-radius: 20px 20px 0px 20px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
    max-width: 70%;
}

.ai-message {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-radius: 20px 20px 20px 0px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
    max-width: 70%;
    position: relative;
}

/* Typing Animation */
.ai-message.typing::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    background: #A84DF2;
    animation: blink 1s infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Thinking Bar (Hidden) */
.thinking {
    display: none;
}

/* Input Bar */
.input-bar {
    display: flex;
    align-items: center;
    border-top: 1px solid #eee;
    padding: 10px;
    box-sizing: border-box;
}

.input-bar input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
}

.input-bar button {
    margin-left: 10px;
    padding: 12px 16px;
    background: linear-gradient(90deg, #A84DF2, #C168F9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

/* Upload button */
.upload-button {
    margin-right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #A84DF2;
    user-select: none;
}

/* File Preview Bubble (ChatGPT-style) */
.file-preview-bubble {
    align-self: flex-end;
    background: #d8c6ff;
    color: #333;
    border-radius: 20px 20px 0px 20px;
    padding: 10px 16px;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
    max-width: 70%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
}

.file-preview-bubble button {
    background: none;
    border: none;
    font-size: 18px;
    color: #7b2cbf;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
}  /* ← fixed: close .main + @media properly */

/* Transparent Download Button */
.download-button {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: white;
    background: linear-gradient(90deg, rgba(168, 77, 242, 0.15), rgba(193, 104, 249, 0.15));
    border: 1px solid rgba(168, 77, 242, 0.4);
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s, border 0.3s;
}

.download-button:hover {
    background: linear-gradient(90deg, rgba(168, 77, 242, 0.3), rgba(193, 104, 249, 0.3));
    border-color: rgba(168, 77, 242, 0.6);
}

/* =========================
   ChatGPT-style expanding textarea (ADD-ONLY)
   ========================= */
.input-bar { 
    display: flex; 
    align-items: flex-end; /* keep send button aligned with bottom of textarea */
    gap: 10px;
}

/* Style the new <textarea id="chatInput"> exactly like your old input */
.input-bar textarea#chatInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
    color: #333;
    background: #fff;
    box-sizing: border-box;

    /* auto-expand behavior like ChatGPT */
    resize: none;
    overflow-y: auto;
    min-height: 44px;     /* initial height similar to input */
    max-height: 200px;    /* cap growth at ~6–8 lines */
}

/* keep the send button aligned when textarea grows */
.input-bar button#sendButton {
    align-self: flex-end;
}
