/* e-KT Public View
   Standalone — Bootstrap gerektirmez
   WCAG 2.1 Level AA uyumlu (kontrast oranları belirtilmiştir)
   ──────────────────────────────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #111827;      /* 17:1 kontrast, WCAG AAA */
    background: #f8fafc;
    margin: 0;
    padding: 0;
}

/* ── WCAG 2.4.1: Skip link ──────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    text-decoration: none;
}
.skip-link:focus {
    position: fixed;
    top: 0;
    left: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #1a56db;
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 4px 4px;
    z-index: 9999;
}

/* ── Container (header için) ────────────────────────────────────────────────── */
.ekt-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── 3 Kolon Layout ─────────────────────────────────────────────────────────── */
.ekt-layout {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    grid-template-areas: "left center right";
    gap: 1.25rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    align-items: start;
}

.ekt-center  { grid-area: center; min-width: 0; }

/* ── Sidebar ortak ──────────────────────────────────────────────────────────── */
.ekt-sidebar {
    position: sticky;
    top: calc(1.25rem + 72px); /* header yüksekliği */
}
.ekt-sidebar--left  { grid-area: left; }
.ekt-sidebar--right { grid-area: right; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.ekt-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 100%);
    color: #fff;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.ekt-header__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ekt-header__title {
    font-size: clamp(1.125rem, 4vw, 1.625rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.ekt-header__manufacturer {
    font-size: 0.875rem;
    color: #fff;
}

.ekt-label {
    font-weight: 600;
    margin-inline-end: 0.25rem;
}

/* ── Dil seçici ─────────────────────────────────────────────────────────────── */
.ekt-lang {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
    align-self: flex-start;
}

.ekt-lang__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    min-width: 44px;   /* WCAG 2.5.5: minimum dokunma hedefi */
    min-height: 44px;
    transition: background 0.15s, border-color 0.15s;
}

.ekt-lang__btn:hover,
.ekt-lang__btn:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.ekt-lang__btn--active {
    background: rgba(255, 255, 255, 0.22);
    border-color: #fff;
}

/* ── Main ────────────────────────────────────────────────────────────────────── */

/* ── Kurumsal sidebar ───────────────────────────────────────────────────────── */
.ekt-corp {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
}

.ekt-corp__logo {
    width: 100%;
    max-width: 120px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    display: block;
    margin-inline: auto;
}

.ekt-corp__name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.ekt-corp__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

/* ── Reklam sidebar ─────────────────────────────────────────────────────────── */
.ekt-ad {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.75rem 0.5rem;
}

.ekt-ad__label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

/* ── Meta bilgi kartı ────────────────────────────────────────────────────────── */
.ekt-meta {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.125rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem 1.5rem;
    align-items: center;
}

.ekt-meta__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    flex: 1 1 200px;
    list-style: none;
}

.ekt-meta__item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.ekt-meta__term {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;   /* 4.6:1 on white — WCAG AA */
}

.ekt-meta__def {
    font-size: 0.875rem;
    color: #111827;
}

.ekt-meta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    flex-shrink: 0;
}

/* ── Ses oynatma ─────────────────────────────────────────────────────────────── */
.ekt-audio__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.5rem 0.875rem;
    background: #059669;    /* 4.7:1 on white — WCAG AA */
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.15s;
}

.ekt-audio__btn:hover  { background: #047857; }
.ekt-audio__btn:focus  { outline: 3px solid #059669; outline-offset: 2px; }

/* aria-pressed="true" → Durdur durumu */
.ekt-audio__btn[aria-pressed="true"]       { background: #b91c1c; }
.ekt-audio__btn[aria-pressed="true"]:hover { background: #991b1b; }

/* ── Yazı boyutu kontrolü ────────────────────────────────────────────────────── */
.ekt-fontsize {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 44px;   /* WCAG 2.5.5 */
}

.ekt-fontsize__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    background: transparent;
    border: none;
    border-right: 1.5px solid #d1d5db;
    cursor: pointer;
    font-family: inherit;
    color: #374151;
    font-weight: 700;
    line-height: 1;
    transition: background 0.12s, color 0.12s;
    min-width: 40px;
    user-select: none;
    -webkit-user-select: none;
}

.ekt-fontsize__btn:last-child {
    border-right: none;
}

.ekt-fontsize__btn--reset {
    font-size: 1rem;
    color: #1a56db;
    border-right: 1.5px solid #d1d5db;
}

.ekt-fontsize__btn--lg {
    font-size: 1.125rem;
}

/* İlk buton (A-) küçük görünsün */
.ekt-fontsize__btn:first-child {
    font-size: 0.8125rem;
}

.ekt-fontsize__btn:hover,
.ekt-fontsize__btn:focus {
    background: #eff6ff;
    color: #1a56db;
    outline: none;
}

.ekt-fontsize__btn:focus-visible {
    outline: 3px solid #1a56db;
    outline-offset: -2px;
    z-index: 1;
    position: relative;
}

/* Aktif (uygulanmış) durum — boyut sınırda ise buton soluklaşır */
.ekt-fontsize__btn[aria-disabled="true"] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ── İndirme butonu ──────────────────────────────────────────────────────────── */
.ekt-download__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #1a56db;    /* 7.5:1 on white — WCAG AAA */
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    min-height: 44px;
    transition: background 0.15s;
}

.ekt-download__btn:hover { background: #1e40af; color: #fff; }
.ekt-download__btn:focus { outline: 3px solid #1a56db; outline-offset: 2px; }

/* ── Prospektüs içeriği ──────────────────────────────────────────────────────── */
.ekt-content {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* İçerik wrapper — global CSS izolasyonu */
.ekt-doc {
    box-sizing: border-box;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.ekt-footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 0;
}

.ekt-footer__text {
    font-size: 0.8rem;
    color: #4b5563;    /* 7:1 on white — WCAG AAA */
    margin-bottom: 0.25rem;
}

.ekt-footer__legal {
    font-size: 0.75rem;
    color: #6b7280;    /* 4.6:1 on white — WCAG AA */
    font-style: italic;
}

/* ── RTL — Arapça ────────────────────────────────────────────────────────────── */
[dir="rtl"] .ekt-header__inner  { flex-direction: row-reverse; }
[dir="rtl"] .ekt-lang           { flex-direction: row-reverse; }
[dir="rtl"] .ekt-meta__list     { flex-direction: row-reverse; }
[dir="rtl"] .ekt-meta__actions  { flex-direction: row-reverse; }
[dir="rtl"] .ekt-content ul,
[dir="rtl"] .ekt-content ol     { margin: 0 1.5em 1em 0; }
[dir="rtl"] .ekt-content th,
[dir="rtl"] .ekt-content td     { text-align: end; }

/* ── Tablet: sidebar'ları gizle ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ekt-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "center";
    }
    .ekt-sidebar { display: none; }
}

/* ── Mobil ───────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ekt-header__inner  { flex-direction: column; align-items: flex-start; }
    .ekt-lang           { flex-wrap: wrap; }
    .ekt-meta           { flex-direction: column; align-items: flex-start; }
    .ekt-meta__actions  { width: auto; }
    .ekt-download__btn,
    .ekt-audio__btn     { width: auto; }
}

/* ── Baskı ───────────────────────────────────────────────────────────────────── */
@media print {
    .skip-link,
    .ekt-lang,
    .ekt-audio,
    .ekt-meta__actions,
    .ekt-sidebar,
    .ekt-footer     { display: none !important; }

    .ekt-layout     { display: block; padding: 0; }
    .ekt-header     { background: none !important; color: #000; padding: 0.5rem 0; }
    .ekt-content    { border: none; padding: 0; box-shadow: none; }
    .ekt-container  { max-width: 100%; padding: 0; }
    body            { font-size: 11pt; background: #fff; }
    .ekt-content a::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
    .ekt-chat-fab, .ekt-chat-panel { display: none !important; }
}

/* ── AI Chat Widget ──────────────────────────────────────────────────────────── */

/* FAB — Sağ alt köşe yüzen düğme */
.ekt-chat-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a56db;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
.ekt-chat-fab:hover { background: #1e40af; transform: scale(1.07); }
.ekt-chat-fab:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.ekt-chat-fab--disabled { background: #9ca3af !important; cursor: not-allowed; transform: none !important; }

/* Panel — sağ altta açılan kart */
.ekt-chat-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: 440px;
    max-width: calc(100vw - 2rem);
    height: 640px;
    max-height: calc(100vh - 9rem);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 36px rgba(0, 0, 0, .20);
    display: flex;
    flex-direction: column;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
    overflow: hidden;
}
.ekt-chat-panel--open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Header */
.ekt-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #1a56db;
    color: #fff;
    flex-shrink: 0;
}
.ekt-chat-panel__title {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}
.ekt-chat-panel__close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.85;
}
.ekt-chat-panel__close:hover { opacity: 1; background: rgba(255,255,255,.15); }

/* Mesaj alanı */
.ekt-chat-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    background: #f8fafc;
}

/* Mesaj baloncukları */
.ekt-chat-msg {
    max-width: 85%;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-break: break-word;
}
.ekt-chat-msg--user {
    background: #1a56db;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
    white-space: pre-wrap;   /* kullanıcı metninde satır sonlarını koru */
}
.ekt-chat-msg--assistant {
    background: #fff;
    color: #1f2937;
    align-self: flex-start;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 3px;
}
/* Markdown elementleri — assistant baloncuğu içinde */
.ekt-chat-msg--assistant h3,
.ekt-chat-msg--assistant h4,
.ekt-chat-msg--assistant h5,
.ekt-chat-msg--assistant h6 {
    margin: 0.5em 0 0.25em;
    font-size: 0.9rem;
    font-weight: 700;
}
.ekt-chat-msg--assistant p  { margin: 0.2em 0; }
.ekt-chat-msg--assistant ul { margin: 0.25em 0 0.25em 1.1em; padding: 0; }
.ekt-chat-msg--assistant li { margin: 0.15em 0; }
.ekt-chat-msg--assistant hr { border: none; border-top: 1px solid #e5e7eb; margin: 0.5em 0; }
.ekt-chat-msg--assistant blockquote {
    border-left: 3px solid #d1d5db;
    margin: 0.25em 0;
    padding-left: 0.6em;
    color: #6b7280;
    font-style: italic;
}
.ekt-chat-msg--assistant code {
    background: #f3f4f6;
    border-radius: 3px;
    padding: 0.1em 0.3em;
    font-size: 0.85em;
}
.ekt-chat-msg--assistant strong { font-weight: 700; }
.ekt-chat-msg--assistant em    { font-style: italic; }
.ekt-chat-msg--assistant del   { text-decoration: line-through; color: #6b7280; }
.ekt-chat-msg--assistant ol    { margin: 0.25em 0 0.25em 1.3em; padding: 0; }
.ekt-chat-msg--assistant a     { color: #2563eb; text-decoration: underline; word-break: break-all; }

/* Markdown tablo */
.ekt-chat-msg--assistant .ekt-md-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.82em;
    margin: 0.4em 0;
    overflow-x: auto;
    display: block;
}
.ekt-chat-msg--assistant .ekt-md-table th,
.ekt-chat-msg--assistant .ekt-md-table td {
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    text-align: left;
    white-space: nowrap;
}
.ekt-chat-msg--assistant .ekt-md-table thead th {
    background: #f3f4f6;
    font-weight: 600;
}

.ekt-chat-msg--loading {
    color: #6b7280;
    font-style: italic;
    animation: ekt-pulse 1.2s ease-in-out infinite;
}
@keyframes ekt-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* Input alanı */
.ekt-chat-panel__input {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.ekt-chat-input {
    flex: 1;
    resize: none;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s;
}
.ekt-chat-input:focus { border-color: #1a56db; }
.ekt-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #1a56db;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ekt-chat-send:hover { background: #1e40af; }
.ekt-chat-send:disabled { background: #9ca3af; cursor: default; }

/* ── STT Mic butonu ───────────────────────────────────────────────────────── */
.ekt-chat-mic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ekt-chat-mic:hover { background: #e0e7ff; color: #1d4ed8; border-color: #a5b4fc; }
.ekt-chat-mic--recording {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    animation: ekt-mic-pulse 1s ease-in-out infinite;
}
@keyframes ekt-mic-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

/* ── TTS Speaker butonu (AI mesaj içinde) ────────────────────────────────── */
.ekt-chat-msg__tts {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.4rem;
    padding: 0.2rem 0.55rem;
    background: transparent;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.ekt-chat-msg__tts:hover { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.ekt-chat-msg__tts--speaking { color: #0369a1; border-color: #7dd3fc; background: #f0f9ff; }

/* ── Chat Chips ──────────────────────────────────────────────────────────── */
.ekt-chat-chips {
    padding: 0 0.75rem 0.5rem;
    background: #fff;
    flex-shrink: 0;
    max-height: 210px;
    overflow-y: auto;
    border-top: 1px solid #f3f4f6;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.ekt-chat-chips:empty { display: none; }
.ekt-chip-category {
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0.55rem 0 0.3rem;
}
.ekt-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.1rem;
}
.ekt-chip {
    display: inline-block;
    padding: 0.28rem 0.65rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.775rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ekt-chip:hover {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}
.ekt-chip--followup {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.ekt-chip--followup:hover {
    background: #15803d;
    color: #fff;
    border-color: #15803d;
}
