/* ==========================================================================
   EGXHUB - IPO / new-share subscription section
   Scoped to .ipo-* so it cannot leak into other pages.
   ========================================================================== */

.ipo-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}

.ipo-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ipo-title-row h1 {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--text-highlight);
    margin: 0;
}

.ipo-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: var(--bullish-bg);
    color: var(--bullish-green);
    border: 1px solid var(--bullish-border);
}

.ipo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bullish-green);
    animation: ipoPulse 1.8s infinite;
}

@keyframes ipoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.82); }
}

.ipo-sub {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 8px 0 0;
    max-width: 720px;
}

.ipo-mine-btn { white-space: nowrap; }

/* ---------- stat tiles ---------- */
.ipo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.ipo-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ipo-stat span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.ipo-stat strong {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
}

/* ---------- grid + card ---------- */
.ipo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: 18px;
}

.ipo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

/* An open subscription is the actionable state, so it gets the strongest edge. */
.ipo-card.is-open {
    border-color: var(--bullish-border);
    box-shadow: 0 0 0 1px var(--bullish-border), var(--shadow-sm);
}

.ipo-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-md);
}

.ipo-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ipo-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-highlight);
}

.ipo-status {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 9999px;
    border: 1px solid;
    white-space: nowrap;
}

.ipo-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-highlight);
    margin: 0;
    line-height: 1.4;
}

.ipo-sector {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- prices ---------- */
.ipo-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.ipo-prices > div { display: flex; flex-direction: column; gap: 3px; }

.ipo-prices span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
}

.ipo-prices strong {
    font-size: 1.1rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-highlight);
}

.ipo-prices strong small { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); }

.ipo-vs { text-align: left; }

.vs {
    font-size: 0.74rem;
    font-weight: 800;
    font-style: normal;
    font-family: 'JetBrains Mono', monospace;
}

.vs.up { color: var(--bullish-green); }
.vs.down { color: var(--bearish-red); }

/* ---------- terms ---------- */
.ipo-terms {
    margin: 0;
    display: grid;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ipo-terms > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 7px 11px;
    border-bottom: 1px solid var(--border-color);
}

.ipo-terms > div:last-child { border-bottom: none; }
.ipo-terms > div:nth-child(odd) { background: rgba(127, 127, 127, 0.035); }

.ipo-terms dt {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0;
}

.ipo-terms dd {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-highlight);
    text-align: left;
}

/* ---------- countdown + subscribe ---------- */
.ipo-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--bullish-bg);
    border: 1px solid var(--bullish-border);
    color: var(--bullish-green);
    font-size: 0.8rem;
    font-weight: 700;
}

.ipo-countdown strong { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; }

.ipo-sub-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ipo-sub-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    flex: 1;
    min-width: 110px;
}

.ipo-shares {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.ipo-shares:focus {
    outline: none;
    border-color: var(--cyan-accent);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.12);
}

.ipo-submit { white-space: nowrap; }

.ipo-details-btn { width: 100%; justify-content: center; }

/* ---------- flash / empty / foot ---------- */
.ipo-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    margin-bottom: 18px;
    font-size: 0.88rem;
}

.ipo-flash.ok {
    background: var(--bullish-bg);
    border: 1px solid var(--bullish-border);
    color: var(--bullish-green);
}

.ipo-flash.bad {
    background: var(--bearish-bg);
    border: 1px solid var(--bearish-border);
    color: var(--bearish-red);
}

.ipo-empty {
    text-align: center;
    padding: 60px 20px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.ipo-empty i { font-size: 2.6rem; color: var(--text-muted); margin-bottom: 14px; display: block; }
.ipo-empty h3 { font-size: 1.1rem; color: var(--text-highlight); margin: 0 0 8px; }
.ipo-empty p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

.ipo-foot {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 24px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.ipo-foot i { color: var(--cyan-accent); flex-shrink: 0; margin-top: 3px; }

/* ---------- details page ---------- */
.ipo-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

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

.ipo-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.ipo-timeline { display: grid; gap: 12px; }

.ipo-step {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.ipo-step.done { border-color: var(--bullish-border); }
.ipo-step.next { border-color: var(--gold-border); }

.ipo-step i {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.ipo-step.done i { background: var(--bullish-bg); border-color: var(--bullish-border); color: var(--bullish-green); }
.ipo-step.next i { background: var(--gold-bg); border-color: var(--gold-border); color: var(--gold-accent); }

.ipo-step-body { display: flex; flex-direction: column; gap: 2px; }
.ipo-step-title { font-size: 0.85rem; font-weight: 800; color: var(--text-highlight); }
.ipo-step-date { font-size: 0.76rem; color: var(--text-muted); }

@media (max-width: 520px) {
    .ipo-prices { grid-template-columns: 1fr; }
    .ipo-vs { text-align: right; }
    .ipo-title-row h1 { font-size: 1.35rem; }
}
/* ---- Sections: live pipeline first, history kept but out of the way ---- */
.ipo-section { margin-bottom: 34px; }

.ipo-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.ipo-section-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-highlight);
}

.ipo-section-head h2 i { color: var(--gold-accent); font-size: 0.95rem; }

.ipo-section-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px 10px;
}

.ipo-section-note {
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ---- "غير معلن": a field the exchange has not published yet ---- */
.ipo-unknown {
    color: var(--text-muted) !important;
    font-weight: 700;
    font-size: 0.86rem;
    opacity: 0.85;
}

.ipo-terms dd.ipo-unknown { font-size: 0.84rem; }
.ipo-summary {
    margin: 8px 0 0;
    font-size: 0.78rem;
    line-height: 1.75;
    color: var(--text-muted);
    border-right: 2px solid var(--border-color);
    padding-right: 10px;
}
/* Sticky header must not cover a section heading jumped to by an anchor. */
.ipo-section { scroll-margin-top: 90px; }