:root {
    --bg-page: #f2f2f7;
    --bg-panel: #f9fafb;
    --bg-card: #ffffff;
    --border-soft: #e5e5ea;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;
    --bubble-user: #2563eb;
    --bubble-assistant: #f3f4f6;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --radius-card: 24px;
    --radius-bubble: 18px;
    --shadow-soft: 0 22px 55px rgba(15, 23, 42, 0.16);
    --transition-fast: 0.18s ease-out;
    --transition-med: 0.24s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    system-ui, sans-serif;
    background: radial-gradient(circle at top left, #e5edff 0, #f2f2f7 38%, #f9fafb 70%);
    color: var(--text-main);
}

/* Ana shell – tam ekranda ortalanmış ve max-width sınırlı */

.shell {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 32px 24px; /* üstte biraz daha az boşluk */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;  /* ÖNEMLİ: artık ortada değil, yukarıdan başlasın */
    position: relative;
}

.focus-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(129, 140, 248, 0.3), transparent 55%),
                radial-gradient(circle at bottom, rgba(37, 99, 235, 0.25), transparent 60%);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 20;
}

/* Focus modunda aktif olsun */
body.focus-chat .focus-backdrop {
    opacity: 1;
    pointer-events: auto;
}


/* Dekoratif blur “orb” */

.shell::before {
    content: "";
    position: fixed;
    top: -120px;
    right: -80px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.5), transparent 60%);
    filter: blur(18px);
    opacity: 0.7;
    pointer-events: none;
    z-index: -1;
}

/* Basit giriş animasyonları */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-up {
    opacity: 0;
    animation: fadeUp 0.6s var(--transition-med) forwards;
}

.animate-delay-1 {
    animation-delay: 0.08s;
}

.animate-delay-2 {
    animation-delay: 0.16s;
}

/* Site header */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    flex-shrink: 0;
}

.brand-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
}

.brand-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.brand-tag {
    display: flex;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    color: var(--text-muted);
    backdrop-filter: blur(12px);
}

.pill-soft {
    border-color: transparent;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

/* Lokasyon pill + tooltip */

.pill-location {
    position: relative;
    cursor: pointer;
    padding-right: 22px;
    z-index: 10;          /* yeni: bu pill diğerlerinin üstüne çıksın */
}

.pill-caret {
    font-size: 10px;
    color: var(--text-soft);
    margin-left: 4px;
}

.tooltip-card {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 260px;
    max-width: 320px;
    padding: 12px 13px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    font-size: 12px;
    color: var(--text-muted);
    backdrop-filter: blur(14px);

    opacity: 0;
    transform: translateY(6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.16s ease-out,
                transform 0.16s ease-out;
    z-index: 9999 !important;
}

/* Hover / focus / .tooltip-open durumunda göster */
.pill-location:hover .tooltip-card,
.pill-location:focus-within .tooltip-card,
.pill-location.tooltip-open .tooltip-card {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tooltip-title {
    margin: 0 0 4px 0;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-main);
}

.tooltip-text {
    margin: 0 0 4px 0;
}

.tooltip-note {
    margin: 0;
    font-size: 11px;
    color: var(--text-soft);
}

/* Küçük ekranlarda tooltip'in sağa taşmaması için */
@media (max-width: 720px) {
    .tooltip-card {
        left: 0;
        right: auto;
        max-width: min(320px, 90vw);
    }
}


/* Ana layout */

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.1fr);
    gap: 26px;
    align-items: stretch;  
}

/* Intro panel */

.intro-panel {
    display: flex;
    align-items: stretch;
    height: 100%;         
}

.intro-content {
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.88);
    padding: 22px 22px 20px 22px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 48px rgba(148, 163, 184, 0.28);
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;       
}


.intro-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.2;
}

.intro-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

.intro-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    position: relative;   /* yeni */
    z-index: 0;           /* yeni */
}

.intro-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.stat-card {
    border-radius: 18px;
    background: var(--bg-panel);
    border: 1px solid rgba(148, 163, 184, 0.55);
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.intro-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

/* Alt bölüm: istatistikler + dekoratif bar */

.intro-bottom {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}



.intro-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    border-radius: 16px;
    background: rgba(249, 250, 251, 0.95);
    border: 1px solid rgba(209, 213, 219, 0.9);
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 12px 28px rgba(148, 163, 184, 0.24);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        rgba(96, 165, 250, 0.18),
        rgba(192, 132, 252, 0.12),
        rgba(52, 211, 153, 0.14));
    opacity: 0;
    transition: opacity 0.18s ease-out;
    pointer-events: none;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
}

.metric-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.metric-footnote {
    font-size: 11px;
    color: var(--text-muted);
}

/* Dekoratif bar + glow animasyonu */

.intro-deco {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.deco-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(148, 163, 184, 0.2),
        rgba(209, 213, 219, 0.6),
        rgba(148, 163, 184, 0.2));
    overflow: hidden;
}

.deco-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(59, 130, 246, 0),
        rgba(59, 130, 246, 0.65),
        rgba(236, 72, 153, 0.7),
        rgba(59, 130, 246, 0));
    width: 40%;
    filter: blur(6px);
    animation: decoSlide 5s ease-in-out infinite;
}

@keyframes decoSlide {
    0%   { transform: translateX(-60%); opacity: 0; }
    15%  { opacity: 1; }
    50%  { transform: translateX(80%); opacity: 1; }
    85%  { opacity: 0; }
    100% { transform: translateX(140%); opacity: 0; }
}

.deco-caption {
    margin: 0;
    font-size: 11px;
    color: var(--text-soft);
}

/* Responsive uyum: kartları alt alta diz */

@media (max-width: 900px) {
    .intro-metrics {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* Chat panel */

.chat-panel {
    display: flex;
    align-items: stretch;
    height: 100%;
}

.card {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    height: 100%; /* hücre yüksekliğini doldur */
}


/* Card header */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-soft);
    gap: 10px;
    background: linear-gradient(to right, #ffffff, #f5f7ff);
}

.card-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Focus mode: chat kartı sayfanın ortasına gelir */

body.focus-chat {
    overflow-x: hidden;   
    overflow-y: hidden;   
}

body.focus-chat .site-header {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* FOCUS MODE: sadece chat kartı, tam ortada */

body.focus-chat {
    overflow: hidden;
}

/* Layout artık full-screen flex container olsun */
body.focus-chat .layout {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: flex-start;   /* kart uzun olursa yukarıdan başlasın */
    padding: 32px 16px 40px;   /* altta da biraz boşluk */
    max-width: none;
    margin: 0;
}


/* Sol CV panelini tamamen gizle */
body.focus-chat .intro-panel {
    display: none;
}

/* Sadece chat paneli kalsın ve ortalansın */
body.focus-chat .chat-panel {
    width: 100%;
    max-width: 860px;
    margin: 0;
}

/* Kart biraz daha modal gibi dursun */
body.focus-chat .card {
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.45);

    /* 🔥 önemli kısım burası */
    max-height: calc(100vh - 40px);  /* kart asla ekranı aşmasın */
    display: flex;
    flex-direction: column;
}


/* Header'ı hafifçe sadeleştirebiliriz istersen */
body.focus-chat .site-header {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* CV görünümü butonu sadece focus modunda gözüksün */
.header-link-compact {
    display: none;
}
body.focus-chat .header-link-compact {
    display: inline-flex;
}

@media (max-width: 720px) {
    body.focus-chat .layout {
        padding: 18px 10px;
        align-items: flex-start;   /* mobilde taşma olursa yukarı hizala */
    }

    body.focus-chat .chat-panel {
        max-width: 100%;
    }
}


body.focus-chat .card {
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4);
}

/* Focus modunda sadece "CV görünümü" butonu göster, diğer header linkleri daha sade dursun */
.header-link-compact {
    display: none;
}

body.focus-chat .header-link-compact {
    display: inline-flex;
}

@media (max-width: 720px) {
    body.focus-chat .layout {
        padding: 18px 10px;
    }

    body.focus-chat .chat-panel {
        max-width: 100%;
    }
}


.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.header-text h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.header-text p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.card-header-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: 11px;
    color: #1d4ed8;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
}

.header-links {
    display: flex;
    gap: 6px;
}

.header-link {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    color: #111827;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.96);
    transition: background var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast),
                box-shadow var(--transition-fast);
}

.header-link:hover {
    background: #eef2ff;
    border-color: #6366f1;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.26);
    transform: translateY(-1px);
}

/* Card body */

.card-body {
    flex: 1 1 auto;               /* header ile footer arasındaki alan */
    display: flex;
    flex-direction: column;
    padding: 14px 16px 8px 16px;
    gap: 10px;
    overflow: hidden;             /* içeride sadece messages scroll etsin */
}


.messages {
    flex: 1 1 auto;     
    min-height: 0;      
    overflow-y: auto;   
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}



/* Scrollbar */

.messages::-webkit-scrollbar {
    width: 6px;
}
.messages::-webkit-scrollbar-track {
    background: transparent;
}
.messages::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 999px;
}

/* Message balonları */

.message-row {
    display: flex;
    width: 100%;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.assistant {
    justify-content: flex-start;
}

.bubble {
    max-width: 82%;
    padding: 9px 12px;
    font-size: 14px;
    border-radius: var(--radius-bubble);
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: transform var(--transition-fast), opacity var(--transition-fast),
    box-shadow var(--transition-med);
    transform: translateY(4px);
    opacity: 0;
}

.bubble.appear {
    transform: translateY(0);
    opacity: 1;
}

.bubble.user {
    background: var(--bubble-user);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
}

.bubble.assistant {
    background: var(--bubble-assistant);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 6px 16px rgba(148, 163, 184, 0.42);
}

/* Quick actions */

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.quick-label {
    font-size: 11px;
    color: var(--text-soft);
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-btn {
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #f9fafb;
    font-size: 12px;
    padding: 6px 11px;
    color: var(--text-main);
    cursor: pointer;
    transition: background var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast),
                box-shadow var(--transition-fast);
}

.quick-btn:hover {
    background: #eef2ff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

/* Footer / input */

.card-footer {
    flex-shrink: 0;               /* footer asla kaybolmasın */
    border-top: 1px solid var(--border-soft);
    padding: 9px 16px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: #f9fafb;
}


.input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

#chat-input {
    flex: 1;
    resize: none;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    padding: 9px 13px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    max-height: 80px;
    background: #ffffff;
}

/* BURAYA EKLE */
#chat-input::-webkit-scrollbar {
    display: none;
}

#chat-input {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.send-btn {
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast),
                transform var(--transition-fast),
                box-shadow var(--transition-fast);
}

.send-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.disclaimer {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* Typing indicator */

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #9ca3af;
    animation: blink 1s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.15s;
}
.dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

/* Site footer */

.site-footer {
    margin-top: 18px;
    font-size: 11px;
    color: var(--text-soft);
    display: flex;
    justify-content: center;
}

/* Responsive */

@media (max-width: 980px) {
    .shell {
        justify-content: flex-start;
        padding-top: 18px;
    }
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .intro-panel {
        order: 2;
    }
    .chat-panel {
        order: 1;
    }
}

@media (max-width: 720px) {
    .shell {
        padding: 16px 12px 18px 12px;
    }
    .intro-content {
        padding: 16px 14px;
        border-radius: 20px;
    }
    .intro-title {
        font-size: 22px;
    }
    .intro-stats {
        grid-template-columns: minmax(0, 1fr);
    }
    .card {
        border-radius: 20px;
    }
    .card-header {
        padding: 14px 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .card-body {
        padding: 12px 12px 6px 12px;
    }
    .card-footer {
        padding: 8px 12px 12px 12px;
    }
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .brand-tag {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .brand-sub {
        font-size: 11px;
    }
}

.chat-spacer {
    flex: 1 1 auto; /* boşluk esner */
    min-height: 20px; /* çok dar kalmasın */
}

/* --- Wake-up Modal (first message only) --- */

.wake-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

.wake-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.wake-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.wake-modal-inner {
    max-width: 420px;
    width: 90%;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.35);
    padding: 20px 22px;
    font-size: 14px;
    color: #111827;
    backdrop-filter: blur(16px);
}

.wake-modal-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.wake-modal-text {
    margin: 4px 0;
    font-size: 13px;
    color: #4b5563;
}

.wake-modal-countdown {
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #111827;
}

