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

:root {
    --bg: #fff;
    --bg-soft: #f8f9fa;
    --bg-muted: #f1f3f4;
    --text: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --border: #dadce0;
    --accent: #1a1a1a;
    --accent-hover: #000;
    --accent-soft: #f1f3f4;
    --link: #1a0dab;
    --link-visited: #681da8;
    --shadow-sm: 0 1px 2px rgba(60,64,67,.15);
    --shadow: 0 1px 6px rgba(32,33,36,.18);
    --radius: 24px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --font: 'Segoe UI', Roboto, Arial, sans-serif;
    --mark-bg: #fef7c3;
    --header-h: 56px;
    --results-pad: 16px;
}

[data-theme="dark"] {
    --bg: #121212;
    --bg-soft: #1a1a1a;
    --bg-muted: #242424;
    --text: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #80868b;
    --border: #3c4043;
    --accent: #e8eaed;
    --accent-hover: #fff;
    --accent-soft: #2d2d2d;
    --link: #8ab4f8;
    --link-visited: #c58af9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 2px 8px rgba(0,0,0,.5);
    --mark-bg: #4a4420;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

/* Logo */
.logo, .hero-logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-img { height: 28px; width: auto; }
.logo-img-lg, .hero-logo .logo-img { height: 44px; }
.logo-text { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.3px; }
.logo-text-lg { font-size: 0; width: 0; overflow: hidden; } /* hero: sadece görsel */

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid transparent; }
.header.has-results { border-bottom-color: var(--border); }
.header:not(.has-results) .header-search,
.header:not(.has-results) .search-tabs,
.header:not(.has-results) .header-region { display: none !important; }
.header-inner { display: flex; align-items: center; gap: 12px; padding: 8px 16px; max-width: 1100px; margin: 0 auto; }
.header-search { flex: 1; min-width: 0; max-width: 584px; }
.header-region { flex-shrink: 0; }
.header-nav { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.nav-link { padding: 6px 10px; font-size: 13px; color: var(--text-secondary); border-radius: var(--radius-sm); white-space: nowrap; }
.nav-link:hover { background: var(--accent-soft); color: var(--text); }
.nav-dropdown { position: relative; }
.nav-dropdown-btn { background: none; border: none; }
.nav-dropdown-panel {
    position: absolute; right: 0; top: calc(100% + 4px); min-width: 140px;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow); padding: 4px; z-index: 60;
}
.nav-dropdown-panel[hidden] { display: none; }
.nav-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left; padding: 8px 12px; font-size: 13px;
    color: var(--text); border-radius: var(--radius-sm); background: none; border: none;
    cursor: pointer; text-decoration: none;
}
.nav-dropdown-item:hover { background: var(--accent-soft); }
/* ── Tema Toggle (tüm sayfalar) ── */
.theme-toggle {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text); font-size: 14px; line-height: 1;
}
.theme-toggle:hover { background: var(--accent-soft); }

.search-tabs {
    display: flex; gap: 0; padding: 0 16px;
    max-width: none; margin: 0; border-bottom: 1px solid var(--border);
}
.header.has-results .header-inner { padding-left: 16px; max-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13px; color: var(--text-secondary); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* Search box */
.search-box-wrapper { position: relative; width: 100%; }
.search-box {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px; height: 44px;
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); background: var(--bg);
    transition: box-shadow .15s;
}
.search-box:hover { box-shadow: var(--shadow); }
.search-box:focus-within { box-shadow: var(--shadow); border-color: transparent; }
.search-icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-input { flex: 1; border: 0; outline: 0; font-size: 15px; min-width: 0; background: transparent; color: var(--text); }

/* AI butonu search-box içinde */
.search-ai-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    background: var(--bg-muted); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 12px; font-weight: 500;
    white-space: nowrap; flex-shrink: 0; text-decoration: none;
    transition: background .12s, color .12s;
}
.search-ai-btn:hover { background: var(--accent-soft); color: var(--text); }

.search-clear { display: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--text-secondary); align-items: center; justify-content: center; }
.search-clear.visible { display: flex; }

.suggestions {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--bg); border-radius: var(--radius-md); box-shadow: var(--shadow);
    border: 1px solid var(--border); z-index: 40; display: none; overflow: hidden;
}
.suggestions.visible { display: block; }
.suggestion-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.suggestion-item:hover { background: var(--accent-soft); }

/* Hero */
.main { min-height: auto; }
.hero {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 16px 32px; text-align: center;
    min-height: calc(100vh - 300px); justify-content: center;
}
.hero.hidden { display: none; }
.hero-logo { margin-bottom: 4px; }
.hero-search { width: 100%; max-width: 600px; margin-top: 16px; }

/* Hero title & subtitle */
.hero-title {
    font-size: 42px; font-weight: 700; letter-spacing: -1.5px;
    color: var(--text); margin: 4px 0 0; line-height: 1.1;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .hero-title {
    background: linear-gradient(135deg, #fff 0%, #9aa0a6 100%);
    -webkit-background-clip: text; background-clip: text;
}
.hero-subtitle {
    font-size: 14px; color: var(--text-muted); margin: 6px 0 0; letter-spacing: .2px;
}

/* Hero search box — biraz daha büyük */
.hero-search-box {
    height: 52px; border-radius: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.hero-search-box:focus-within {
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
}

/* Region select altında */
.hero-region {
    margin-top: 14px;
}

/* Hero meta — stat + AI pill yan yana */
.hero-meta {
    display: flex; align-items: center; gap: 10px;
    margin-top: 20px; flex-wrap: wrap; justify-content: center;
}
.hero-meta-sep { color: var(--border); font-size: 16px; }

/* Hero stat */
.hero-stat-item {
    display: flex; align-items: baseline; gap: 5px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 20px; padding: 5px 14px;
}
.hero-stat-num  { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.hero-stat-label{ font-size: 12px; color: var(--text-muted); }

/* Hero AI pill — gradient, belirgin */
.hero-ai-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; text-decoration: none; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
    transition: box-shadow .15s, transform .1s;
}
.hero-ai-pill:hover { box-shadow: 0 4px 16px rgba(99,102,241,.5); transform: translateY(-1px); }
[data-theme="dark"] .hero-ai-pill {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* Header AI pill button */
.ai-pill-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; text-decoration: none; white-space: nowrap;
    transition: opacity .15s;
}
.ai-pill-btn:hover { opacity: .88; }

/* Dropdown divider */
.nav-dropdown-divider {
    height: 1px; background: var(--border); margin: 4px 0;
}
.nav-dropdown-item {
    display: flex; align-items: center; gap: 8px;
}

.hero-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 12px 16px; margin-top: 14px; width: 100%; max-width: 584px;
}
.region-inline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.region-filter { display: none; }
.region-select {
    padding: 6px 28px 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2380868b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none; cursor: pointer; color: var(--text);
}
.region-select-sm { padding: 5px 24px 5px 8px; font-size: 12px; }

.search-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.btn {
    padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: var(--bg-soft); color: var(--text);
    display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { background: var(--bg-muted); border-color: var(--border); }
.btn-primary, .btn-accent { background: var(--accent-soft); border-color: var(--border); color: var(--text); }
.btn-primary:hover, .btn-accent:hover { background: var(--bg-muted); }
.btn-outline { background: var(--bg); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* AI Sohbet butonu */
.btn-ai {
    background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-muted) 100%);
    border-color: var(--border); color: var(--text);
    font-weight: 500;
}
.btn-ai:hover { background: linear-gradient(135deg, var(--bg-muted) 0%, var(--accent-soft) 100%); border-color: var(--border); }

/* tagline artık hero-subtitle ile değiştirildi — geriye dönük uyumluluk */
.tagline { display: none; }

/* Hero istatistik — hero-meta içinde gösterilir */
.suggest-link { margin-top: 10px; font-size: 12px; color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; background: none; border: none; }
.suggest-link:hover { color: var(--text); }

/* Modals — yumuşak açılış */
.suggest-modal, .image-modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    opacity: 0; visibility: hidden;
    transition: opacity .26s ease, visibility .26s ease;
}
.suggest-modal[hidden], .image-modal[hidden] { display: none !important; }
.suggest-modal:not([hidden]), .image-modal:not([hidden]) { display: flex; }
.suggest-modal.modal-visible, .image-modal.modal-visible { opacity: 1; visibility: visible; }
.suggest-modal .modal-backdrop, .image-modal .modal-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,.45);
    opacity: 0; transition: opacity .26s ease;
}
.suggest-modal.modal-visible .modal-backdrop, .image-modal.modal-visible .modal-backdrop { opacity: 1; }
.suggest-modal-content, .image-modal .modal-content {
    position: relative; background: var(--bg); border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    transform: scale(.96) translateY(10px);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.suggest-modal.modal-visible .suggest-modal-content,
.image-modal.modal-visible .modal-content { transform: scale(1) translateY(0); }
.suggest-modal-content { padding: 20px; width: 100%; max-width: 380px; }
.suggest-modal-content h3 { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.suggest-modal-content > p { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.suggest-form { display: flex; flex-direction: column; gap: 8px; }
.suggest-form input, .suggest-form textarea {
    padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; background: var(--bg); color: var(--text);
    font-family: inherit;
}
.suggest-form textarea { resize: vertical; min-height: 80px; }
.suggest-form input:focus, .suggest-form textarea:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.suggest-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.suggest-msg { font-size: 12px; margin-top: 4px; }
.suggest-msg.ok { color: #137333; }
.suggest-msg.err { color: #c5221f; }

/* News */
.news-strip { width: 100%; max-width: 600px; margin-top: 24px; text-align: left; }
.news-strip-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.news-strip-header h3 { font-size: 13px; font-weight: 500; }
.news-live-dot { width: 6px; height: 6px; background: #34a853; border-radius: 50%; }
.news-strip-list { display: flex; flex-direction: column; }
.news-item { display: flex; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); align-items: flex-start; }
.news-item:hover { background: var(--accent-soft); }
.news-favicon { width: 16px; height: 16px; border-radius: 2px; margin-top: 2px; flex-shrink: 0; }
.news-item-title { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--text); }
.news-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.news-empty, .news-loading { font-size: 12px; color: var(--text-muted); padding: 8px; }

/* Results — sola hizalı */
.results-section {
    display: none; width: 100%;
    padding: 12px 16px 48px;
    box-sizing: border-box;
}
.results-section.visible { display: block; }
.results-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.results-list.hidden { display: none; }
.results-list { max-width: 720px; }

.result-card { margin-bottom: 24px; max-width: 720px; }
.result-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: nowrap; }
.result-favicon { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.result-favicon-fallback {
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent-soft); font-size: 9px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
.result-site-info { min-width: 0; line-height: 1.3; flex: 1; overflow: hidden; }
.result-domain { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-url { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-title {
    display: block; font-size: 18px; font-weight: 400; color: var(--link);
    line-height: 1.3; margin-bottom: 4px; cursor: pointer;
    word-break: break-word;
}
.result-title:hover { text-decoration: underline; }
.result-title:visited { color: var(--link-visited); }
.result-body { display: flex; gap: 12px; align-items: flex-start; flex-wrap: nowrap; }
.result-description { font-size: 13px; color: var(--text-secondary); line-height: 1.58; flex: 1; min-width: 0; word-break: break-word; }
/* Mark (sarı highlight) kaldır */
.result-description mark { background: transparent; padding: 0; font-weight: 600; color: inherit; }
.result-thumb { flex-shrink: 0; width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-footer { margin-top: 6px; }
.lang-pill { font-size: 11px; color: var(--text-muted); background: var(--accent-soft); padding: 2px 6px; border-radius: 3px; }

/* Featured result — sade badge, border yok */
.result-featured { }
.featured-badge {
    font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
    background: var(--bg-muted); color: var(--text-secondary); white-space: nowrap; margin-left: auto;
    border: 1px solid var(--border);
}

/* AI */
.ai-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; background: var(--bg-soft); }
.ai-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ai-badge { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ai-status { font-size: 11px; color: var(--text-muted); }
.ai-answer { font-size: 14px; line-height: 1.55; color: var(--text); }
.ai-cursor { display: inline-block; width: 2px; height: 14px; background: var(--accent); animation: blink .8s infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }
.ai-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-source-link { font-size: 11px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text-secondary); }
.ai-source-link:hover { background: var(--accent-soft); }
.ai-continue { margin-top: 10px; }

/* Images — tam genişlik grid */
.image-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; width: 100%; max-width: none; }
.image-grid.visible { display: grid; }
.image-card { position: relative; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--bg-muted); }
.image-card img { width: 100%; height: 100%; object-fit: cover; }
.image-card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 8px; background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: #fff; font-size: 11px;
}
.image-card-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.image-card-domain { opacity: .85; font-size: 10px; }

/* Pagination */
.pagination { display: flex; gap: 4px; margin-top: 24px; flex-wrap: wrap; }
.page-btn { min-width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; color: var(--link); }
.page-btn:hover { background: var(--accent-soft); }
.page-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); pointer-events: none; }

/* Empty / spinner */
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; font-weight: 400; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }
.spinner {
    width: 28px; height: 28px; margin: 32px auto;
    border: 3px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.image-modal { z-index: 100; }
.image-modal .modal-content { max-width: 860px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); font-size: 20px; z-index: 2; line-height: 1; }
.modal-body { display: flex; flex-wrap: wrap; }
.modal-image-wrap { flex: 1; min-width: 240px; padding: 16px; }
.modal-image-wrap img { border-radius: var(--radius-sm); max-height: 60vh; object-fit: contain; margin: 0 auto; }
.modal-details { flex: 1; min-width: 240px; padding: 16px 16px 20px; }
.modal-details h2 { font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.modal-alt { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.modal-source { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.modal-favicon { width: 20px; height: 20px; border-radius: 50%; }
.modal-domain { font-size: 13px; font-weight: 500; }
.modal-page-url { font-size: 12px; color: var(--text-muted); }
.modal-meta { display: flex; gap: 6px; margin-bottom: 14px; }
.source-pill { font-size: 11px; background: var(--accent-soft); padding: 2px 8px; border-radius: 3px; color: var(--text-muted); }
.modal-visit, .modal-image-open { display: inline-block; margin-right: 8px; margin-top: 4px; }

/* Toast */
.toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(60px);
    background: #323232; color: #fff; padding: 10px 18px; border-radius: var(--radius-sm);
    font-size: 13px; opacity: 0; transition: all .2s; z-index: 300; pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Admin ── */
.admin-page { max-width: 980px; margin: 0 auto; padding: 12px 16px 32px; }
.admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-header h1 { font-size: 18px; font-weight: 500; }
.admin-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.admin-tab {
    padding: 8px 14px; font-size: 13px; color: var(--text-secondary);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); font-weight: 500; border-bottom-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.worker-live { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.empty-cell { text-align: center; padding: 16px; color: var(--text-muted); }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; min-width: 280px; flex: 1; max-width: 420px;
}
.stat-card {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 12px; text-align: center;
}
.stat-value { font-size: 20px; font-weight: 600; line-height: 1.2; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px;
}
.card h2 { font-size: 14px; font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.card p { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.card code { display: block; background: var(--bg-soft); padding: 10px; border-radius: var(--radius-sm); font-size: 11px; line-height: 1.7; word-break: break-all; }

.table-wrapper { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 500; color: var(--text-secondary); font-size: 11px; }
tr:last-child td { border-bottom: 0; }
.truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-favicon { width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }

.domain-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.domain-input { flex: 1; min-width: 120px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; background: var(--bg); color: var(--text); }
.domain-select { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; background: var(--bg); color: var(--text); }
.domain-pager { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }

.status-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 500; }
.status-indexed { background: #e6f4ea; color: #137333; }
.status-pending { background: #fef7e0; color: #b06000; }
.status-failed { background: #fce8e6; color: #c5221f; }
.status-processing { background: var(--accent-soft); color: var(--text-secondary); }
.lang-badge { font-size: 10px; background: var(--accent-soft); padding: 2px 5px; border-radius: 3px; }

.url-input-area {
    width: 100%; min-height: 80px; padding: 10px; font-size: 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: Consolas, monospace; resize: vertical;
    background: var(--bg); color: var(--text);
}

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 340px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.login-logo { justify-content: center; margin-bottom: 20px; }
.login-form input { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.login-form button { width: 100%; }
.login-error { color: #c5221f; font-size: 12px; margin-bottom: 10px; }
.login-back { display: block; text-align: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* Chat */
body.chat-page { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }

/* Sidebar overlay (mobil) */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 55;
    background: rgba(0,0,0,.45);
    opacity: 0; transition: opacity .2s;
}
.sidebar-overlay.visible { display: block; opacity: 1; }

.chat-sidebar {
    width: 240px; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    background: var(--bg-soft); flex-shrink: 0;
    transition: transform .2s;
}
.sidebar-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--border); gap: 6px;
}
.sidebar-sessions { flex: 1; overflow-y: auto; padding: 6px; }
.session-item {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 12px; cursor: pointer; position: relative;
    transition: background .12s;
}
.session-item:hover, .session-item.active { background: var(--bg-muted); }
.session-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-delete {
    width: 22px; height: 22px; border-radius: var(--radius-sm);
    color: var(--text-muted); background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s, background .15s; flex-shrink: 0;
}
.session-item:hover .session-delete { opacity: 1; }
.session-delete:hover { background: var(--bg-muted); color: var(--text); }

/* Inline delete confirm artık kullanılmıyor */
.session-delete-confirm { display: none; }

/* Chat sohbet silme modal */
.chat-delete-modal {
    position: fixed; inset: 0; z-index: 400;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
}
.chat-delete-modal.visible { opacity: 1; }
.chat-delete-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,.45);
}
.chat-delete-box {
    position: relative; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px 24px; box-shadow: var(--shadow);
    min-width: 240px; text-align: center;
    transform: scale(.95); transition: transform .2s;
}
.chat-delete-modal.visible .chat-delete-box { transform: scale(1); }
.chat-delete-box p { font-size: 14px; margin-bottom: 14px; color: var(--text); }
.chat-delete-actions { display: flex; gap: 8px; justify-content: center; }

.sidebar-loading, .sidebar-empty { padding: 12px; font-size: 12px; color: var(--text-muted); }

/* Chat main */
.chat-main {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    background: var(--bg);
}
.chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    background: var(--bg); flex-shrink: 0;
}
.chat-header h1 { font-size: 14px; flex: 1; font-weight: 500; color: var(--text); }
.chat-header-actions { display: flex; align-items: center; gap: 6px; }

/* Mesajlar alanı */
.chat-messages {
    flex: 1; overflow-y: auto; padding: 24px 16px 16px;
    display: flex; flex-direction: column; gap: 2px;
    scroll-behavior: smooth;
}

/* Welcome ekranı */
.chat-welcome {
    margin: auto;
    text-align: center;
    max-width: 440px;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}
.chat-welcome-icon {
    width: 56px; height: 56px; margin: 0 auto 14px;
    border-radius: 16px;
    background: var(--bg-soft); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.chat-welcome h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.chat-welcome p  { font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chat-suggestion-btn {
    padding: 6px 12px; font-size: 12px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--bg-soft);
    color: var(--text-secondary); cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.chat-suggestion-btn:hover { background: var(--bg-muted); border-color: var(--accent); color: var(--text); }

/* Chat bubble'lar */
.chat-bubble {
    max-width: 75%; padding: 10px 14px;
    border-radius: 16px; font-size: 13px; line-height: 1.6;
    word-break: break-word; margin-bottom: 4px;
    animation: bubbleIn .15s ease;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Kullanıcı balonu — sağa */
.chat-bubble.chat-user {
    background: var(--accent);
    color: var(--bg);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
[data-theme="dark"] .chat-bubble.chat-user {
    background: #3d3d3d;
    color: var(--text);
}

/* AI balonu — sola */
.chat-bubble.chat-assistant {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    color: var(--text);
    position: relative;
}
.chat-bubble.chat-assistant::before {
    content: 'AI';
    position: absolute; top: -18px; left: 2px;
    font-size: 10px; font-weight: 600;
    color: var(--text-muted); letter-spacing: .5px;
}
.chat-bubble.streaming::after {
    content: '';
    display: inline-block; width: 2px; height: 13px;
    background: var(--text); vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink .8s infinite;
}

/* Yazma imleci */
.chat-cursor {
    display: inline-block; width: 2px; height: 13px;
    background: currentColor; vertical-align: text-bottom;
    margin-left: 2px; animation: blink .8s infinite;
}

/* AI düşünüyor — üç nokta animasyonu */
.chat-thinking {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 0;
}
.chat-thinking span {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--text-secondary); opacity: 0.4;
    animation: chatThink 1.2s infinite ease-in-out;
}
.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatThink {
    0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
    40%            { opacity: 1;   transform: scale(1.3); }
}

/* Input alanı */
.chat-input-wrap {
    padding: 12px 16px 14px; border-top: 1px solid var(--border);
    background: var(--bg); flex-shrink: 0;
}
.chat-input-form { max-width: 720px; margin: 0 auto; }
.chat-input-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 24px; padding: 6px 6px 6px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.chat-input-box:focus-within {
    border-color: var(--accent); box-shadow: 0 0 0 2px rgba(128,128,128,.12);
}
.chat-input-box input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 14px; color: var(--text); min-width: 0;
    padding: 4px 0;
}
.chat-input-box input::placeholder { color: var(--text-muted); }
.chat-send-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: var(--bg);
    border: none; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .15s, transform .1s;
}
.chat-send-btn:hover:not(:disabled) { opacity: .85; transform: scale(1.05); }
.chat-send-btn:disabled { opacity: .35; cursor: default; }
.chat-hint {
    text-align: center; font-size: 11px; color: var(--text-muted);
    margin-top: 6px;
}

.sidebar-toggle {
    display: none; border: 1px solid var(--border); padding: 5px 7px;
    border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
    align-items: center; justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; padding: 8px 12px; }
    .header-search { order: 3; flex: 1 1 100%; max-width: none; }
    .header-region { order: 2; }
    .header-nav { order: 1; margin-left: auto; }
    .logo-text { display: none; }
    .admin-top { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); max-width: none; }
    .hero { padding-top: 32px; }
    .hero-title { font-size: 28px; }
    .hero-ai-pill { font-size: 12px; padding: 5px 12px; }
    .ai-pill-btn { display: none; } /* header'da küçük ekranda gizle */
    .result-title { font-size: 16px; }
    .result-body { flex-wrap: wrap; }
    .result-thumb { width: 60px; height: 60px; }
    /* Chat mobil */
    .sidebar-toggle { display: flex !important; }
    .chat-sidebar {
        position: fixed; left: 0; top: 0; height: 100%; z-index: 60;
        transform: translateX(-100%);
    }
    .chat-sidebar.open { transform: translateX(0); }
    .chat-bubble { max-width: 92%; }
}

@media (max-width: 480px) {
    .hero { min-height: auto; padding-top: 20px; }
    .hero-toolbar { flex-direction: column; gap: 8px; }
    .search-actions .btn { flex: 1; }
}


/* ── Aerys Projeleri ── */
.projects-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0 32px;
    text-align: center;
}
.projects-section.hidden {
    display: none;
}

.projects-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
    margin-bottom: 16px;
}
.projects-toggle:hover {
    background: var(--accent-soft);
    color: var(--text);
    border-color: var(--text-muted);
}
.projects-toggle[aria-expanded="true"] {
    background: var(--bg-muted);
    color: var(--text);
}
.projects-toggle-inner {
    display: flex;
    align-items: center;
    gap: 7px;
}
.projects-chevron {
    transition: transform .22s ease;
}
.projects-toggle[aria-expanded="true"] .projects-chevron {
    transform: rotate(180deg);
}

/* Grid */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: left;
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.4,0,.2,1), opacity .26s ease;
}
@media (min-width: 520px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Kart */
.project-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .18s, border-color .18s, transform .15s;
}
.project-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* İkon alanı */
.project-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.project-icon--search {
    background: linear-gradient(135deg, #e8f0fe, #c5d8fd);
    color: #1a73e8;
}
.project-icon--cloud {
    background: linear-gradient(135deg, #e6f4ea, #a8d5b5);
    color: #137333;
}
.project-icon--game {
    background: linear-gradient(135deg, #fce8e6, #f5c6c2);
    color: #c5221f;
}
[data-theme="dark"] .project-icon--search { background: linear-gradient(135deg, #1a2340, #1e3a6e); color: #8ab4f8; }
[data-theme="dark"] .project-icon--cloud  { background: linear-gradient(135deg, #1a2e1e, #1e4027); color: #81c995; }
[data-theme="dark"] .project-icon--game   { background: linear-gradient(135deg, #2e1a1a, #4a1e1e); color: #f28b82; }

/* Metin */
.project-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.project-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.project-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.project-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .2px;
}
.project-card:hover .project-link {
    color: var(--link);
}
/* ── /Aerys Projeleri ── */
