/* Reset ve temel stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Ana (Koyu) Renk Paleti */
    --bg-primary: #222831;
    --bg-secondary: #393E46;
    --bg-tertiary: #393E46;
    --bg-sidebar: #222831;
    --text-primary: #DFD0B8;
    --text-secondary: #948979;
    --text-muted: #948979;
    --accent: #948979;
    --accent-hover: #7d7468;
    --border: #393E46;
    --danger: #e53e3e;
    --danger-hover: #c53030;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Açık Tema Renkleri */
body.light-mode {
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F3F5;
    --bg-sidebar: #FFFFFF;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6C757D;
    --accent: #007BFF;
    --accent-hover: #0056b3;
    --border: #DEE2E6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

.app-container {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    transition: margin-left 0.3s ease, background 0.3s, border-color 0.3s;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}

/* ... Diğer sidebar stilleri aynı kalacak ... */
.sidebar-header { margin-bottom: 1rem; }
.new-chat-btn { width: 100%; padding: 0.75rem; border-radius: var(--radius-md); background: transparent; border: 1px solid var(--border); color: var(--text-primary); cursor: pointer; display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; font-weight: 500; text-align: left; transition: all 0.2s ease; }
.new-chat-btn:hover { background: var(--bg-tertiary); }
.sidebar-content { flex: 1; overflow-y: auto; }
.history-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); padding: 0 0.5rem 0.5rem; text-transform: uppercase; }
.chat-history-list { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.history-item-container { display: flex; align-items: center; border-radius: var(--radius-md); transition: background 0.2s ease; }
.history-item-container:hover { background: var(--bg-tertiary); }
.history-item-container:hover .delete-chat-btn { opacity: 1; }
.history-item.active, .history-item-container .history-item.active { background: var(--bg-secondary); }
body.light-mode .history-item.active, body.light-mode .history-item-container .history-item.active { background: var(--bg-tertiary); }
.history-item { flex: 1; padding: 0.75rem; color: var(--text-secondary); font-size: 0.9rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--radius-md); }
.history-item.active { color: var(--text-primary); font-weight: 500; }
.delete-chat-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.5rem; margin-right: 0.25rem; border-radius: var(--radius-md); opacity: 0; transition: opacity 0.2s, color 0.2s; }
.delete-chat-btn:hover { color: var(--danger); }
.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border); }
.settings-btn { width: 100%; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: var(--radius-md); font-size: 0.9rem; transition: all 0.2s ease; }
.settings-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }


/* Main Content */
.main {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    transition: background 0.3s;
}

/* ---- KAYDIRMA SORUNU İÇİN DÜZELTME ---- */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    /* Bu iki satır eklendi/güncellendi */
    height: 100%;
    overflow: hidden;
}

.chat-messages {
    /* Bu satır güncellendi */
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    background: var(--bg-primary);
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.chat-messages > * {
    position: relative;
    z-index: 1;
}
/* ---- DÜZELTME SONU ---- */

.welcome-container {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 15vh;
}
/* ... Diğer tüm stiller aynı kalacak ... */
.welcome-logo { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--bg-primary); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 600; margin-bottom: 1.5rem; }
body.light-mode .welcome-logo { color: var(--bg-secondary); }
.welcome-title { font-size: 1.75rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2.5rem; }
.suggestion-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; max-width: 700px; }
.chip { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; color: var(--text-secondary); font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; text-align: left; }
.chip:hover { background: var(--bg-tertiary); border-color: #666; color: var(--text-primary); }
body.light-mode .chip:hover { border-color: #adb5bd; }
.message { 
    display: flex; 
    gap: 1rem; 
    margin-bottom: 1.5rem; 
    animation: slideIn 0.3s ease-out; 
    max-width: 95%; 
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.message:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

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

.message-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1rem; 
    flex-shrink: 0; 
    font-weight: 600; 
    color: var(--text-primary); 
    background: var(--accent); 
    border: 2px solid var(--accent-hover);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-message .message-avatar {
    background: var(--accent);
    color: white;
}

.bot-message .message-avatar {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

.message-content { 
    padding-top: 0.2rem; 
    font-size: 1rem; 
    flex: 1;
}

.message-sender { 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-message .message-sender { 
    color: var(--accent); 
}

.bot-message .message-sender { 
    color: var(--text-secondary); 
}

.message-text { 
    word-wrap: break-word; 
    white-space: pre-wrap; 
    line-height: 1.6;
    font-size: 1rem;
    color: var(--text-primary);
}
.message-text pre { 
    background: var(--bg-primary); 
    padding: 1rem; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-md); 
    overflow-x: auto; 
    margin: 0.5rem 0; 
    font-size: 0.9rem; 
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.light-mode .message-text pre { 
    background: #e9ecef; 
    color: var(--text-primary); 
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Mesaj balonları için ekstra kontrast */
.user-message {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--accent);
}

.bot-message {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-color: var(--border);
}

body.light-mode .user-message {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #f8f9fa 100%);
    border-color: var(--accent);
}

body.light-mode .bot-message {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #ffffff 100%);
    border-color: var(--border);
}
.message-text code { font-family: 'Courier New', Courier, monospace; }
.chat-input-container { padding: 1rem 1rem 1.5rem; width: 100%; flex-shrink: 0; }
.input-wrapper { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.5rem 0.5rem 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; transition: all 0.2s ease; }
.input-wrapper:focus-within { border-color: var(--accent); }
#messageInput { flex: 1; border: none; outline: none; background: transparent; color: var(--text-primary); font-size: 1rem; line-height: 1.5; resize: none; max-height: 200px; font-family: inherit; padding: 0.5rem 0; }
#messageInput::placeholder { color: var(--text-muted); }
.send-button { width: 36px; height: 36px; border: none; border-radius: var(--radius-md); background: var(--accent); color: var(--bg-secondary); cursor: pointer; display: flex !important; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; opacity: 1 !important; visibility: visible !important; }
.send-button:hover:not(:disabled) { background: var(--accent-hover); }
.send-button:disabled { background: var(--bg-tertiary); cursor: not-allowed; }
.footer-text { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 0.75rem; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 1.5rem; width: 90%; max-width: 450px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: scale(0.95); transition: transform 0.3s ease; }
.modal-overlay.visible .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.25rem; }
.close-modal-btn { background: none; border: none; font-size: 2rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal-content p { margin-bottom: 1.5rem; color: var(--text-secondary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; }
.btn { padding: 0.6rem 1.2rem; border: none; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { filter: brightness(1.1); }
body.light-mode .btn-secondary:hover { filter: brightness(0.95); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
.setting-item + .setting-item { border-top: 1px solid var(--border); }
.setting-item label { font-weight: 500; color: var(--text-secondary); }
.danger-btn { background: var(--danger); color: white; border: none; padding: 0.6rem 1rem; border-radius: var(--radius-md); cursor: pointer; font-weight: 500; transition: background 0.2s ease; }
.danger-btn:hover { background: var(--danger-hover); }
.theme-switcher { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-tertiary); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
body.light-mode .slider:before { background-color: var(--text-secondary); }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-sidebar); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
/* ===== KOD EDİTÖRÜ PANELİ ===== */
.code-editor-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
}

.code-editor-panel.visible {
    right: 0;
    opacity: 1;
    visibility: visible;
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.code-editor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.code-editor-actions {
    display: flex;
    gap: 0.5rem;
}

.code-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.code-action-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.code-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.code-editor-tabs {
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.code-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.code-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.code-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg-secondary);
}

.code-editor-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.code-editor-body pre {
    margin: 0;
    padding: 1rem;
    height: 100%;
    overflow: auto;
    background: var(--bg-primary);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-editor-body code {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    resize: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Kod syntax highlighting */
.code-editor-body code[data-lang="javascript"] {
    color: #f8f8f2;
}

.code-editor-body code[data-lang="python"] {
    color: #3776ab;
}

.code-editor-body code[data-lang="csharp"] {
    color: #239120;
}

.code-editor-body code[data-lang="html"] {
    color: #e34c26;
}

.code-editor-body code[data-lang="css"] {
    color: #1572b6;
}

/* Kod editörü overlay */
.code-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.code-editor-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE TASARIM ===== */

/* Mobil Hamburger Menü */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.visible {
    display: block;
}

/* Responsive Breakpoints */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .chat-area {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .suggestion-chips {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .chip {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* Mobil (480px - 768px) */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 1000;
        width: 260px;
        transition: left 0.3s ease;
    }
    
    .sidebar.visible {
        left: 0;
    }
    
    .main {
        margin-left: 0;
        width: 100%;
    }
    
    .chat-area {
        padding: 0 0.5rem;
        height: 100vh;
        overflow: hidden;
    }
    
    .chat-messages {
        padding: 1rem 0.5rem;
        height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .welcome-container {
        padding-bottom: 10vh;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .suggestion-chips {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .chip {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .message {
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 0.75rem;
        max-width: 100%;
        word-wrap: break-word;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .message-content {
        font-size: 0.95rem;
        min-width: 0;
        flex: 1;
    }
    
    .message-sender {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .message-text {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .chat-input-container {
        padding: 0.75rem 0.5rem 1rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border);
        z-index: 100;
    }
    
    .input-wrapper {
        padding: 0.5rem 0.5rem 0.5rem 0.75rem;
        max-width: 100%;
    }
    
    #messageInput {
        font-size: 0.95rem;
        max-height: 120px;
    }
    
    .send-button {
        width: 32px;
        height: 32px;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .modal {
        width: 95%;
        margin: 1rem;
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .setting-item {
        padding: 0.75rem 0;
    }
    
    .theme-switcher {
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
    }
    
    .theme-switcher span {
        font-size: 0.8rem;
    }
}

/* Kod editörü mobil responsive */
@media (max-width: 768px) {
    .code-editor-panel {
        width: 100%;
        right: -100%;
    }
    
    .code-editor-tabs {
        flex-wrap: wrap;
    }
    
    .code-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Küçük Mobil (320px - 480px) */
@media (max-width: 480px) {
    .mobile-menu-btn {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.4rem;
    }
    
    .mobile-menu-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .chat-area {
        padding: 0 0.25rem;
        height: 100vh;
    }
    
    .chat-messages {
        padding: 0.75rem 0.25rem;
        height: calc(100vh - 100px);
    }
    
    .welcome-container {
        padding-bottom: 5vh;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .welcome-logo {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .welcome-title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
        line-height: 1.3;
    }
    
    .suggestion-chips {
        gap: 0.5rem;
        padding: 0 0.5rem;
        width: 100%;
    }
    
    .chip {
        padding: 0.75rem;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .message {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        padding: 0.6rem;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .message-content {
        font-size: 0.9rem;
    }
    
    .message-sender {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
    
    .message-text pre {
        padding: 0.75rem;
        font-size: 0.8rem;
        margin: 0.25rem 0;
    }
    
    .chat-input-container {
        padding: 0.5rem 0.25rem 0.75rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border);
        z-index: 100;
    }
    
    .input-wrapper {
        padding: 0.4rem 0.4rem 0.4rem 0.6rem;
        max-width: 100%;
    }
    
    #messageInput {
        font-size: 0.9rem;
        padding: 0.4rem 0;
        max-height: 100px;
    }
    
    .send-button {
        width: 28px;
        height: 28px;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .send-button svg {
        width: 16px;
        height: 16px;
    }
    
    .footer-text {
        font-size: 0.7rem;
        margin-top: 0.5rem;
    }
    
    .modal {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    
    .modal-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 1rem;
    }
    
    .close-modal-btn {
        font-size: 1.5rem;
    }
    
    .modal-content p {
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
    
    .modal-actions {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .setting-item {
        padding: 0.5rem 0;
    }
    
    .setting-item label {
        font-size: 0.9rem;
    }
    
    .danger-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .toggle-switch {
        width: 40px;
        height: 22px;
    }
    
    .slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(18px);
    }
}

/* Landscape Orientation (Yatay) */
@media (max-height: 500px) and (orientation: landscape) {
    .welcome-container {
        padding-bottom: 5vh;
    }
    
    .welcome-logo {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .welcome-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .suggestion-chips {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .chip {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .chat-input-container {
        padding: 0.5rem 0.5rem 0.75rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .chip:hover {
        background: var(--bg-secondary);
        border-color: var(--border);
        color: var(--text-secondary);
    }
    
    .new-chat-btn:hover {
        background: transparent;
    }
    
    .settings-btn:hover {
        background: transparent;
        color: var(--text-secondary);
    }
    
    .send-button:hover:not(:disabled) {
        background: var(--accent);
    }
    
    .btn-secondary:hover {
        filter: none;
    }
    
    .btn-danger:hover {
        background: var(--danger);
    }
    
    .danger-btn:hover {
        background: var(--danger);
    }
}