/* ── Custom component styles for JS-rendered dynamic content ─────────────────
   All static layout uses Tailwind utility classes (in PHP/HTML).
   These classes are injected by app.js and need manual CSS definitions.
──────────────────────────────────────────────────────────────────────────── */

/* ── Logo SVG ──────────────────────────────────────────────────────────────── */
.logo-svg { display:block; }
.logo-svg .fil3 { fill:#1e293b; }           /* light mode: dark text */
.dark .logo-svg .fil3 { fill:#FEFEFE; }     /* dark mode: white text */

/* ── Monospace record display ──────────────────────────────────────────────── */
.record-box {
    font-family: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 0.72rem;
    word-break: break-all;
    line-height: 1.75;
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
    border-radius: 8px;
    padding: 10px 13px;
    color: rgb(71 85 105);
}
.dark .record-box {
    background: rgb(2 6 23);
    border-color: rgb(30 41 59);
    color: rgb(148 163 184);
}
.record-host {
    font-size: 0.68rem;
    color: rgb(148 163 184);
    margin-bottom: 4px;
    font-style: italic;
    font-family: ui-monospace, monospace;
}

/* ── Status pills ──────────────────────────────────────────────────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.pill-ok      { background: rgb(220 252 231); color: rgb(22 101 52);   border: 1px solid rgb(187 247 208); }
.pill-warning { background: rgb(254 243 199); color: rgb(146 64 14);   border: 1px solid rgb(253 230 138); }
.pill-error   { background: rgb(254 226 226); color: rgb(185 28 28);   border: 1px solid rgb(254 202 202); }
.pill-missing { background: rgb(241 245 249); color: rgb(100 116 139); border: 1px solid rgb(226 232 240); }
.dark .pill-ok      { background: rgba(34,197,94,.12);  color: rgb(134 239 172); border-color: rgba(34,197,94,.2); }
.dark .pill-warning { background: rgba(245,158,11,.12); color: rgb(252 211 77);  border-color: rgba(245,158,11,.2); }
.dark .pill-error   { background: rgba(239,68,68,.12);  color: rgb(252 165 165); border-color: rgba(239,68,68,.2); }
.dark .pill-missing { background: rgba(100,116,139,.1); color: rgb(148 163 184); border-color: rgba(100,116,139,.2); }

/* ── Card status border ─────────────────────────────────────────────────────── */
.card.status-ok      { border-top: 3px solid rgb(34 197 94); }
.card.status-warning { border-top: 3px solid rgb(245 158 11); }
.card.status-error   { border-top: 3px solid rgb(239 68 68); }
.card.status-missing { border-top: 3px solid rgb(148 163 184); }

/* ── Tags table ─────────────────────────────────────────────────────────────── */
.tags-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgb(148 163 184);
    margin-bottom: 6px;
}
.tags-list { display: flex; flex-direction: column; gap: 4px; }
.tag-row {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 8px;
    font-size: 0.74rem;
    padding: 5px 9px;
    border-radius: 7px;
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
}
.dark .tag-row { background: rgb(15 23 42); border-color: rgb(30 41 59); }
.tag-key  { font-family: ui-monospace, monospace; color: rgb(99 102 241); font-weight: 600; word-break: break-all; }
.dark .tag-key { color: rgb(129 140 248); }
.tag-desc { color: rgb(100 116 139); }
.dark .tag-desc { color: rgb(148 163 184); }

/* ── Issues / Info ─────────────────────────────────────────────────────────── */
.issues-list, .info-list { display: flex; flex-direction: column; gap: 5px; }

.issue-item, .info-item {
    display: flex; gap: 8px; font-size: 0.78rem;
    padding: 8px 12px; border-radius: 8px; line-height: 1.5;
}
.issue-item {
    background: rgb(254 226 226); border: 1px solid rgb(254 202 202); color: rgb(153 27 27);
}
.info-item  {
    background: rgb(239 246 255); border: 1px solid rgb(191 219 254); color: rgb(30 64 175);
}
.dark .issue-item { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.2); color: rgb(252 165 165); }
.dark .info-item  { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.2); color: rgb(147 197 253); }
.issue-icon, .info-icon { flex-shrink: 0; font-style: normal; margin-top: 1px; }

/* ── Card summary ──────────────────────────────────────────────────────────── */
.card-summary {
    font-size: 0.855rem;
    color: rgb(71 85 105);
    line-height: 1.6;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);
}
.dark .card-summary { color: rgb(148 163 184); border-color: rgb(30 41 59); background: rgb(15 23 42); }

/* ── Details toggle ────────────────────────────────────────────────────────── */
.details-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.74rem; font-weight: 600;
    color: rgb(100 116 139); background: none;
    border: 1px solid rgb(226 232 240);
    border-radius: 8px; padding: 6px 13px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    align-self: flex-start;
}
.details-toggle:hover { border-color: rgb(99 102 241); color: rgb(99 102 241); background: rgba(99,102,241,.05); }
.dark .details-toggle { border-color: rgb(30 41 59); color: rgb(100 116 139); }
.dark .details-toggle:hover { border-color: rgb(99 102 241); color: rgb(129 140 248); }

.details-block { display: flex; flex-direction: column; gap: 10px; }

/* ── DKIM selector ─────────────────────────────────────────────────────────── */
.dkim-selector-block { border: 1px solid rgb(226 232 240); border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.dark .dkim-selector-block { border-color: rgb(30 41 59); }
.dkim-selector-header {
    background: rgb(248 250 252); padding: 7px 13px;
    font-size: 0.7rem; font-weight: 700; color: rgb(99 102 241);
    letter-spacing: 0.4px;
}
.dark .dkim-selector-header { background: rgb(15 23 42); color: rgb(129 140 248); }

/* ── Suggestion box ────────────────────────────────────────────────────────── */
.suggestion-box {
    border: 1px solid rgb(187 247 208);
    border-radius: 10px;
    background: rgb(240 253 244);
    overflow: hidden;
}
.dark .suggestion-box { border-color: rgba(34,197,94,.2); background: rgba(34,197,94,.06); }

.suggestion-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 14px;
    background: rgba(34,197,94,.07);
    border-bottom: 1px solid rgb(187 247 208);
}
.dark .suggestion-header { border-bottom-color: rgba(34,197,94,.2); }

.suggestion-title {
    font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.7px;
    color: rgb(22 101 52);
    display: flex; align-items: center; gap: 5px;
}
.dark .suggestion-title { color: rgb(134 239 172); }

.btn-suggestion-copy {
    background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3);
    border-radius: 99px; padding: 3px 12px;
    font-size: 0.7rem; font-weight: 700; color: rgb(22 101 52);
    cursor: pointer; transition: background 0.15s;
    display: flex; align-items: center; gap: 4px;
}
.dark .btn-suggestion-copy { color: rgb(134 239 172); }
.btn-suggestion-copy:hover { background: rgba(34,197,94,.2); }
.btn-suggestion-copy.copied { opacity: 0.6; }

.suggestion-value {
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 0.74rem; color: rgb(30 41 59);
    word-break: break-all; line-height: 1.7;
    padding: 10px 14px; user-select: all;
}
.dark .suggestion-value { color: rgb(226 232 240); }
.suggestion-note { font-size: 0.74rem; color: rgb(100 116 139); padding: 0 14px 10px; line-height: 1.5; }

.suggestion-originals { padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.suggestion-orig-label {
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.6px; color: rgb(148 163 184); margin-bottom: 3px;
}
.suggestion-orig-item {
    font-family: ui-monospace, monospace; font-size: 0.7rem;
    color: rgb(153 27 27); background: rgb(254 226 226);
    border: 1px solid rgb(254 202 202);
    border-radius: 6px; padding: 4px 9px;
    word-break: break-all; line-height: 1.6;
    display: flex; align-items: flex-start; gap: 6px;
}
.dark .suggestion-orig-item { color: rgb(252 165 165); background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.2); }
.suggestion-orig-item::before { content: '✖'; font-size: 0.68rem; opacity: 0.6; flex-shrink: 0; margin-top: 2px; }

/* ── Score bar ─────────────────────────────────────────────────────────────── */
.score-bar-fill { transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }

/* ── Loading spinner ───────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.75s linear infinite; }

/* ── Fade-up animation (used by Motion One as starting state) ─────────────── */
.motion-hidden { opacity: 0; transform: translateY(16px); }

/* ── Hero animated gradient background ────────────────────────────────────── */
@keyframes hero-drift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Light mode gradient: soft blue → violet → indigo → sky */
.hero-bg {
    background-image: linear-gradient(
        135deg,
        #dbeafe 0%,
        #ede9fe 22%,
        #e0f2fe 44%,
        #c7d2fe 66%,
        #dbeafe 88%,
        #ede9fe 100%
    );
    background-size: 400% 400%;
    animation: hero-drift 16s ease infinite;
}

/* Dark mode gradient: midnight navy → deep indigo → navy blue */
.dark .hero-bg {
    background-image: linear-gradient(
        135deg,
        #080e1e 0%,
        #1e1b4b 22%,
        #0a1628 44%,
        #172554 66%,
        #1e1b4b 88%,
        #080e1e 100%
    );
    background-size: 400% 400%;
}

/* Bottom fade: dissolves hero into page background over bottom half of search card */
/* Light */
.hero-fade-bottom {
    background: linear-gradient(to bottom, transparent 0%, rgb(248 250 252) 100%);
}
/* Dark */
.dark .hero-fade-bottom {
    background: linear-gradient(to bottom, transparent 0%, rgb(2 6 23) 100%);
}
