/* Nova — Modern Acik Tema */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f7;
    --bg-chat: #f4f5f9;
    --bg-user-msg: #e8eaf2;
    --bg-ai-msg: #ffffff;
    --text-primary: #1a1d2e;
    --text-secondary: #5c6078;
    --text-muted: #9498b0;
    --accent: #4f6ef7;
    --accent-hover: #3d5ce0;
    --accent-light: rgba(79, 110, 247, 0.08);
    --accent-border: rgba(79, 110, 247, 0.2);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --border: #e2e4ed;
    --border-light: #eeeff5;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Login Sayfasi --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #e8ecf8, #f8f9fc, #eef0f8);
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #7c8ff7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
}

.login-box h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 2px;
}

.login-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
    font-weight: 400;
}

.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.login-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.3);
}

.login-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 16px;
    display: none;
    padding: 10px;
    background: var(--error-bg);
    border-radius: var(--radius-xs);
}

/* --- Chat Sayfasi --- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #7c8ff7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gpu-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.gpu-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.gpu-badge.online .dot { background: var(--success); }
.gpu-badge.online { color: #15803d; background: var(--success-bg); border-color: rgba(34, 197, 94, 0.2); }
.gpu-badge.offline .dot { background: var(--error); }
.gpu-badge.offline { color: #b91c1c; background: var(--error-bg); border-color: rgba(239, 68, 68, 0.2); }

.btn-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-header:hover {
    background: var(--accent-light);
    border-color: var(--accent-border);
    color: var(--accent);
}

.btn-header svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Chat Area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background: var(--bg-chat);
}

.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Welcome */
.welcome-msg {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.welcome-msg .welcome-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent), #7c8ff7);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.welcome-msg h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-msg p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Messages */
.message {
    max-width: 780px;
    margin: 0 auto 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    line-height: 1.7;
    word-wrap: break-word;
    font-size: 0.95rem;
    position: relative;
}

.message.user {
    background: var(--bg-user-msg);
    border: 1px solid var(--border-light);
}

.message.assistant {
    background: var(--bg-ai-msg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.message .msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message .msg-header .avatar {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}

.message.user .msg-header .avatar { background: #64748b; }
.message.assistant .msg-header .avatar { background: linear-gradient(135deg, var(--accent), #7c8ff7); }

.message .msg-content { color: var(--text-primary); }

.message .msg-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.source-tag.gpu { background: var(--success-bg); color: #15803d; }
.source-tag.claude { background: var(--warning-bg); color: #b45309; }
.source-tag.error { background: var(--error-bg); color: #b91c1c; }

.tool-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Kod bloklari */
.message pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    border: 1px solid #313244;
}

.message code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.88em;
    font-weight: 500;
}

.message pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-weight: 400;
}

/* Thinking indicator */
.thinking-wrapper {
    max-width: 780px;
    margin: 0 auto 14px;
}

.thinking-bubble {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-ai-msg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: bounce 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.input-area {
    padding: 16px 20px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    max-width: 780px;
    margin: 0 auto;
    gap: 10px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    padding: 13px 18px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 50px;
    max-height: 180px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.input-wrapper textarea:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.3);
}

.send-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- GPU Dashboard Panel --- */
.gpu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.gpu-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.gpu-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gpu-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.gpu-cluster-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.gpu-stat {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.gpu-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.gpu-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gpu-agent-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.gpu-agent-card.online { border-left: 3px solid var(--success); }
.gpu-agent-card.offline { border-left: 3px solid var(--error); opacity: 0.7; }

.gpu-agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gpu-agent-header strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.gpu-agent-gpu {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 6px;
}

.gpu-agent-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gpu-agent-status.online { background: var(--success-bg); color: #15803d; }
.gpu-agent-status.offline { background: var(--error-bg); color: #b91c1c; }

.gpu-agent-metrics { display: flex; flex-direction: column; gap: 6px; }

.gpu-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.gpu-metric-label { color: var(--text-secondary); }

.gpu-metric-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.gpu-metric-value.highlight { color: var(--accent); font-size: 0.9rem; }

.gpu-benchmark-btn {
    width: 100%;
    padding: 11px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.gpu-benchmark-btn:hover {
    background: var(--accent);
    color: white;
}

.gpu-benchmark-result {
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-radius: var(--radius-xs);
    min-height: 20px;
}

.gpu-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.dash-section {
    margin-bottom: 20px;
}

.dash-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.gpu-agent-card.busy { border-left: 3px solid var(--warning); }

.gpu-metric-value.warn { color: var(--error); }
.warn { color: var(--error); }

.dash-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.dash-actions .gpu-benchmark-btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .gpu-panel { width: 100%; }
    .app-header { padding: 12px 16px; }
    .message { padding: 14px 16px; margin-bottom: 10px; }
    .input-area { padding: 12px 14px 16px; }
    .login-box { width: 92%; padding: 36px 24px; }
    .header-title { display: none; }
    .gpu-badge span:not(.dot) { display: none; }
    .gpu-badge { padding: 6px 8px; min-width: 30px; }
    .welcome-msg { padding: 40px 16px; }
}

/* Streaming cursor */
.cursor-blink {
    animation: blink 0.8s infinite;
    font-weight: 300;
    color: var(--accent);
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Stream status (tool kullanim bildirimi) */
.stream-status {
    font-size: 12px;
    color: var(--accent);
    padding: 4px 12px;
    font-style: italic;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
