/* ═══════════════════════════════════════
   Email Relay — Warm Minimalism Design System
   ═══════════════════════════════════════ */

:root {
    --relay-bg: #FAFAF8;
    --relay-bg-soft: #F5F3EF;
    --relay-surface: #FFFFFF;
    --relay-surface-strong: #FFFFFF;
    --relay-surface-muted: #FAFAF8;
    --relay-text: #1A1A1A;
    --relay-text-soft: #6B6B6B;
    --relay-border: #E8E5E0;
    --relay-border-strong: #D5D0CA;
    --relay-accent: #5B8C6E;
    --relay-accent-strong: #4A7A5D;
    --relay-accent-2: #8FC4A0;
    --relay-accent-2-strong: #7AB890;
    --relay-accent-contrast: #FFFFFF;
    --relay-highlight: #4A7A5D;
    --relay-ok: #5B8C6E;
    --relay-error: #DC2626;
    --relay-shadow: 0 4px 24px rgba(26, 26, 26, 0.08);
    --relay-shadow-soft: 0 2px 12px rgba(26, 26, 26, 0.05);
    --relay-shadow-hover: 0 8px 32px rgba(26, 26, 26, 0.12);
    --relay-header-bg: rgba(250, 250, 248, 0.90);
    --relay-header-bg-scrolled: rgba(250, 250, 248, 0.97);
    --relay-header-border: #E8E5E0;
}

.dark {
    --relay-bg: #111110;
    --relay-bg-soft: #161614;
    --relay-surface: #1C1C1A;
    --relay-surface-strong: #222220;
    --relay-surface-muted: #1A1A18;
    --relay-text: #E8E8E6;
    --relay-text-soft: #9B9B96;
    --relay-border: #2E2E2C;
    --relay-border-strong: #3A3A38;
    --relay-accent: #8FC4A0;
    --relay-accent-strong: #7AB890;
    --relay-accent-2: #5B8C6E;
    --relay-accent-2-strong: #4A7A5D;
    --relay-accent-contrast: #111110;
    --relay-highlight: #7AB890;
    --relay-ok: #8FC4A0;
    --relay-error: #F87171;
    --relay-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --relay-shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.28);
    --relay-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
    --relay-header-bg: rgba(17, 17, 16, 0.90);
    --relay-header-bg-scrolled: rgba(17, 17, 16, 0.97);
    --relay-header-border: #2E2E2C;
}

/* ── Base ── */
body.relay-body {
    color: var(--relay-text);
    background-color: var(--relay-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navigation ── */
.relay-header {
    background: var(--relay-header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    position: sticky;
    top: 0;
    z-index: 50;
}

.relay-header.header-scrolled {
    background: var(--relay-header-bg-scrolled);
    border-bottom-color: var(--relay-header-border);
    box-shadow: var(--relay-shadow-soft);
}

/* ── Cards & Panels ── */
.relay-panel {
    background: var(--relay-surface);
    border: 1px solid var(--relay-border);
    box-shadow: var(--relay-shadow-soft);
}

.relay-card,
.relay-modal {
    background: var(--relay-surface);
    border: 1px solid var(--relay-border);
    box-shadow: var(--relay-shadow-soft);
}

.relay-card {
    border-radius: 14px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.relay-card:hover {
    box-shadow: var(--relay-shadow-hover);
    transform: translateY(-1px);
}

.relay-card-header {
    background: var(--relay-surface-muted);
    border-bottom: 1px solid var(--relay-border);
}

.relay-card-footer {
    background: var(--relay-surface-muted);
    border-top: 1px solid var(--relay-border);
}

/* ── Inputs ── */
.relay-input,
.relay-select {
    background: var(--relay-surface);
    color: var(--relay-text);
    border: 1px solid var(--relay-border);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.relay-input::placeholder { color: var(--relay-text-soft); }
.dark .relay-input::placeholder { color: var(--relay-text-soft); }

.relay-input:focus,
.relay-select:focus {
    border-color: var(--relay-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 140, 110, 0.15);
}

.dark .relay-input:focus,
.dark .relay-select:focus {
    box-shadow: 0 0 0 3px rgba(143, 196, 160, 0.15);
}

/* ── Buttons ── */
.relay-btn {
    background: var(--relay-accent);
    color: var(--relay-accent-contrast);
    border: 1px solid var(--relay-accent-strong);
    border-radius: 8px;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.relay-btn:hover {
    background: var(--relay-accent-strong);
    transform: translateY(-1px);
    box-shadow: var(--relay-shadow-soft);
}

.relay-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 140, 110, 0.3);
}

.relay-btn-soft {
    background: var(--relay-surface);
    color: var(--relay-text-soft);
    border: 1px solid var(--relay-border);
    border-radius: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.relay-btn-soft:hover {
    background: var(--relay-surface-muted);
    color: var(--relay-text);
    border-color: var(--relay-border-strong);
}

/* Accent button (pill variant for settings, create modals) */
.relay-btn-accent {
    background: var(--relay-accent);
    color: var(--relay-accent-contrast);
    border: none;
    border-radius: 9999px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.relay-btn-accent:hover {
    background: var(--relay-accent-strong);
    transform: translateY(-1px);
}

/* ── List Items ── */
.relay-list-item {
    background: var(--relay-surface-muted);
    border: 1px solid var(--relay-border);
    border-radius: 6px;
    color: var(--relay-text);
    transition: background-color 0.1s ease, border-color 0.1s ease;
}

.relay-list-item:hover {
    background: var(--relay-surface);
    border-color: var(--relay-border-strong);
}

/* ── Chips / Badges ── */
.relay-chip {
    background: var(--relay-surface-muted);
    border: 1px solid var(--relay-border);
    color: var(--relay-text-soft);
    border-radius: 6px;
}

/* ── Status Dots ── */
.relay-status-dot {
    box-shadow: 0 0 0 2px rgba(91, 140, 110, 0.2), 0 0 8px rgba(91, 140, 110, 0.4);
}

.dark .relay-status-dot {
    box-shadow: 0 0 0 2px rgba(143, 196, 160, 0.2), 0 0 8px rgba(143, 196, 160, 0.4);
}

/* ── Link hover effect (underline slides in from left) ── */
.relay-link {
    color: var(--relay-accent);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.relay-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--relay-accent);
    transition: width 0.2s ease;
}

.relay-link:hover { color: var(--relay-accent-strong); }
.relay-link:hover::after { width: 100%; }

/* ── Utility Classes ── */
.relay-cursor-accent { cursor: pointer; }

/* ── CTA / Section Bands ── */
.relay-cta-band {
    background: var(--relay-bg-soft);
    border-top: 1px solid var(--relay-border);
    border-bottom: 1px solid var(--relay-border);
}

/* ── Footer ── */
.relay-footer {
    background: var(--relay-bg-soft);
    border-top: 1px solid var(--relay-border);
    margin-top: auto;
}

/* ── Page-load fade-up animations ── */
@keyframes relay-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);     }
}

.relay-animate {
    opacity: 0;
}

.relay-animate.is-visible {
    animation: relay-fade-up 0.4s ease-out forwards;
}

/* ── Dashboard Group Cards ── */
.group-card .text-gray-700,
.dark .group-card .dark\:text-gray-300 {
    color: var(--relay-text);
}

.group-card .text-gray-500,
.dark .group-card .dark\:text-gray-400 {
    color: var(--relay-text-soft);
}

/* ── Expanded card section ── */
.card-expanded {
    border-top: 1px solid var(--relay-border);
}

/* ── Settings adaptive utilities ── */
.stg-text     { color: var(--relay-text); }
.stg-text-sub { color: var(--relay-text-soft); }
.stg-text-dim { color: var(--relay-text-soft); }
.stg-label    { color: var(--relay-text-soft); }

.stg-input {
    background: var(--relay-surface);
    border: 1px solid var(--relay-border);
    color: var(--relay-text);
    border-radius: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dark .stg-input { background: var(--relay-surface-strong); }
.stg-input::placeholder { color: var(--relay-text-soft); }
.stg-input:focus {
    border-color: var(--relay-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 140, 110, 0.15);
}
.dark .stg-input:focus { box-shadow: 0 0 0 3px rgba(143, 196, 160, 0.15); }

.stg-card    { display: block; background: var(--relay-surface); border: 1px solid var(--relay-border); }
.stg-editor  { background: var(--relay-surface-muted); border-top: 1px solid var(--relay-border); }
.stg-preview { background: var(--relay-surface-muted); border: 1px solid var(--relay-border); color: var(--relay-text); font-family: monospace; }
.stg-meta    { background: var(--relay-surface-muted); border: 1px solid var(--relay-border); color: var(--relay-text-soft); }

.stg-pill       { border: 1px solid var(--relay-border); color: var(--relay-text-soft); background: var(--relay-surface-muted); }
.dark .stg-pill { border-color: var(--relay-border); color: var(--relay-text-soft); }

.stg-divider       { border-color: var(--relay-border); }
.dark .stg-divider { border-color: var(--relay-border); }

.stg-table {
    background: var(--relay-surface);
    border: 1px solid var(--relay-border);
    box-shadow: var(--relay-shadow-soft);
}
.dark .stg-table {
    background: var(--relay-surface);
    border-color: var(--relay-border);
    box-shadow: var(--relay-shadow-soft);
}

.stg-table-header       { background: var(--relay-surface-muted); border-bottom: 1px solid var(--relay-border); color: var(--relay-text-soft); }
.dark .stg-table-header { background: var(--relay-surface-muted); border-bottom-color: var(--relay-border); color: var(--relay-text-soft); }

.stg-btn-ghost {
    border: 1px solid var(--relay-border);
    color: var(--relay-text-soft);
    background: transparent;
    border-radius: 9999px;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.stg-btn-ghost:hover       { color: var(--relay-text); border-color: var(--relay-border-strong); }
.dark .stg-btn-ghost       { border-color: var(--relay-border); color: var(--relay-text-soft); }
.dark .stg-btn-ghost:hover { color: var(--relay-text); border-color: var(--relay-border-strong); }

/* ── Blocklist info tooltip ── */
.blocklist-info-btn {
    background: var(--relay-accent);
    color: var(--relay-accent-contrast);
    opacity: 0.82;
    font-style: italic;
    font-family: Georgia, serif;
    box-shadow: 0 0 0 2px transparent;
    transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.blocklist-info-btn:hover,
.blocklist-info-btn[aria-expanded="true"] {
    opacity: 1;
    box-shadow: 0 0 0 2.5px var(--relay-accent-2);
    transform: scale(1.1);
}

.blocklist-info-tip {
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.18));
    /* position/size set by JS */
}
.blocklist-info-tip > div {
    background: var(--relay-surface-strong);
    border: 1px solid var(--relay-border);
    color: var(--relay-text);
}
.dark .blocklist-info-tip > div {
    background: #1e1e1c;
    border-color: var(--relay-border-strong);
}

.blocklist-tip-arrow {
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--relay-border);
}
.dark .blocklist-tip-arrow {
    border-top-color: var(--relay-border-strong);
}

.blocklist-tip-label  { color: var(--relay-text-soft); }
.blocklist-tip-code   { color: var(--relay-accent); }
.blocklist-tip-desc   { color: var(--relay-text-soft); }
.blocklist-tip-note   { color: var(--relay-text-soft); }

/* ── Settings Page Tabs ── */
.settings-tabs-bar {
    display: flex;
    gap: 0.25rem;
    border-radius: 14px;
    border: 1px solid var(--relay-border);
    background: var(--relay-bg-soft);
    padding: 0.3rem;
}

.settings-tab {
    flex: 1;
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    transition: all 0.15s ease;
    cursor: pointer;
    color: var(--relay-text-soft);
    background: transparent;
    border: none;
    text-align: center;
}

.settings-tab.tab-active {
    background: var(--relay-surface);
    color: var(--relay-text);
    box-shadow: var(--relay-shadow-soft);
}

.settings-tab:not(.tab-active):hover {
    color: var(--relay-text);
}
