/*
 * RD Sticky SEO Score Panel
 * Sağ kenarda sabitlenmiş, daraltılabilir panel.
 */

.rd-seo-score {
    position: fixed;
    top: 88px;
    right: 18px;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 110px);
    z-index: 35; /* Filament topbar (40) altında, modal (50)'in üstünde değil */
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 14px 32px -10px rgba(15, 23, 42, .18), 0 4px 10px -2px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, opacity .2s;
}

.dark .rd-seo-score {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}

/* Daraltılmış: küçük rozet kalır */
.rd-seo-score.is-collapsed {
    width: 64px;
    height: 64px;
    max-height: 64px;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    overflow: visible;
}

.rd-seo-score.is-collapsed .rd-seo-score__body { display: none; }
.rd-seo-score.is-collapsed .rd-seo-score__toggle {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-weight: 800;
    cursor: pointer;
    flex-direction: column;
    line-height: 1;
    box-shadow: 0 8px 24px -6px rgba(14, 165, 233, .55);
}

.rd-seo-score.is-collapsed[data-level="warn"] .rd-seo-score__toggle {
    background: linear-gradient(135deg, #fb923c, #f97316);
    box-shadow: 0 8px 24px -6px rgba(249, 115, 22, .55);
}

.rd-seo-score.is-collapsed[data-level="danger"] .rd-seo-score__toggle {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 8px 24px -6px rgba(239, 68, 68, .55);
}

.rd-seo-score.is-collapsed[data-level="good"] .rd-seo-score__toggle {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 8px 24px -6px rgba(34, 197, 94, .55);
}

.rd-seo-score__mini-ring { font-size: 1.05rem; font-weight: 900; }
.rd-seo-score__mini-label { font-size: .55rem; letter-spacing: .14em; opacity: .9; margin-top: 2px; }

/* Açık panel — toggle gizli */
.rd-seo-score:not(.is-collapsed) .rd-seo-score__toggle { display: none; }

.rd-seo-score__body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.rd-seo-score__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 14px 14px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.dark .rd-seo-score__header { border-color: #1f2937; }

.rd-seo-score__ring-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
}

.rd-seo-score__ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.rd-seo-score__ring-bg {
    fill: none; stroke: #e5e7eb; stroke-width: 6;
}
.dark .rd-seo-score__ring-bg { stroke: #1f2937; }
.rd-seo-score__ring-fg {
    fill: none; stroke: #38bdf8; stroke-width: 6; stroke-linecap: round;
    stroke-dasharray: 176; stroke-dashoffset: 176;
    transition: stroke-dashoffset .55s ease, stroke .25s ease;
}
.rd-seo-score[data-level="danger"] .rd-seo-score__ring-fg { stroke: #ef4444; }
.rd-seo-score[data-level="warn"]   .rd-seo-score__ring-fg { stroke: #f97316; }
.rd-seo-score[data-level="good"]   .rd-seo-score__ring-fg { stroke: #22c55e; }

.rd-seo-score__ring-text {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1;
}
.rd-seo-score__ring-num { font-size: 1.25rem; font-weight: 900; color: #0f172a; }
.dark .rd-seo-score__ring-num { color: #f8fafc; }
.rd-seo-score__ring-sub { font-size: .62rem; color: #94a3b8; margin-top: 2px; }

.rd-seo-score__heading { flex: 1; min-width: 0; }
.rd-seo-score__title { font-size: .9rem; font-weight: 700; color: #0f172a; }
.dark .rd-seo-score__title { color: #f1f5f9; }
.rd-seo-score__level {
    font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 2px 8px; display: inline-block; border-radius: 999px; margin-top: 4px;
    background: #f1f5f9; color: #475569;
}
.rd-seo-score[data-level="good"]   .rd-seo-score__level { background:#dcfce7; color:#166534; }
.rd-seo-score[data-level="warn"]   .rd-seo-score__level { background:#ffedd5; color:#9a3412; }
.rd-seo-score[data-level="danger"] .rd-seo-score__level { background:#fee2e2; color:#991b1b; }

.rd-seo-score__close {
    background: transparent; border: none; cursor: pointer;
    width: 28px; height: 28px; border-radius: 8px; color: #94a3b8;
    font-size: 1.2rem; line-height: 1;
}
.rd-seo-score__close:hover { background: #f1f5f9; color: #0f172a; }
.dark .rd-seo-score__close:hover { background: #1e293b; color: #f1f5f9; }

/* Dil dropdown ve dil skorları */
.rd-seo-score__locale {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: 10px 14px; border-bottom: 1px solid #f1f5f9;
}
.dark .rd-seo-score__locale { border-color: #1f2937; }

.rd-seo-score__locale-label { font-size: .68rem; color: #64748b; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rd-seo-score__locale-select {
    flex: 1; min-width: 100px;
    padding: 5px 8px; font-size: .8rem;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    color: inherit; font-family: inherit;
}
.dark .rd-seo-score__locale-select { background: #0b1220; border-color: #1f2937; }

.rd-seo-score__locale-scores { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.rd-seo-score__locale-pill {
    font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
    background: #f1f5f9; color: #475569;
}
.rd-seo-score__locale-pill[data-level="good"]   { background:#dcfce7; color:#166534; }
.rd-seo-score__locale-pill[data-level="warn"]   { background:#ffedd5; color:#9a3412; }
.rd-seo-score__locale-pill[data-level="danger"] { background:#fee2e2; color:#991b1b; }

/* Özet chip'ler */
.rd-seo-score__summary { display: flex; flex-wrap: wrap; gap: .35rem; padding: 10px 14px 6px; }
.rd-seo-score__chip {
    font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
    background: #f1f5f9; color: #475569; display: inline-flex; align-items: center; gap: 3px;
}
.rd-seo-score__chip--pass { background:#dcfce7; color:#166534; }
.rd-seo-score__chip--warn { background:#fef3c7; color:#92400e; }
.rd-seo-score__chip--fail { background:#fee2e2; color:#991b1b; }

/* Filtre butonları */
.rd-seo-score__filter { display: flex; padding: 0 14px 8px; gap: 4px; }
.rd-seo-score__filter button {
    flex: 1; font-size: .72rem; font-weight: 600;
    padding: 5px 8px; border-radius: 8px; cursor: pointer;
    background: #f1f5f9; border: 1px solid transparent; color: #475569;
    transition: background .15s;
}
.dark .rd-seo-score__filter button { background: #0b1220; color: #cbd5e1; }
.rd-seo-score__filter button.is-active {
    background: #0ea5e9; color: #fff;
}

/* Kategoriler */
.rd-seo-score__categories {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    padding: 0 14px 6px;
}
.rd-seo-score__category { margin-bottom: 8px; border-bottom: 1px dashed #e5e7eb; padding-bottom: 6px; }
.dark .rd-seo-score__category { border-color: #1e293b; }

.rd-seo-score__cat-head {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px;
    width: 100%; padding: 6px 0; cursor: pointer;
    background: transparent; border: 0; color: inherit; font-family: inherit; text-align: left;
}
.rd-seo-score__cat-label { font-weight: 700; font-size: .82rem; }
.rd-seo-score__cat-score { font-weight: 700; font-size: .75rem; color: #64748b; }
.rd-seo-score__cat-bar {
    grid-column: 1 / -1;
    height: 5px; background: #f1f5f9; border-radius: 999px; overflow: hidden;
}
.dark .rd-seo-score__cat-bar { background: #1e293b; }
.rd-seo-score__cat-bar-fill {
    display: block; height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    transition: width .4s ease;
}

.rd-seo-score__category.is-open .rd-seo-score__items { display: block; }
.rd-seo-score__items { display: none; list-style: none; padding: 0; margin: 6px 0 0; }

.rd-seo-score__item {
    display: grid; grid-template-columns: 18px 1fr; gap: 8px;
    padding: 6px 6px; margin: 0 -6px;
    border-radius: 8px;
    cursor: default;
}
.rd-seo-score__item[data-field] { cursor: pointer; }
.rd-seo-score__item[data-field]:hover { background: #f8fafc; }
.dark .rd-seo-score__item[data-field]:hover { background: #0b1220; }

.rd-seo-score__item-icon {
    width: 18px; height: 18px; flex: 0 0 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 900;
    color: #fff;
}
.rd-seo-score__item--pass .rd-seo-score__item-icon { background: #22c55e; }
.rd-seo-score__item--warn .rd-seo-score__item-icon { background: #f97316; }
.rd-seo-score__item--fail .rd-seo-score__item-icon { background: #ef4444; }

.rd-seo-score__item-label { font-size: .8rem; font-weight: 600; line-height: 1.35; color: #0f172a; }
.dark .rd-seo-score__item-label { color: #e2e8f0; }
.rd-seo-score__item-hint  { font-size: .72rem; color: #64748b; line-height: 1.4; margin-top: 2px; }

/* Footer */
.rd-seo-score__footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: .7rem; color: #94a3b8;
}
.dark .rd-seo-score__footer { border-color: #1f2937; }
.rd-seo-score__pulse {
    background: #f1f5f9; color: #475569; padding: 2px 7px; border-radius: 999px; font-weight: 600;
}
.dark .rd-seo-score__pulse { background: #0b1220; color: #cbd5e1; }

/* Flash highlight (eksik alana tıklayınca) */
.rd-seo-flash {
    animation: rd-seo-flash 1.4s ease;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .35);
    border-radius: 12px;
}
@keyframes rd-seo-flash {
    0%   { background-color: rgba(14, 165, 233, .12); }
    100% { background-color: transparent; }
}

/* Mobile */
@media (max-width: 1280px) {
    .rd-seo-score { width: 300px; }
}
@media (max-width: 1024px) {
    .rd-seo-score {
        top: auto; right: 12px; bottom: 12px; width: 56px; height: 56px;
        border-radius: 50%; max-height: 56px;
    }
    .rd-seo-score:not(.is-collapsed) {
        width: calc(100vw - 24px); height: auto; max-height: 70vh; top: auto; bottom: 12px; border-radius: 14px;
    }
    .rd-seo-score.is-collapsed { width: 56px; height: 56px; }
}
