:root {
    --bg-main: #131314;
    --bg-sidebar: #1e1f20;
    --bg-input: #1e1f20;
    --bg-hover: #333537;
    --text-primary: #e3e3e3;
    --text-secondary: #c4c7c5;
    --accent: #a8c7fa;
    --btn-blue: #004a77;
    --btn-blue-hover: #005c93;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Google Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 10px;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 68px;
}

.sidebar.collapsed .new-chat-btn span,
.sidebar.collapsed .recent-section,
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

.sidebar-header {
    padding: 10px 8px;
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
}

.menu-icon:hover {
    background-color: var(--bg-hover);
}

.new-chat-btn {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border: none;
    border-radius: 20px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 10px 0 20px 0;
    width: max-content;
}

.sidebar.collapsed .new-chat-btn {
    padding: 12px;
    border-radius: 50%;
}

.new-chat-btn:hover {
    background-color: var(--bg-hover);
}

.recent-section {
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 14px;
    color: var(--text-primary);
    padding: 10px 15px;
    font-weight: 500;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.recent-item:hover {
    background-color: var(--bg-hover);
}

.recent-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
}

.user-profile:hover {
    background-color: var(--bg-hover);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #00796b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at center, #1e2023, #131314 60%);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 24px;
}

.logo-text {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
}

.upgrade-btn {
    background-color: var(--btn-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.upgrade-btn:hover {
    background-color: var(--btn-blue-hover);
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.welcome-screen h2 {
    font-size: 40px;
    font-weight: 500;
    background: linear-gradient(74deg, #4285f4 0, #9b72cb 9%, #d96570 20%, #d96570 24%, #9b72cb 35%, #4285f4 44%, #9b72cb 50%, #d96570 56%, #131314 75%, #131314 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    animation: gradientShift 5s infinite linear;
    background-size: 400% 100%;
}

@keyframes gradientShift {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.messages {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 150px;
}

.message-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

.user-row {
    justify-content: flex-end;
}

.bot-row {
    justify-content: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bot-row .message-avatar {
    background-image: url('assets/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.message-content {
    max-width: calc(100% - 48px);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.user-row .message-content {
    background-color: var(--bg-hover);
    padding: 12px 20px;
    border-radius: 24px;
}

.bot-row .message-content {
    padding-top: 4px;
}

.bot-row .message-content p {
    margin-bottom: 12px;
}

/* Input Area */
.input-container-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to top, var(--bg-main) 60%, transparent);
    transition: all 0.5s cubic-bezier(0.2, 0, 0, 1);
}

.input-container-wrapper.centered {
    bottom: 50%;
    transform: translateY(50%);
    background: transparent;
}

.input-box {
    width: 100%;
    max-width: 800px;
    background-color: var(--bg-input);
    border-radius: 32px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    resize: none;
    outline: none;
    padding: 8px 0;
    max-height: 150px;
    min-height: 24px;
}

textarea::placeholder {
    color: var(--text-secondary);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: center;
}

.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 600px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #1e1f20 25%, #333537 50%, #1e1f20 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-line:nth-child(1) { width: 100%; }
.skeleton-line:nth-child(2) { width: 80%; }
.skeleton-line:nth-child(3) { width: 60%; }

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 100;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
}
