/* style.css - GÜNCELLENMİŞ VERSİYON (Dosya alanı yanında) */

:root {
    --primary: #4285f4;
    --primary-light: #e8f0fe;
    --secondary: #34a853;
    --danger: #ea4335;
    --warning: #fbbc05;
    --light-bg: #f8f9fa;
    --border-color: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Ana Konteyner */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Başlık */
.header {
    text-align: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Ana İçerik */
.content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

@media (max-width: 992px) {
    .content {
        grid-template-columns: 1fr;
    }
}

/* Sol Panel - Sohbet */
.chat-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sağ Panel - Oturumlar */
.sessions-panel {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* Sohbet Alanı */
.chat-area {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mesajlar */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: var(--light-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.message-content {
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* YENİ: Giriş Alanı Düzeni */
.input-container {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Üst Araç Çubuğu */
.input-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-btn {
    padding: 8px 16px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.file-upload-btn:hover {
    background: #f1f3f4;
    border-color: var(--primary);
}

.file-upload-btn i {
    color: var(--primary);
}

/* Ana Giriş Alanı */
.input-main {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.textarea-wrapper {
    flex: 1;
    position: relative;
}

textarea {
    width: 100%;
    padding: 16px;
    padding-right: 60px; /* Buton için boşluk */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s;
    min-height: 100px;
    max-height: 200px;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Enter ile gönder ipucu */
.enter-hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.send-btn {
    padding: 12px 24px;
    height: 100px; /* Textarea yüksekliğiyle uyumlu */
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 16px;
}

.send-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Dosya Bilgisi */
.file-info-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f7ff;
    border: 1px solid #bbdefb;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.file-info-container i {
    color: var(--primary);
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.remove-file {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.remove-file:hover {
    background: rgba(234, 67, 53, 0.1);
}

/* Format Gösterimi */
.formats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    justify-content: flex-start;
}

.format-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.ocr-badge {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Streaming Toggle */
.stream-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f0f9ff;
    border-radius: var(--radius-md);
    border: 1px solid #e0f2fe;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Oturumlar */
.sessions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.session-item {
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
}

.session-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.session-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.session-title {
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.session-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Sistem Bilgisi */
.system-info {
    background: var(--light-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

.system-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat {
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Stream Çıktısı */
.stream-output {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 12px 0;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: none;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    margin: 12px 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Dosya Önizleme */
.file-preview {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
    max-height: 200px;
    overflow-y: auto;
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.file-preview-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Butonlar */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f1f3f4;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d23a2e;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .system-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .input-main {
        flex-direction: column;
        align-items: stretch;
    }
    
    .send-btn {
        height: auto;
        width: 100%;
    }
    
    .enter-hint {
        display: none; /* Mobilde gizle */
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-sm {
    font-size: 14px;
}

.text-xs {
    font-size: 12px;
}

.font-semibold {
    font-weight: 600;
}

.text-success {
    color: var(--secondary);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }