/* =============================================
   Ajansay & İdeal E-Ticaret — Alan Adı Sorgulama
   ============================================= */

/* ---------- Font (yerel; SIL OFL 1.1, bkz. assets/fonts/LICENSE-Inter.txt) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('assets/fonts/inter-latin-wght.woff2') format('woff2-variations'),
         url('assets/fonts/inter-latin-wght.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('assets/fonts/inter-latin-ext-wght.woff2') format('woff2-variations'),
         url('assets/fonts/inter-latin-ext-wght.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tasarım değişkenleri ---------- */
:root {
    /* Zemin ve yüzeyler */
    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-soft: #f8fafc;               /* sonuç paneli ve kartlar */
    --surface-muted: #f1f5f9;
    --glass: rgba(255, 255, 255, 0.45);    /* sol panel */
    --glass-fallback: rgba(255, 255, 255, 0.78);
    --header-bg: rgba(248, 250, 252, 0.6);
    --header-fallback: rgba(248, 250, 252, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(148, 163, 184, 0.42);

    /* Metin (beyaz/#F8FAFC üzerinde kontrast) */
    --text: #334155;         /* ~10:1 */
    --text-muted: #475569;   /* ~7.2:1 */
    --text-subtle: #5b6b80;  /* ~5.3:1 */

    /* Sakin mavi vurgu */
    --accent: #2f63c4;       /* beyaz metinle ~5.6:1 */
    --accent-hover: #2752a6;
    --accent-soft: #e6edf9;
    --focus-ring: 0 0 0 3px rgba(47, 99, 196, 0.22);

    /* Pastel durum renkleri */
    --st-registered-fg: #2b4a8b;
    --st-registered-bg: #e8eefb;
    --st-notfound-fg: #1f6845;
    --st-notfound-bg: #e3f4ea;
    --st-failed-fg: #8a4b0f;
    --st-failed-bg: #fdf1df;
    --danger: #b42318;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

    --fs-xs: 12px;     /* etiketler, kaynak/zaman */
    --fs-sm: 13px;     /* normal metin, kart değerleri */
    --fs-input: 14px;  /* input ve ana buton */
    --fs-title: 16px;  /* form başlığı */
    --fs-domain: 20px; /* sorgulanan alan adı */
    --fs-days: 17px;   /* kalan gün */

    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;

    --radius: 12px;
    --radius-sm: 10px;
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.04);

    --container: 1280px;
    --gutter: 24px;
    --sidebar: 340px;
}

/* ---------- Temel ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, dl, dd, pre {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code,
.mono {
    font-family: var(--font-mono);
    font-size: 0.95em;
}

.num {
    font-variant-numeric: tabular-nums;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--sp-4);
    top: -60px;
    z-index: 100;
    padding: var(--sp-2) var(--sp-4);
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.skip-link:focus {
    top: var(--sp-3);
}

.muted {
    color: var(--text-subtle);
}

.is-empty {
    color: var(--text-subtle);
    font-weight: 400;
}

.warn-text {
    color: var(--st-failed-fg);
    font-weight: 500;
}

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 44px; /* küçük yazıya rağmen dokunma alanı korunur */
    padding: 0 var(--sp-4);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--fs-input);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:disabled {
    cursor: progress;
    opacity: 0.7;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--text-subtle);
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--header-fallback);
    border-bottom: 1px solid var(--border);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
        background: var(--header-bg);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    min-height: 54px;
}

.header-logos {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
}

.logo-link {
    display: block;
    border-radius: 4px;
}

.logo {
    width: auto;
}

/* Optik denge: İdeal logosunun ince alt satırı nedeniyle biraz daha yüksek */
.logo-ajansay {
    height: 24px;
}

.logo-ideal {
    height: 27px;
}

.logo-divider {
    width: 1px;
    height: 20px;
    background: var(--border-strong);
}

.query-counter {
    flex: none;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.query-counter strong {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Çalışma alanı ---------- */
.workspace {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: var(--sp-5);
    align-items: start;
    padding-top: var(--sp-5);
    padding-bottom: var(--sp-5);
}

.panel {
    min-width: 0;
    padding: var(--sp-5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Sol panel: yarı şeffaf; opacity verilmez, yalnızca zemin şeffaftır */
.query-panel {
    background: var(--glass-fallback);
    box-shadow: var(--shadow-soft);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .query-panel {
        background: var(--glass);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}

/* Sonuç paneli: cam efekti yok, okunabilirlik öncelikli */
.result-panel {
    background: var(--surface-soft);
}

.panel-title {
    font-size: var(--fs-title);
    font-weight: 600;
    line-height: 1.4;
}

/* ---------- Sorgu paneli ---------- */
.search-form {
    margin-top: var(--sp-3);
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-sm);
    font-weight: 500;
}

.input-group {
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface); /* yarı şeffaf panelden belirgin */
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.input-group.has-error {
    border-color: var(--danger);
}

.input-group.has-error:focus-within {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18);
}

.domain-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 var(--sp-3);
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: var(--fs-input);
    color: var(--text);
    outline: none;
}

.domain-input::placeholder {
    color: #687789;
}

.tld-select {
    flex: none;
    height: 30px;
    margin-right: 6px;
    padding: 0 24px 0 var(--sp-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 6px center / 12px;
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.tld-select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.field-help {
    margin-top: var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}

.field-error {
    margin-top: var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--danger);
}

.btn-search {
    width: 100%;
    margin-top: var(--sp-3);
}

.btn-spinner {
    display: none;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-search.is-loading .btn-spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Sonuç: durumlar ---------- */
.empty-state {
    color: var(--text-muted);
}

.loading-head {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.loading-head strong {
    color: var(--text);
    font-weight: 600;
}

.spinner {
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-soft);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sk {
    display: block;
    height: 10px;
    border-radius: 4px;
    background: #e5eaf0;
}

.sk-title {
    width: 55%;
    height: 12px;
    margin-bottom: 2px;
}

.sk-short {
    width: 40%;
}

/* ---------- Sonuç başlığı ---------- */
.result-head {
    min-width: 0;
}

.result-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px var(--sp-3);
}

.result-domain {
    min-width: 0;
    font-size: var(--fs-domain);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #263345;
    overflow-wrap: anywhere;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-badge i {
    font-size: 10px;
}

.status-registered {
    color: var(--st-registered-fg);
    background: var(--st-registered-bg);
}

.status-notfound {
    color: var(--st-notfound-fg);
    background: var(--st-notfound-bg);
}

.status-failed {
    color: var(--st-failed-fg);
    background: var(--st-failed-bg);
}

/* Diğer uzantılar: başlıktaki kompakt etiketler */
.alt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.alt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    max-width: 100%;
    padding: 2px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.alt-chip:hover {
    border-color: var(--border-strong);
}

.alt-chip:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.alt-chip.is-pending .alt-chip-state {
    color: var(--text-subtle);
}

.alt-chip.is-registered {
    background: var(--st-registered-bg);
    color: var(--st-registered-fg);
}

.alt-chip.is-notfound {
    background: var(--st-notfound-bg);
    color: var(--st-notfound-fg);
}

.alt-chip.is-failed {
    background: var(--st-failed-bg);
    color: var(--st-failed-fg);
}

.result-meta {
    margin-top: 2px;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    overflow-wrap: anywhere;
}

.result-meta .sep {
    margin: 0 6px;
}

/* ---------- Üç özet kartı ---------- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start; /* uzun NS listesi diğer kartları uzatmasın */
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}

.summary-card {
    min-width: 0;
    padding: var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.card-title {
    margin-bottom: 10px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
}

.card-value {
    font-size: var(--fs-sm);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.card-value + .kv-list {
    margin-top: 6px;
}

.ns-list li {
    padding: 1px 0;
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.ns-list + .link-button {
    margin-top: 2px;
}

/* ---------- Bilgi satırları ---------- */
.kv-list {
    font-size: var(--fs-sm);
}

.kv-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: var(--sp-4);
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}

.kv-row:last-child {
    border-bottom: 0;
}

.kv-row dt {
    font-size: var(--fs-xs);
    line-height: 1.65;
    color: var(--text-subtle);
}

.kv-row dd {
    overflow-wrap: anywhere;
}

/* Kart içi: etiket solda, değer sağda */
.kv-compact .kv-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    padding: 5px 0;
}

.kv-compact .kv-row:first-child {
    padding-top: 0;
}

.kv-compact .kv-row dd {
    text-align: right;
    font-weight: 500;
    /* Yalnızca sığmadığında böl; "wordpress.co / m" gibi gereksiz kırılmaları önler */
    overflow-wrap: break-word;
}

.kv-compact .kv-row dd a {
    word-break: break-word;
}

.remaining-days {
    font-size: var(--fs-days);
    font-weight: 600;
    color: #263345;
}

/* ---------- Alt bölümler ---------- */
.result-section {
    margin-top: var(--sp-4);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border);
}

.section-title {
    margin-bottom: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.section-note {
    margin-top: -4px;
    margin-bottom: 6px;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}

.code-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.code-list code {
    display: inline-block;
    max-width: 100%;
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--surface-muted);
    font-size: var(--fs-xs);
    overflow-wrap: anywhere;
}

.notice {
    display: flex;
    gap: 10px;
    margin-top: var(--sp-3);
    padding: var(--sp-3) 14px;
    border-radius: var(--radius-sm);
}

.notice > i {
    margin-top: 3px;
    font-size: 12px;
}

.notice p + p {
    margin-top: var(--sp-1);
}

.notice-info {
    background: var(--surface-muted);
}

.notice-info > i {
    color: var(--accent);
}

.notice-warn {
    background: var(--st-failed-bg);
    color: #5c3208;
}

.notice-warn > i {
    color: var(--st-failed-fg);
}

.notice-sub {
    font-size: var(--fs-xs);
    color: #7a4a14;
}

.btn-retry {
    margin-top: var(--sp-3);
}

.registrar-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--sp-4);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.registrar-item:last-child {
    border-bottom: 0;
}

.raw-section {
    padding-top: var(--sp-2);
}

.raw-toggle i {
    font-size: 10px;
    transition: transform 0.15s;
}

.raw-toggle[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.raw-data {
    margin-top: var(--sp-2);
    max-height: 360px;
    overflow: auto;
    padding: var(--sp-3) 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-3);
    }
}

@media (max-width: 760px) {
    :root {
        --gutter: 16px;
    }

    /* Dar ekranda etiketler başlığın hemen altına geçer */
    .alt-chips {
        flex-basis: 100%;
    }

    /* Odaklanınca otomatik yakınlaşmayı önler */
    .domain-input {
        font-size: 16px;
    }

    .header-inner {
        min-height: 50px;
    }

    .logo-ajansay {
        height: 21px;
    }

    .logo-ideal {
        height: 24px;
    }

    .logo-divider {
        height: 18px;
    }

    .workspace {
        padding-top: var(--sp-3);
        padding-bottom: var(--sp-3);
    }

    .panel {
        padding: var(--sp-4);
    }

    .summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kv-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .kv-compact .kv-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: var(--sp-4);
    }

    .registrar-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .registrar-item a {
        grid-column: 1 / -1;
        margin-top: -4px;
    }
}

@media (max-width: 370px) {
    .header-logos {
        gap: 10px;
    }

    .logo-ajansay {
        height: 19px;
    }

    .logo-ideal {
        height: 22px;
    }

    .query-counter {
        padding: 2px var(--sp-2);
    }
}

/* ---------- Hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .spinner,
    .btn-spinner {
        border-top-color: currentColor;
        opacity: 0.6;
    }
}
