/* /workspace/index.css */

/* Mevcut stiller */
@import url('normalize.css');

/* Genel Stiller */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #ebedf0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2d3748;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark {
    background-color: #0d1219;
    color: #e2e8f0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1002;
    background: linear-gradient(135deg, #ffffff, #f0f4f8);
    padding: 12px 20px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

body.dark header {
    background: linear-gradient(135deg, #1a202c, #2d3748);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

body.dark .app-title {
    color: #e2e8f0;
}

/* Başlık Giriş Alanı */
#title-input {
    width: 200px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.875rem;
    background-color: #fff;
    color: #2d3748;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    margin-top: 8px;
}

body.dark #title-input {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4b5563;
}

#title-input:focus {
    outline: none;
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.2);
}

/* Toggle Butonu */
.toggle-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6b46c1, #805ad5);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: absolute;
    top: 80px;
    right: 10px;
    z-index: 1005;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.dark .toggle-btn {
    background: linear-gradient(135deg, #805ad5, #a78bfa);
}

.toggle-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #5a3ca0, #6b46c1);
    box-shadow: 0 0 12px rgba(107, 70, 193, 0.5);
}

body.dark .toggle-btn:hover {
    background: linear-gradient(135deg, #6b46c1, #805ad5);
}

/* Tema Değiştirme Butonu */
.theme-btn {
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

body.dark .theme-btn:hover {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #ffffff, #f0f4f8);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    z-index: 1000;
    display: block;
}

.sidebar.collapsed {
    width: 64px;
    padding: 20px 0;
}

body.dark .sidebar {
    background: linear-gradient(180deg, #1a202c, #2d3748);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.sidebar h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    margin-top: 20px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

body.dark .sidebar h3 {
    color: #e2e8f0;
    border-bottom: 1px solid #4b5563;
}

.sidebar.collapsed h3 {
    display: none;
}

.sidebar .profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px;
    padding-top: 120px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

body.dark .sidebar .profile {
    border-bottom: 1px solid #4b5563;
}

.sidebar.collapsed .profile {
    margin-top: 50px;
    padding-top: 60px;
    padding-bottom: 10px;
}

.sidebar .profile img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    object-fit: cover;
    transition: border-color 0.3s ease, width 0.3s ease, height 0.3s ease;
}

body.dark .sidebar .profile img {
    border-color: #4b5563;
}

.sidebar.collapsed .profile img {
    width: 40px;
    height: 40px;
}

.sidebar .profile p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: #718096;
    transition: color 0.3s ease;
}

body.dark .sidebar .profile p {
    color: #a0aec0;
}

.sidebar.collapsed .profile p {
    display: none;
}

.logout-btn {
    background: linear-gradient(135deg, #f56565, #ef4444);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 12px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark .logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

body.dark .logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #4a5568;
    transition: background 0.2s ease, border-color 0.3s ease;
    cursor: pointer;
}

body.dark .sidebar li {
    border-bottom: 1px solid #4b5563;
    color: #d1d5db;
}

.sidebar li:hover {
    background: #edf2f7;
}

body.dark .sidebar li:hover {
    background: #2d3748;
}

.sidebar li.active {
    background: #6b46c1;
    color: #fff;
}

body.dark .sidebar li.active {
    background: #805ad5;
}

.sidebar.collapsed li {
    justify-content: center;
    padding: 12px 0;
    border-bottom: none;
    text-align: center;
}

.sidebar.collapsed li span {
    display: none;
}

.sidebar.collapsed li:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 64px;
    background: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    z-index: 1001;
}

body.dark .sidebar.collapsed li:hover::after {
    background: #2d3748;
    color: #e2e8f0;
}

.delete-btn {
    background-color: transparent;
    border: none;
    color: #f87171;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

body.dark .delete-btn {
    color: #fca5a5;
}

.delete-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

body.dark .delete-btn:hover {
    color: #f87171;
}

.sidebar.collapsed .delete-btn {
    display: none;
}

.menu-btn {
    background-color: transparent;
    border: none;
    color: #4a5568;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

body.dark .menu-btn {
    color: #d1d5db;
}

.menu-btn:hover {
    color: #6b46c1;
    transform: scale(1.1);
}

body.dark .menu-btn:hover {
    color: #805ad5;
}

.sidebar.collapsed .menu-btn {
    display: none;
}

.context-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10000;
}

body.dark .context-menu {
    background: #2d3748;
    border-color: #4b5563;
    color: #e2e8f0;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.context-menu-item:hover {
    background: #edf2f7;
}

body.dark .context-menu-item:hover {
    background: #4b5563;
}

.create-folder-btn {
    background: linear-gradient(135deg, #6b46c1, #805ad5);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark .create-folder-btn {
    background: linear-gradient(135deg, #805ad5, #a78bfa);
}

.create-folder-btn:hover {
    background: linear-gradient(135deg, #5a3ca0, #6b46c1);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(107, 70, 193, 0.4);
}

body.dark .create-folder-btn:hover {
    background: linear-gradient(135deg, #6b46c1, #805ad5);
}

.folder-list, .history-list {
    list-style: none;
    padding: 0;
}

.folder-item, .conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #4a5568;
    transition: background 0.2s ease, border-color 0.3s ease;
    cursor: pointer;
}

body.dark .folder-item, body.dark .conversation-item {
    border-bottom: 1px solid #4b5563;
    color: #d1d5db;
}

.folder-item:hover, .conversation-item:hover {
    background: #edf2f7;
}

body.dark .folder-item:hover, body.dark .conversation-item:hover {
    background: #2d3748;
}

.folder-item.active, .conversation-item.active {
    background: #6b46c1;
    color: #fff;
}

body.dark .folder-item.active, body.dark .conversation-item.active {
    background: #805ad5;
}

.conversation-item.pinned {
    font-weight: 600;
}

.sidebar.collapsed .folder-item, .sidebar.collapsed .conversation-item {
    justify-content: center;
    padding: 12px 0;
    border-bottom: none;
    text-align: center;
}

.sidebar.collapsed .folder-item span, .sidebar.collapsed .conversation-item span {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
    padding: 20px;
    padding-top: 100px;
    transition: background-color 0.3s ease;
}

.sidebar.open ~ .main-content {
    margin-left: 280px;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 64px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 5px;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding-top: 5px;
    min-height: calc(100vh - 80px);
}

.welcome {
    text-align: center;
    margin: 10px 0;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff, #f0f4f8);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

body.dark .welcome {
    background: linear-gradient(135deg, #1a202c, #2d3748);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.welcome h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

body.dark .welcome h1 {
    color: #e2e8f0;
}

.welcome p {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 24px;
    transition: color 0.3s ease;
}

body.dark .welcome p {
    color: #a0aec0;
}

.login-button a {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.login-button a:hover {
    background: linear-gradient(135deg, #357abd, #2a6395);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.4);
}

.chat-container {
    margin-top: 5px;
    min-height: 200px;
    padding: 24px;
    width: 100%;
    max-width: 800px;
    overflow-y: auto;
    background-color: inherit;
    transition: background-color 0.3s ease;
}

body.dark .chat-container {
    background-color: inherit;
}

.chat-bubble {
    max-width: 70%;
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark .chat-bubble {
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

.user-bubble {
    background: linear-gradient(135deg, #6b46c1, #805ad5);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

body.dark .user-bubble {
    background: linear-gradient(135deg, #805ad5, #a78bfa);
}

.bot-bubble {
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    color: #2d3748;
    border-bottom-left-radius: 2px;
    white-space: pre-wrap;
    overflow-x: auto;
}

body.dark .bot-bubble {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    color: #e2e8f0;
}

.bot-bubble a {
    color: #6b46c1;
    text-decoration: underline;
    transition: color 0.2s ease;
}

body.dark .bot-bubble a {
    color: #a78bfa;
}

.bot-bubble p {
    margin-bottom: 1em;
}

.bot-bubble ul, .bot-bubble ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.bot-bubble li {
    margin-bottom: 0.5em;
}

.bot-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 2px solid #6b46c1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.bot-bubble th, .bot-bubble td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: 0.875rem;
}

.bot-bubble th {
    background-color: #6b46c1;
    color: #fff;
    font-weight: 600;
}

body.dark .bot-bubble th {
    background-color: #805ad5;
}

body.dark .bot-bubble table {
    border-color: #a78bfa;
}

.bot-bubble tr:nth-child(even) {
    background-color: #f9fafb;
}

body.dark .bot-bubble tr:nth-child(even) {
    background-color: #374151;
}

.bot-bubble h1, .bot-bubble h2, .bot-bubble h3, .bot-bubble h4, .bot-bubble h5, .bot-bubble h6 {
    margin: 0.5em 0;
    font-weight: 600;
}

.bot-bubble h1 {
    font-size: 1.5em;
}

.bot-bubble h2 {
    font-size: 1.3em;
}

.bot-bubble h3 {
    font-size: 1.2em;
}

.code-block-wrapper {
    position: relative;
    margin: 1em 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #272822;
    padding: 10px;
}

body.dark .code-block-wrapper {
    border-color: #6b7280;
}

.code-btn {
    position: absolute;
    top: 10px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
}

.copy-btn {
    right: 80px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
}

.download-btn {
    right: 10px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

body.dark .copy-btn {
    background: linear-gradient(135deg, #357abd, #2a6395);
}

body.dark .download-btn {
    background: linear-gradient(135deg, #27ae60, #219653);
}

.copy-btn:hover, .download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

body.dark .copy-btn:hover, body.dark .download-btn:hover {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.toolbar {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    transition: background 0.3s ease;
}

.toolbar button, .toolbar label {
    background: linear-gradient(135deg, #6b46c1, #805ad5);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark .toolbar button, body.dark .toolbar label {
    background: linear-gradient(135deg, #805ad5, #a78bfa);
}

.toolbar button:hover, .toolbar label:hover {
    background: linear-gradient(135deg, #5a3ca0, #6b46c1);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(107, 70, 193, 0.4);
}

body.dark .toolbar button:hover, body.dark .toolbar label:hover {
    background: linear-gradient(135deg, #6b46c1, #805ad5);
}

.toolbar input[type="file"] {
    display: none;
}

.input-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin-top: 12px;
    transition: background-color 0.3s ease;
}

textarea {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    resize: vertical;
    background-color: #fff;
    color: #2d3748;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    min-height: 120px;
}

body.dark textarea {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4b5563;
}

textarea:focus {
    outline: none;
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.2);
}

.send-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #800080, #4B0082);
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark .send-btn {
    background: linear-gradient(135deg, #9370DB, #6A5ACD);
}

.send-btn:hover {
    background: linear-gradient(135deg, #6A5ACD, #483D8B);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(107, 70, 193, 0.5);
}

body.dark .send-btn:hover {
    background: linear-gradient(135deg, #6A5ACD, #483D8B);
}

.send-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #ebedf0, #edf2f7);
    color: #718096;
}