@layer theme, base, components, utilities;
/* Preflight @layer base'de: Tailwind yardımcılarını yenmesin (2026-10-19). */
@import url('lib/tailwindcss/dist/preflight.css') layer(base);

:root {
    /* Design Tokens: Spacing & Radius
       RADIUS ÖLÇEĞİ BURADA TANIMLANMAZ — tek kaynak veraius-base.css.
       ÖLÇÜLDÜ 2026-09-03: --radius-lg iki yerde farklı tanımlıydı
           veraius-base.css  0.625rem = 10px
           app.css           12px              ← app.css sonra yüklendiği için KAZANIYORDU
       Yani base'deki değer ölü koddu ve hangi yarıçapın uygulandığı dosya
       yükleme sırasına bağlıydı. Diğerleri (xs/sm/md) zaten aynı değere
       çözülüyordu; yalnız lg çakışıyordu.
       xl ve pill base'de yok, burada KALIR — tek tanım oldukları sürece
       çakışma üretmezler. */
    --radius-xl: 24px;
    --radius-pill: 9999px;
    
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-12: 3rem;
    --spacing-20: 5rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-body, 'Manrope', system-ui, -apple-system, sans-serif);
    background-color: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
}

h1, h2, h3, h4, .font-headline {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--on-surface);
}

h1 { font-size: 2.25rem; line-height: 1.2; }
h2 { font-size: var(--font-size-3xl); line-height: 1.3; }
h3 { font-size: var(--font-size-2xl); line-height: 1.4; }

/* Global Utilities */
.page-width {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-6);
    padding-right: var(--spacing-6);
}

/* Glassmorphism primitives */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: min(var(--panel-radius, 8px), 8px);
}

.glass-panel-light {
    background: var(--glass-bg-light);
    backdrop-filter: blur(var(--blur-sm));
    border: 1px solid var(--glass-border);
    border-radius: min(var(--panel-radius, 8px), 8px);
}

/* Buttons */
/* TİPOGRAFİ BURADAN KALDIRILDI. ÖLÇÜLDÜ 2026-09-05: kanonik düğme ailesinin
   ÜÇÜNCÜ kopyası burasıydı (veraius-base.css ve veraius-components.css'ten
   sonra). app.css yükleme sırasında sonra geldiği için bu .btn kuralı
   .btn-primary'nin --font-size-2xs'ini (11px) eziyor ve --font-size-base
   (14px) dayatıyordu. Kanıt (CDP getMatchedStylesForNode, /ai/agent-dashboard):
       .btn-primary  ← veraius-base.css      → var(--font-size-2xs)
       .btn-gradient ← veraius-components.css→ var(--font-size-2xs)
       .btn          ← app.css               → var(--font-size-base)  ← kazanan
   Aynı sınıflar body altına kopyalanınca 11px, sayfada 14px ölçüldü.
   Yerleşim özellikleri (flex/padding/yarıçap) KORUNDU — onlar çakışmıyor;
   yalnız ölçüyü belirleyen iki satır kaldırıldı ki rol tanımı tek yerde
   kalsın. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: 0.625rem 1.25rem;
    border-radius: var(--btn-radius);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    /* ÖLÇÜLDÜ 2026-09-15: burada `--gradient-accent` vardı ve o gradyan
       `--primary-container` (#76abae) ile BİTİYOR. Light temada üzerine
       yazılan beyaz metin o uçta 2.56:1 — WCAG AA (4.5:1) altında. Kural
       uygulamadaki TÜM birincil düğmeleri kapsıyordu (giriş, sohbet gönder,
       çalıştır/onayla/yayınla…). `#76ABAE` bir DOLGU tonudur, metin zemini
       değil. Metin-güvenli `--gradient-primary` ile değiştirildi: iki uç da
       >= 4.87:1. `--gradient-accent` dekoratif yüzeylerde kalıyor. */
    /* ref-34 (2026-09-25): gradyan degil DUZ dolgu. Renk tema basina --action-fill (2026-10-26): light'ta gece mavisi
       #30475E (beyaz 9.60:1); dark/mixed'de onceki --primary degeri. Bu kural veraius-base.css'tekini EZIYOR (sonra
       yukleniyor) — ikisi ayni token'i okumali, yoksa tema degisikligi sessizce geri alinir (olculdu 2026-10-26). */
    background: var(--action-fill);
    color: var(--on-action-fill);
    box-shadow: none;
}
.btn-primary:hover {
    background: var(--action-fill-hover);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.08));
}

.btn-secondary {
    /* ref-34: beyaz zemin, teal cerceve ve metin ("Save draft"). */
    background: var(--surface-container-lowest);
    color: var(--primary);
    border: none;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 55%, transparent);
}
.btn-secondary:hover {
    background: color-mix(in srgb, var(--primary) 6%, var(--surface-container-lowest));
}

.btn-ghost {
    background: transparent;
    color: var(--on-surface-variant);
}
.btn-ghost:hover {
    background: var(--state-active-bg);
    color: var(--primary);
}

/* Forms & Inputs */
.input-base {
    background: var(--surface-container-low);
    border: 1px solid var(--ghost-border);
    border-radius: var(--input-radius);
    padding: 0.75rem 1rem;
    color: var(--on-surface);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.input-base:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface-container-highest);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Custom Scrollbar — premium floating thumb (see veraius-base.css for the
   canonical definition; kept in sync here for load-order safety). */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--on-surface) 22%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--on-surface) 20%, transparent);
    border: 3px solid transparent;
    border-radius: var(--chip-radius);
    background-clip: padding-box;
    transition: background-color var(--transition-card);
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--primary) 55%, var(--on-surface)); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background-color: var(--primary); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Blazor Specifics */
#blazor-error-ui {
    background: var(--error-container, #f9dedc);
    color: var(--on-error-container, #410e0b);
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    min-width: 320px;
    max-width: 90vw;
    padding: 0.625rem 1rem;
    position: fixed;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--error, #b3261e);
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: 500;
}

.blazor-error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

#blazor-error-ui a {
    color: var(--error, #b3261e);
    text-decoration: none;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(179, 38, 30, 0.1);
    transition: all var(--transition-fast);
}

#blazor-error-ui a:hover {
    background: rgba(179, 38, 30, 0.2);
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    color: var(--on-error-container);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

#blazor-error-ui .dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Onboarding Tour — Global Overrides to bypass isolation issues */
.oto-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 30000;
    animation: otoFadeIn var(--duration-fast, 150ms) var(--ease-smooth) both;
}

/* driver.js spotlight acikken body'ye .driver-active ekler ve
   `.driver-active * { pointer-events: none }` yazar — yalniz kendi popover'ini
   ve vurgulanan ogeyi muaf tutar. Tur karti Blazor'da cizildigi icin X / Ileri /
   Geri tiklama ALMIYORDU. (0,2,0) ozgulluk driver'in (0,1,0) kuralini yener. */
.driver-active .oto-overlay,
.driver-active .oto-panel,
.driver-active .oto-panel * {
    pointer-events: auto;
}

@keyframes otoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.oto-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 480px;
    z-index: 30001;
    background: var(--surface-container-low);
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: otoIn var(--duration-slow, 250ms) var(--ease-spring) both;
}

@keyframes otoIn {
    from { transform: translate(-50%, -45%) scale(0.95); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.oto-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--surface-container-highest);
}

.oto-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 28px;
    flex-shrink: 0;
    border-radius: 12px;
}

.oto-head-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.oto-eyebrow {
    font-family: var(--font-label);
    font-size: var(--font-size-xs);
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.oto-title {
    margin: 0;
    color: var(--on-surface);
    font-family: var(--font-headline);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oto-skip {
    background: var(--surface-container-highest);
    border: none;
    cursor: pointer;
    color: var(--on-surface-variant);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast, 150ms) ease;
    margin-left: 0.5rem;
}

.oto-skip:hover {
    background: var(--error-container);
    color: var(--error);
}

.oto-body {
    padding: 2rem 1.5rem;
}

.oto-text {
    margin: 0;
    color: var(--on-surface-variant);
    font-size: var(--font-size-lg);
    line-height: 1.6;
}

.oto-progress {
    height: 3px;
    background: var(--surface-container-highest);
    margin: 0;
}

.oto-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 8px var(--primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.oto-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--surface-container);
}

.oto-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-container-highest);
    color: var(--on-surface);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: 700;
    transition: all var(--transition-modal);
    border-radius: 12px;
}

.oto-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.oto-btn--ghost:not(:disabled):hover {
    background: var(--surface-container-highest);
    transform: translateY(-1px);
}

.oto-btn--primary {
    color: var(--on-primary);
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.oto-btn--primary:not(:disabled):hover {
    background: var(--primary);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
}

/* Global Splash Styles — Moved to app.css for build stability */
.splash-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--surface, #0e141c);
    background-image: 
        radial-gradient(circle at 50% 40%, rgba(154, 208, 211, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 40%, rgba(154, 208, 211, 0.05) 0%, transparent 70%);
    overflow: hidden;
    animation: splash-in-global 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.splash-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 10;
}

.splash-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(154, 208, 211, 0.3));
    animation: splash-logo-in-global 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash-wordmark {
    font-size: 1.75rem;
    font-weight: 200;
    letter-spacing: 0.6em;
    text-indent: 0.6em;
    color: var(--on-surface, #dde3ef);
    text-transform: uppercase;
    animation: splash-fade-global 0.8s ease-out 0.4s both;
}

.splash-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    animation: splash-fade-global 0.8s ease-out 0.6s both;
}

.splash-status-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--on-surface-variant, #c1c7ce);
    opacity: 0.7;
}

.splash-status-pct {
    font-size: var(--font-size-base);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary, #9ad0d3);
    font-variant-numeric: tabular-nums;
}

.splash-progress-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--surface-container-highest, #33393f);
    overflow: hidden;
}

.splash-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #9ad0d3), var(--secondary, #b4ccce));
    box-shadow: 0 0 10px var(--primary, #9ad0d3);
    transition: width var(--transition-card);
}

@keyframes splash-in-global {
    from { opacity: 0; background-color: #000; }
    to   { opacity: 1; background-color: var(--surface, #0e141c); }
}

@keyframes splash-logo-in-global {
    from { opacity: 0; transform: scale(0.8) translateY(20px); filter: blur(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); filter: drop-shadow(0 0 30px rgba(154, 208, 211, 0.3)); }
}

@keyframes splash-fade-global {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--radius-md);
    margin: 1rem;
}

/* Blank Layout */
.blank-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Kabuk gövde ile aynı yükseklikte esnesin (özellikle minimal krom rotaları) */
body > .app-shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}
