/* css/radar.css  v5 — Two-column layout + slide-up ticker + compact cards */
/* All selectors scoped to .sa-radar-* — zero collision with other modules */

/* ── View wrapper ─────────────────────────────────────────────── */
.sa-radar-view { padding-bottom: 50px; }

/* ── Header card ──────────────────────────────────────────────── */
.sa-radar-header-card {
    background: #121421;
    border: 1px solid #1f2235;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.sa-radar-header-card h2 { margin-top: 0; margin-bottom: 6px; font-size: 1.25rem; color: #fff; }
.sa-radar-header-card .sa-subtitle { font-size: 0.85rem; }

/* ── Input group ──────────────────────────────────────────────── */
.sa-radar-input-group { margin-top: 20px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.sa-radar-input-group label { font-size: .75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.sa-radar-input-group input {
    background: #0a0b14; border: 1px solid #1f2235; border-radius: 8px;
    padding: 12px 16px; color: #fff; font-size: 1rem; outline: none;
    transition: all .3s ease; width: 100%; box-sizing: border-box;
}
.sa-radar-input-group input:focus { border-color: #8b5cf6; box-shadow: 0 0 10px rgba(139,92,246,.2); }

/* ── Action row ───────────────────────────────────────────────── */
.sa-radar-action-row { display: flex; justify-content: flex-start; }

/* ── Loader shell ─────────────────────────────────────────────── */
#sa-radar-loader {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 20px; background: #121421; border: 1px solid #1f2235;
    border-radius: 12px; margin-bottom: 24px; text-align: center;
    gap: 0;
}

/* ── Radar animation ──────────────────────────────────────────── */
.sa-radar-anim-wrap {
    position: relative; width: 140px; height: 140px; margin-bottom: 24px;
}
.sa-radar-circle {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%); border-radius: 50%;
}
.sa-radar-c1 { width:140px; height:140px; border:1px solid rgba(139,92,246,.45); }
.sa-radar-c2 { width:96px;  height:96px;  border:1px solid rgba(6,182,212,.35); }
.sa-radar-c3 { width:48px;  height:48px;  border:1px solid rgba(139,92,246,.30); }
.sa-radar-ch-h,.sa-radar-ch-v { position:absolute; top:50%; left:50%; background:rgba(6,182,212,.18); }
.sa-radar-ch-h { width:140px; height:1px; transform:translate(-50%,-50%); }
.sa-radar-ch-v { width:1px; height:140px; transform:translate(-50%,-50%); }
.sa-radar-sweep {
    position:absolute; top:0; left:0; width:140px; height:140px; border-radius:50%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, transparent 285deg,
        rgba(6,182,212,.08) 300deg, rgba(6,182,212,.20) 320deg,
        rgba(6,182,212,.55) 355deg, rgba(139,92,246,.70) 360deg);
    animation:saRadarSweep 2.4s linear infinite; transform-origin:50% 50%;
}
.sa-radar-sweep::after {
    content:''; position:absolute; top:50%; left:50%; width:6px; height:6px;
    background:#06b6d4; border-radius:50%; transform:translate(-50%,-50%);
    box-shadow:0 0 8px 2px rgba(6,182,212,.7);
}
@keyframes saRadarSweep { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
.sa-radar-dot { position:absolute; border-radius:50%; animation:saRadarPing 2.2s ease-in-out infinite; }
.sa-radar-d1 { width:7px;height:7px;top:20%;left:65%;background:#06b6d4;animation-delay:.4s; }
.sa-radar-d2 { width:5px;height:5px;top:62%;left:25%;background:#8b5cf6;animation-delay:1.2s; }
.sa-radar-d3 { width:5px;height:5px;top:35%;left:70%;background:#8b5cf6;animation-delay:.8s; }
@keyframes saRadarPing {
    0%,100%{opacity:.15;transform:scale(1);box-shadow:none}
    50%{opacity:1;transform:scale(2);box-shadow:0 0 8px 3px rgba(6,182,212,.55)}
}

/* ── Loader title (restored) ──────────────────────────────────── */
.sa-radar-loader-text {
    font-size: .95rem; margin: 0 0 10px 0; text-align: center;
    background: linear-gradient(90deg,#8b5cf6,#06b6d4);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-weight: 600; max-width: 380px;
}

/* ── Slide-up ticker ──────────────────────────────────────────── */
.sa-radar-ticker-wrap {
    height: 28px; overflow: hidden; display: flex; align-items: center;
    justify-content: center; margin-top: 4px;
}
.sa-radar-ticker-text {
    font-size: .88rem; color: #94a3b8; font-weight: 500;
    display: inline-block;
    /* JS handles transitions via inline style */
}

/* ── Results heading ──────────────────────────────────────────── */
.sa-radar-results-title {
    margin-bottom: 20px; color: #fff; font-size: 1.15rem; font-weight: 700;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    line-height: 1.3;
}
.sa-radar-scan-date {
    font-size: .72rem; font-weight: 400; color: #94a3b8; letter-spacing: .2px;
    display: inline-flex; align-items: center;
}

/* ── Two-column layout ────────────────────────────────────────── */
.sa-radar-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .sa-radar-two-col { grid-template-columns: 1fr; }
}

/* Column header */
.sa-radar-col-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

/* Platform badge (column header) */
.sa-radar-platform-badge {
    display: inline-flex; align-items: center;
    font-size: .72rem; font-weight: 700;
    padding: 5px 12px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .5px;
}
.sa-radar-badge-linkedin {
    background: rgba(10,102,194,.15); color: #5cabf1;
    border: 1px solid rgba(10,102,194,.35);
}
.sa-radar-badge-x {
    background: rgba(255,255,255,.08); color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.18);
}

/* ── Grid & Cards ─────────────────────────────────────────────── */
.sa-radar-grid { display: flex; flex-direction: column; gap: 8px; }

.sa-radar-opp-card {
    background: #121421; border: 1px solid #1f2235;
    border-radius: 10px; padding: 10px 14px;
    cursor: pointer; transition: all .22s ease; position: relative; overflow: hidden;
}
.sa-radar-opp-card::before {
    content:''; position:absolute; top:0; left:0;
    width:3px; height:100%;
    background:linear-gradient(to bottom,#8b5cf6,#06b6d4); opacity:.7;
}
.sa-radar-opp-card:hover {
    border-color: #8b5cf6; transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* Card top row: rank + platform */
.sa-radar-card-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.sa-radar-card-rank {
    font-size: .65rem; font-weight: 800; color: #4a5568; letter-spacing: .5px;
}
.sa-radar-card-platform {
    font-size: .65rem; font-weight: 700; color: #5a6480;
    text-transform: uppercase; letter-spacing: .4px;
}

.sa-radar-opp-title {
    font-size: .93rem; color: #fff; margin: 0 0 3px 0; font-weight: 600; line-height: 1.3;
}
/* Source label — small grey tag below the title */
.sa-radar-opp-source {
    font-size: .70rem; color: #94a3b8; margin: 0 0 5px 0;
    font-weight: 500; letter-spacing: .2px;
}
.sa-radar-opp-desc {
    font-size: .81rem; color: #5a6480; line-height: 1.5; margin: 0 0 8px 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sa-radar-opp-cta {
    font-size: .78rem; color: #8b5cf6; font-weight: 600;
    opacity: 0; transition: opacity .2s ease; display: block;
}
.sa-radar-opp-card:hover .sa-radar-opp-cta { opacity: 1; }

/* ── Generation Modal Backdrop ────────────────────────────────── */
.sa-radar-gen-backdrop {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(3,5,18,.78);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}

/* ── Generation Modal Card ────────────────────────────────────── */
.sa-radar-gen-modal {
    position: relative; width: 100%; max-width: 620px;
    max-height: 90vh; overflow-y: auto;
    background: #121421; border: 1px solid #2a2d45;
    border-radius: 16px; padding: 32px;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
    animation: saRadarModalIn .25s ease;
}
@keyframes saRadarModalIn {
    from{opacity:0;transform:scale(.95) translateY(10px)}
    to{opacity:1;transform:scale(1) translateY(0)}
}

/* Close — invisible but clickable */
.sa-radar-gen-close {
    position:absolute; top:16px; right:16px; background:transparent; border:none;
    border-radius:50%; width:32px; height:32px; color:transparent;
    cursor:pointer; opacity:0; pointer-events:auto;
}

/* Modal header */
.sa-radar-gen-header { margin-bottom: 20px; padding-right: 28px; }
.sa-radar-opp-sources {
    display: inline-block; font-size: .72rem; color: #06b6d4;
    background: rgba(6,182,212,.1); padding: 3px 8px; border-radius: 4px;
    font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: 8px;
}
.sa-radar-gen-opp-title { font-size: 1.2rem; color: #fff; margin: 0 0 6px; font-weight: 700; }
.sa-radar-gen-opp-desc  { font-size: .87rem; color: #5a6480; line-height: 1.5; margin: 0; }

/* Loading */
.sa-radar-gen-loading {
    display:flex; flex-direction:column; align-items:center;
    padding:30px 0; gap:16px;
}
.sa-radar-gen-loading-text { color:#94a3b8; font-size:.9rem; margin:0; }

/* Post display */
.sa-radar-gen-display {
    background:rgba(0,0,0,.25); border:1px solid #1f2235;
    border-radius:10px; padding:18px; color:#e2e8f0;
    font-size:.95rem; line-height:1.75; white-space:pre-wrap;
    min-height:140px; margin-bottom:20px;
}

/* Edit textarea */
.sa-radar-gen-edit {
    width:100%; box-sizing:border-box;
    background:rgba(0,0,0,.25); border:1px solid #8b5cf6;
    border-radius:10px; padding:18px; color:#e2e8f0;
    font-size:.95rem; line-height:1.75; resize:vertical;
    min-height:160px; margin-bottom:20px; outline:none; font-family:inherit;
}

/* Footer */
.sa-radar-gen-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sa-radar-gen-footer::-webkit-scrollbar { display: none; }
.sa-radar-gen-footer .sa-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.82rem;
}
/* keep the Send to Calendar gradient push to right */
.sa-radar-gen-footer .sa-radar-gen-btn-calendar { margin-left: auto; }

.sa-radar-gen-btn-calendar {
    background:linear-gradient(135deg,#8b5cf6,#06b6d4) !important;
    border:none !important;
}
.sa-radar-gen-btn-calendar:hover {
    opacity:.9; transform:translateY(-1px);
    box-shadow:0 4px 16px rgba(139,92,246,.4) !important;
}

/* ── Mobile: restore subtitle hidden by layout.css ─────────────── */
@media (max-width: 768px) {
    .sa-radar-header-card .sa-subtitle {
        display: block !important;
        font-size: 0.8rem;
    }
}
