/**
 * securities/security.css
 * Unified Securities Hub — layout and component styles
 */

/* ====================================================================
   ROOT CONTAINER
   ==================================================================== */

#securities-root {
    padding: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ====================================================================
   LANDING STATE
   ==================================================================== */

.sec-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 32px;
    gap: 24px;
}

.sec-landing-hero {
    text-align: center;
    max-width: 560px;
}

.sec-landing-hero h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0 0 10px;
    line-height: 1.25;
}

.sec-landing-hero p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ====================================================================
   SEARCH
   ==================================================================== */

.sec-search-wrap {
    width: 100%;
    max-width: 580px;
    position: relative;
}

.sec-search-input-row {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.sec-search-input-row:focus-within {
    border-color: var(--color-electric-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.sec-search-icon {
    padding: 0 12px 0 14px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sec-search-input {
    flex: 1;
    padding: 11px 4px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text-primary);
}

.sec-search-input::placeholder {
    color: var(--color-text-muted);
}

.sec-search-clear {
    padding: 0 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.sec-search-clear:hover {
    color: var(--color-text-secondary);
}

/* Dropdown */
.sec-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}

[data-theme="dark"] .sec-search-dropdown {
    box-shadow: var(--shadow-lg);
}

.sec-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
}

.sec-search-result:last-child {
    border-bottom: none;
}

.sec-search-result:hover,
.sec-search-result.focused {
    background: var(--color-surface-hover);
}

.sec-result-ticker {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    min-width: 56px;
    font-family: 'DM Mono', monospace;
}

.sec-result-name {
    font-size: 13px;
    color: var(--color-text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sec-result-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.sec-result-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sec-result-badge.badge-scope {
    background: rgba(100,116,139,0.12);
    color: var(--color-text-muted);
    text-transform: capitalize;
}

.sec-result-badge.badge-13f {
    background: rgba(59,130,246,0.12);
    color: #3b82f6;
}

.sec-result-badge.badge-fund {
    background: rgba(34,197,94,0.12);
    color: #22c55e;
}

.sec-search-no-results,
.sec-search-loading {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ====================================================================
   TOP SECURITIES CHIPS (landing)
   ==================================================================== */

/* ====================================================================
   YAHOO TRENDING PILLS
   ==================================================================== */

.sec-yahoo-trending {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 1100px;
}

.sec-yahoo-trending-header {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.sec-yahoo-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    width: 100%;
}

.sec-yahoo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sec-yahoo-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.sec-yahoo-pills {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.sec-yahoo-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.5;
}

.sec-yahoo-pill:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-green-primary);
}

.sec-yahoo-pill-ticker {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.sec-yahoo-pill:hover .sec-yahoo-pill-ticker {
    color: var(--color-green-primary);
}

.sec-yahoo-pill-name {
    font-size: 11px;
    color: var(--color-text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====================================================================
   CHIPS (legacy / top-by-AUM fallback)
   ==================================================================== */

.sec-top-chips {
    width: 100%;
    max-width: 760px;
}

.sec-top-chips-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    text-align: center;
}

.sec-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.sec-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    font-size: 13px;
    font-family: inherit;
    color: var(--color-text-primary);
}

.sec-chip:hover {
    border-color: var(--color-electric-blue);
    background: var(--color-surface-hover);
}

.sec-chip-ticker {
    font-weight: 700;
    color: var(--color-electric-blue);
    font-size: 13px;
}

.sec-chip-name {
    color: var(--color-text-secondary);
    font-size: 12px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====================================================================
   TRENDING SECTION — COLUMNS
   ==================================================================== */

.sec-trending-wrap {
    width: 100%;
}

.sec-trending-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sec-trending-period {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.sec-trending-cols {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    align-items: start;
}

.sec-trending-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sec-trending-col-head {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding-bottom: 7px;
    margin-bottom: 3px;
    border-bottom: 2px solid var(--color-border);
}

.sec-trending-col.col-buyers .sec-trending-col-head,
.sec-trending-col.col-gainers .sec-trending-col-head {
    color: var(--color-frog-green);
    border-color: var(--color-frog-green);
}

.sec-trending-col.col-sellers .sec-trending-col-head,
.sec-trending-col.col-losers .sec-trending-col-head {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.sec-trending-item {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 5px 6px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s;
    min-width: 0;
}

.sec-trending-item:hover {
    background: var(--color-surface-hover);
}

.sec-ti-ticker {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-electric-blue);
    min-width: 38px;
    flex-shrink: 0;
    white-space: nowrap;
}

.sec-ti-name {
    flex: 1;
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sec-ti-stat {
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
}

.sec-ti-stat.positive { color: var(--color-frog-green); }
.sec-ti-stat.negative { color: var(--color-danger); }
.sec-ti-stat.neutral  { color: var(--color-text-muted); }

@media (max-width: 900px) {
    .sec-trending-cols {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .sec-trending-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ====================================================================
   TRENDING STATS BAR (detail view)
   ==================================================================== */

.sec-trend-bar {
    display: flex;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.sec-trend-bar-period {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    border-right: 1px solid var(--color-border);
    white-space: nowrap;
    flex-shrink: 0;
}

.sec-trend-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 10px 18px;
    border-right: 1px solid var(--color-border);
}

.sec-trend-stat:last-child {
    border-right: none;
}

.sec-trend-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.sec-trend-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sec-trend-delta {
    font-size: 11px;
    font-weight: 600;
}

.sec-trend-stat-value.positive,
.sec-trend-delta.positive { color: var(--color-frog-green); }
.sec-trend-stat-value.negative,
.sec-trend-delta.negative { color: var(--color-danger); }

/* ====================================================================
   DETAIL VIEW
   ==================================================================== */

.sec-detail-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Security header bar */
.sec-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sec-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--color-text-secondary);
    transition: border-color 0.12s, color 0.12s;
    flex-shrink: 0;
}

.sec-back-btn:hover {
    border-color: var(--color-electric-blue);
    color: var(--color-text-primary);
}

.sec-header-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sec-header-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-primary);
}

.sec-header-ticker {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-electric-blue);
    background: rgba(59,130,246,0.1);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.sec-header-scope {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.watchlist-star {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-text-muted);
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.watchlist-star:hover {
    color: #f59e0b;
    transform: scale(1.15);
}

.watchlist-star.watchlisted {
    color: #f59e0b;
}

.watchlist-star.watchlisted:hover {
    color: #f59e0b;
}

/* Header search row */
.sec-header-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sec-header-search-row .sec-search-wrap {
    max-width: 380px;
}

/* ====================================================================
   TWO-COLUMN PANEL LAYOUT
   ==================================================================== */

.sec-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .sec-panels {
        grid-template-columns: 1fr;
    }
}

/* ====================================================================
   PANEL
   ==================================================================== */

.sec-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sec-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--color-border);
    gap: 10px;
}

.sec-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sec-panel-label-13f {
    color: #3b82f6;
}

.sec-panel-label-fund {
    color: #22c55e;
}

.sec-panel-date {
    font-size: 11px;
    color: var(--color-text-muted);
}

.sec-panel-body {
    flex: 1;
}

/* Stats row */
.sec-stats-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
}

.sec-stat-tile {
    flex: 1;
    padding: 12px 16px;
    border-right: 1px solid var(--color-border);
}

.sec-stat-tile:last-child {
    border-right: none;
}

.sec-stat-label {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.sec-stat-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Holder rows */
.sec-holder-table {
    width: 100%;
    border-collapse: collapse;
}

.sec-holder-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: left;
    padding: 8px 16px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.sec-holder-table th:last-child {
    text-align: right;
}

.sec-holder-table td {
    padding: 9px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.sec-holder-table tr:last-child td {
    border-bottom: none;
}

.sec-holder-table tr:hover td {
    background: var(--color-surface-hover);
}

.sec-holder-rank {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    width: 24px;
}

.sec-holder-name {
    color: var(--color-text-primary);
    font-weight: 500;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sec-holder-name a {
    color: inherit;
    text-decoration: none;
}

.sec-holder-name a:hover {
    color: var(--color-electric-blue);
    text-decoration: underline;
}

.sec-holder-value {
    color: var(--color-text-secondary);
    font-size: 13px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sec-holder-weight {
    color: var(--color-text-muted);
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sec-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}

/* Explore CTA */
.sec-explore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    border-top: 1px solid var(--color-border);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.sec-explore-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}

.sec-explore-btn.blue:hover {
    color: #3b82f6;
}

.sec-explore-btn.green:hover {
    color: #22c55e;
}

/* ====================================================================
   PANEL STATES
   ==================================================================== */

.sec-panel-loading,
.sec-panel-error,
.sec-panel-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 13px;
}

.sec-panel-error {
    color: #ef4444;
}

/* Upgrade prompt (fund panel for non-Pro) */
.sec-upgrade-prompt {
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.sec-upgrade-icon {
    width: 44px;
    height: 44px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-frog-green);
}

.sec-upgrade-prompt h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.sec-upgrade-prompt p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
    max-width: 260px;
}

.sec-upgrade-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--color-frog-green);
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}

.sec-upgrade-cta:hover {
    background: var(--color-frog-green-dark);
}

/* ====================================================================
   LOADING SPINNER
   ==================================================================== */

@keyframes sec-spin {
    to { transform: rotate(360deg); }
}

.sec-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-electric-blue);
    border-radius: 50%;
    animation: sec-spin 0.7s linear infinite;
}

/* ====================================================================
   INLINE SEARCH IN DETAIL HEADER
   ==================================================================== */

.sec-inline-search-label {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.sec-yahoo-pill-locked {
    opacity: 0.75;
}
.sec-yahoo-pill-locked svg {
    color: var(--color-text-muted);
    margin-left: 2px;
    flex-shrink: 0;
}

.pvt-upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-frog-green);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    animation: pvt-banner-in 0.18s ease;
}
@keyframes pvt-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pvt-upgrade-banner-body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.pvt-upgrade-banner-body > svg {
    color: var(--color-frog-green);
    flex-shrink: 0;
    margin-top: 2px;
}
.pvt-upgrade-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pvt-upgrade-banner-text strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.pvt-upgrade-banner-text span {
    font-size: 12px;
    color: var(--color-text-secondary);
}
.pvt-upgrade-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pvt-upgrade-cta {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--color-frog-green);
    color: #052112;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.pvt-upgrade-cta:hover { background: var(--color-frog-green-dark); }
.pvt-upgrade-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}
.pvt-upgrade-dismiss:hover { color: var(--color-text-primary); }

.sec-search-signup-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--color-text-secondary);
}
.sec-search-signup-prompt svg { color: var(--color-text-muted); flex-shrink: 0; }
.sec-search-signup-prompt a { color: var(--color-blue); font-weight: 600; text-decoration: none; }
.sec-search-signup-prompt a:hover { text-decoration: underline; }

/* Guest sign-up prompts within the securities page */
.guest-search-wall {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 14px;
}
.guest-search-wall a {
    color: var(--color-blue);
    font-weight: 600;
    text-decoration: none;
}
.guest-search-wall a:hover { text-decoration: underline; }

.guest-panel-footer {
    padding: 12px 0 4px;
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
}
.guest-panel-footer a {
    color: var(--color-blue);
    font-weight: 600;
    text-decoration: none;
}
.guest-panel-footer a:hover { text-decoration: underline; }
