:root {
    --primary-dark: #0a1f1b;
    --primary-medium: #1a3d35;
    --primary-light: #2a5a4f;
    --accent-teal: #3dd8c4;
    --accent-light: #5ee9d6;
    --text-primary: #f0f6f3;
    --text-secondary: #c8e4de;
    --text-muted: #8aaa9f;
    --background-dark: #051613;
    --background-card: #0f2823;
    --background-hover: #1a3d35;
    --border-color: #1f4a42;
    --success: #4ecca3;
    --warning: #f39c12;
    --danger: #e74c3c;
    --code-bg: #0a1f1b;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a {
    color: #fff;
    text-decoration: none;
}
/* Chat page specific styles */
body.chat-page {
    overflow: hidden;
    height: 100vh;
	font-size: 13px !important;
}

body.chat-page .main-layout {
    height: calc(100vh - 64px);
}

/* Global text readability improvements */
p, li, td, th, label, small {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary) !important;
}

.form-control, .form-select {
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--background-dark);
    border-color: var(--accent-teal);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(61, 216, 196, 0.25);
}

.card {
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline-light {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline-light:hover {
    background-color: var(--primary-medium);
    border-color: var(--accent-teal);
    color: var(--text-primary);
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Transparent header for landing page */
.landing-hero + .main-header,
body:has(.landing-hero) .main-header {
    background: transparent;
    position: absolute;
    width: 100%;
    box-shadow: none;
}

/* Mobile navbar background for landing */
@media (max-width: 768px) {
    .navbar-collapse {
        background-color: var(--background-card);
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 0.5rem;
        border: 1px solid var(--border-color);
    }
}

.main-header .navbar-brand {
    color: var(--accent-teal) !important;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-header .navbar-brand img{
    width: 80px;
	height: auto;
}

.main-header .navbar-brand:hover {
    color: var(--accent-light) !important;
}

.main-header .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
}

.main-header .nav-link:hover {
    background-color: var(--background-hover);
    color: var(--accent-teal) !important;
}

/* Dropdown menu dark theme */
.dropdown-menu {
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--background-hover);
    color: var(--accent-teal);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Mobile navbar toggle */
.navbar-toggler {
    border-color: var(--border-color);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Chat Container */
.chat-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 120px);
    overflow: hidden;
}

/* Chat Sidebar */
.chat-sidebar,
.sidebar {
    width: 260px;
    background-color: var(--background-card);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    overflow-y: auto;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Desktop'ta sidebar her zaman görünür */
@media (min-width: 992px) {
    .sidebar {
        position: relative;
        left: 0;
    }
}

/* Mobilde sidebar gizli, active olunca görünür */
@media (max-width: 991px) {
    body.chat-page .sidebar {
        position: fixed;
        left: -280px;
        top: 70px;
        height: calc(100vh - 70px);
        z-index: 1200;
        width: 280px;
        transition: left 0.3s ease;
        background-color: var(--background-card);
        box-shadow: 2px 0 10px var(--shadow);
    }
    body.chat-page .sidebar.active {
        left: 0;
    }
    body.chat-page .main-area {
        margin-left: 0 !important;
    }
}

/* Sidebar content flex layout */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    min-height: 325px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: var(--background-dark);
    border-radius: 3px;
}

.chat-list::-webkit-scrollbar-thumb {
    background: var(--primary-medium);
    border-radius: 3px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Mobile sidebar menu */
.sidebar-menu {
    margin-top: auto;
    padding: 0.5rem 0;
}

.sidebar-menu .nav-link {
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    margin: 0.25rem 0;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.sidebar-menu .nav-link:hover {
    background-color: var(--background-hover);
    color: var(--accent-teal) !important;
}

.sidebar-menu .nav-link.active {
    background-color: var(--primary-medium);
    color: var(--accent-light) !important;
    border-left: 3px solid var(--accent-teal);
    padding-left: calc(1rem - 3px);
}

/* Mobile touch states */
@media (max-width: 991px) {
    .sidebar-menu .nav-link:active {
        background-color: var(--primary-medium);
        color: var(--accent-light) !important;
        transform: scale(0.98);
    }

    .sidebar-menu .nav-link::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(61, 216, 196, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
    }

    .sidebar-menu .nav-link:active::after {
        width: 100px;
        height: 100px;
    }

    .sidebar-menu .dropdown-toggle:active {
        background-color: var(--primary-medium);
    }

    .sidebar-menu .dropdown-item:active {
        background-color: var(--primary-medium);
        color: var(--accent-light) !important;
    }
}

.sidebar-menu .dropdown-menu {
    position: static !important;
    transform: none !important;
    margin-top: 0.5rem;
    margin-left: 2rem;
    width: auto;
    background-color: var(--background-card);
}

table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    min-width: 270px;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    font-weight: bold;
}

h1{
    font-size: 1.75rem;
}
h2{
    font-size: 1.50rem;
}
h3{
    font-size: 1.25rem;
}
h4{
    font-size: 1rem;
}
h5{
    font-size: 0.75rem;
}


#sidebarToggle:hover,
.sidebar-toggle:hover {
    background-color: var(--accent-teal);
    border-color: var(--accent-teal);
    color: var(--primary-dark);
}

.new-chat-btn {
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 10;
}

.new-chat-btn:hover {
    background-color: var(--background-hover);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.login-save-btn {
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-light) 100%) !important;
    border: none !important;
    transition: all 0.3s ease;
    color: var(--text-primary) !important;
}

.login-save-btn:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-teal) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    color: var(--text-primary) !important;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--background-card);
    border: 1px solid transparent;
    position: relative;
}

.chat-item:hover {
    background-color: var(--background-hover);
    border-color: var(--border-color);
}

.chat-item.active {
    background-color: var(--primary-medium);
    border-color: var(--accent-teal);
}

.chat-item i {
    color: var(--accent-teal);
    margin-right: 0.75rem;
}

.chat-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.delete-chat {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.chat-item:hover .delete-chat {
    opacity: 1;
}

.delete-chat:hover {
    color: var(--danger);
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--background-dark);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

.welcome-message {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-message h2 {
    color: var(--accent-teal);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.quick-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.quick-prompt {
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: var(--text-primary);
}

.quick-prompt:hover {
    background-color: var(--background-hover);
    border-color: var(--accent-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.quick-prompt i {
    color: var(--accent-teal);
    font-size: 1.25rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Chat Messages - Redesigned for better appearance */
.message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: messageSlideIn 0.3s ease-out;
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
    padding-left: 15%;
}

.message.assistant {
    padding-right: 15%;
}

/* Message Avatars */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    background: var(--primary-light);
}

.message.user .message-avatar {
    background: var(--accent-teal);
    color: var(--primary-dark);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary-medium), var(--primary-light));
    color: var(--text-primary);
}

.message-avatar i {
    color: inherit;
    font-size: 1.1rem;
}

/* Message Content Bubbles */
.message-content {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    position: relative;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    font-size: 0.95rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    overflow: hidden;
}

.message.user .message-content {
    background: var(--primary-medium);
    color: var(--text-primary);
    border-bottom-right-radius: 0.4rem;
    margin-left: auto;
    border: 1px solid var(--accent-teal);
}

.message.assistant .message-content {
    background: var(--background-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.4rem;
}

/* Hover effects */
.message:hover .message-content {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Message tail effect */
.message-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.message.user .message-content::before {
    right: -7px;
    border-left-color: var(--primary-medium);
    border-bottom-color: var(--primary-medium);
}

.message.assistant .message-content::before {
    left: -7px;
    border-right-color: var(--background-card);
    border-bottom-color: var(--background-card);
}

/* Message content styling */
.message-content p {
    margin: 0 0 0.75rem 0;
    line-height: 1.7;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Code blocks in messages - Fixed overflow */
.message-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 0.875rem;
    max-width: 100%;
    white-space: pre;
}

.message.user .message-content pre {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Consolas', monospace;
    word-break: break-all;
    max-width: 100%;
    display: inline-block;
    vertical-align: baseline;
}

.message.user .message-content code {
    background: rgba(255, 255, 255, 0.1);
}

/* Fix pre code blocks */
.message-content pre code {
    background: none;
    padding: 0;
    word-break: normal;
    white-space: pre;
    overflow-wrap: normal;
}

/* Ensure code blocks have proper scrolling */
.message-content pre::-webkit-scrollbar {
    height: 8px;
}

.message-content pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.message-content pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.message-content pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tables in messages - Fixed overflow */
.message-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    max-width: 100%;
}

.message-content th,
.message-content td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.message-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* Math expressions - Fixed overflow */
.message-content .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    margin: 0.5rem 0;
}

.message-content .katex {
    font-size: 1.1em;
}

/* Fix inline math */
.message-content p .katex {
    font-size: 1em;
}

/* Lists in messages */
.message-content ul,
.message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    max-width: 100%;
}

.message-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    word-wrap: break-word;
    word-break: break-word;
}

/* Long text and URLs */
.message-content p,
.message-content div {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Message files */
.message-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.message-file {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message.user .message-file {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.message.assistant .message-file {
    background: rgba(26, 214, 193, 0.1);
    border-color: var(--accent-teal);
    color: var(--text-primary);
}

.message-file:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    background: rgba(26, 214, 193, 0.2);
}

.message.user .message-file:hover {
    background: rgba(0, 0, 0, 0.2);
}

.message.assistant .message-file:hover {
    background: rgba(26, 214, 193, 0.2);
}

/* Message images */
.message-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Message timestamp */
.message-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .message-timestamp {
    opacity: 1;
}

/* Message actions */
.message-actions {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    top: -0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.message.user .message-actions {
    right: 0;
}

.message.assistant .message-actions {
    left: 3rem;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-actions button {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.message-actions button:hover {
    background: var(--background-hover);
    color: var(--accent-teal);
    border-color: var(--accent-teal);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .message.user {
        padding-left: 5%;
    }

    .message.assistant {
        padding-right: 5%;
    }

    .message-content {
        max-width: 90%;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    .message-avatar i {
        font-size: 0.9rem;
    }

    .message-content::before {
        border-width: 6px;
    }

    .message.user .message-content::before {
        right: -5px;
    }

    .message.assistant .message-content::before {
        left: -5px;
    }

    .messages-container {
        padding: 1rem;
        padding-bottom: 100px;
    }

    /* Hide message actions on mobile */
    .message-actions {
        display: none;
    }
}

@media (max-width: 480px) {
    .message {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .message-content {
        max-width: 95%;
        padding: 0.75rem 0.875rem;
        border-radius: 1rem;
    }

    .message.user {
        padding-left: 0;
    }

    .message.assistant {
        padding-right: 0;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .message.assistant .message-content {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .message-content code {
        background: rgba(0, 0, 0, 0.4);
    }
}

/* Chat Input */
.chat-input-container {
    background-color: var(--background-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .chat-input-container {
        padding: 1rem 2rem;
    }
}

@media (min-width: 992px) {
    .sidebar.active + .main-area .chat-input-container,
    body.chat-page .sidebar + .main-area .chat-input-container {
        left: 280px;
    }
}

/* Fix chat page layout */
body.chat-page .main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

body.chat-page .main-layout {
    margin-top: 70px;
}

/* Fix sidebar on desktop */
@media (min-width: 992px) {
    body.chat-page .sidebar {
        position: fixed;
        left: 0;
        top: 70px;
        bottom: 0;
        width: 280px;
        transform: translateX(0);
    }

    body.chat-page .main-area {
        margin-left: 280px;
    }
}

.chat-settings {
    padding: 0.5rem;
    background-color: var(--background-dark);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.chat-settings .form-check-input:checked {
    background-color: var(--accent-teal);
    border-color: var(--accent-teal);
}

.chat-settings .form-check-label {
    color: var(--text-primary);
    cursor: pointer;
}

.file-preview {
    width: 100%;
    max-width: 800px;
    padding: 10px;
    background: var(--background-card);
    border-radius: 5px;
    max-height: 120px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .file-preview {
        max-width: 100%;
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .chat-input-container {
        max-height: 50vh;
        overflow-y: auto;
    }
}

.file-preview-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--background-dark);
    margin-bottom: 5px;
    border-radius: 3px;
    position: relative;
    border: 1px solid var(--border-color);
    gap: 8px;
}

.file-preview-item:hover {
    background: var(--background-hover);
    border-color: var(--accent-teal);
}

.file-preview-item .file-name {
    flex: 1;
    margin: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.file-preview-item .file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 10px;
}

.file-preview-item .remove-file {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.file-preview-item .remove-file:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.file-preview-item > i {
    color: var(--accent-teal);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.file-preview-item .fa-file-word {
    color: #2b579a;
}

.file-preview-item .fa-file-excel {
    color: #217346;
}

.file-preview-item .fa-file-powerpoint {
    color: #d24726;
}

.file-preview-item .fa-file-pdf {
    color: #d32f2f;
}

.file-preview-item .fa-image {
    color: #4caf50;
}

.file-preview-item .fa-file-audio,
.file-preview-item .fa-music {
    color: #ff9800;
}

.file-preview-item .fa-file-code {
    color: #9c27b0;
}

.file-preview-item .fa-file-alt {
    color: #607d8b;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-preview-item img,
.file-preview-thumb {
    height: 40px;
    width: 40px;
    border-radius: 0.25rem;
    object-fit: cover;
    border: 1px solid var(--border-color);
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.file-preview-item .remove-file {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.file-preview-item .remove-file:hover {
    color: var(--danger);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem;
    transition: border-color 0.3s ease;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-teal);
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    resize: none;
    outline: none;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 120px;
    padding: 0.5rem;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.attach-btn,
.voice-btn,
.send-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.attach-btn:hover,
.voice-btn:hover {
    background-color: var(--background-hover);
    color: var(--accent-teal);
}

.send-btn {
    background-color: var(--accent-teal);
    color: var(--primary-dark);
}

.send-btn:hover {
    background-color: var(--accent-light);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-btn.recording {
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Footer */
.main-footer {
    background-color: var(--background-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
}

.main-footer a {
    color: var(--accent-teal);
    text-decoration: none;
}

.main-footer a:hover {
    color: var(--accent-light);
}

/* Loading Animation */
.typing-indicator {
    display: inline-flex;
    gap: 0.375rem;
    padding: 1rem 1.25rem;
    width: fit-content;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-teal);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--background-card);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100vw;
        z-index: 1100;
        border-radius: 0 0 1rem 1rem;
        box-shadow: 0 8px 24px var(--shadow);
        padding: 1.5rem 1rem 1rem 1rem;
        min-width: 220px;
    }

    .navbar-nav {
        flex-direction: column !important;
        gap: 0.5rem;
        width: 100%;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        color: var(--text-primary) !important;
        background: none;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
    }

    .navbar-nav .nav-link:hover {
        background: var(--background-hover);
        color: var(--accent-teal) !important;
    }

    .navbar-toggler {
        z-index: 1050;
        margin-left: auto;
    }

    .navbar-brand {
        font-size: 1.5rem;
        margin-left: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .sidebar-toggle {
        margin-left: 0.5rem;
    }

    /* Mobilde logo ortalanmış */
    .main-header .navbar-brand {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        position: absolute;
        left: 50%;
        top: 40%;
        transform: translate(-50%, -15%);
        margin: 0 auto;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        text-align: center;
        padding: 0;
        line-height: 1.1;
    }

    /* Chat page'de üst menü butonlarını gizle */
    body.chat-page .navbar-toggler {
        display: none !important;
    }

  .main-header .navbar-brand img {
	width: 140px;
	height: auto;
    border-radius: 40% 40% 20px 20px;
    background-color: #00221c; /* logonun arkasına uyum için */
    padding: 4px;
    z-index: 1;
  }

    /* Mobilde sidebar ve menü çakışmasını önle */
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 1200;
        width: 260px;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .main-area {
        margin-left: 0 !important;
    }

    /* Mobilde delete icon her zaman görünür */
    .delete-chat {
        opacity: 1 !important;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--background-card);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 2000;
    border: 1px solid var(--border-color);
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.success {
    border-color: var(--success);
}

.toast-notification.success i {
    color: var(--success);
}

.toast-notification.error {
    border-color: var(--danger);
}

.toast-notification.error i {
    color: var(--danger);
}

.toast-notification.info {
    border-color: var(--accent-teal);
}

.toast-notification.info i {
    color: var(--accent-teal);
}

.toast-notification.warning {
    border-color: var(--warning);
}

.toast-notification.warning i {
    color: var(--warning);
}

/* Message files */
.message-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.message-file {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-file:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

.message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* Sidebar toggle button (chat page) */
#sidebarToggle,
.sidebar-toggle {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1020;
    flex-shrink: 0;
}
#sidebarToggle:hover {
    background: var(--background-hover);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

/* Always show delete icon on mobile */
@media (max-width: 991px) {
    .delete-chat {
        opacity: 1 !important;
    }
}

/* PDF Modal Styles */

#pdfModal .modal-content {
    height: calc(100vh - 2rem);
}

#pdfModal .modal-body {
    overflow: hidden;
}

.pdfobject-container {
    width: 100%;
}

/* Dark theme for PDF modal */
#pdfModal .modal-header,
#pdfModal .modal-footer {
    background-color: var(--background-dark);
    border-color: var(--border-color);
}

#pdfModal .btn-close-white {
    filter: invert(1);
}

/* Content pages (Privacy, Terms) */
.content h2 {
    color: var(--accent-light);
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content h3 {
    color: var(--accent-teal);
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content ul {
    margin-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Messages container responsive width */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: 120px;
    background: var(--background-dark);
}

@media (min-width: 1400px) {
    .messages-container {
        padding: 3rem;
    }
}
