/**
 * Creator OS - Sections
 * Location: /public_html/community/assets/css/sections.css
 * v2.1 — Hero banner styles moved to command-header.php (inline).
 *         Old .command-header rules removed to prevent conflicts.
 */

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  NAVIGATION TABS                                                    ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.cos-nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0 2rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 100;
    scrollbar-width: none;
}

.cos-nav::-webkit-scrollbar { display: none; }

.cos-nav-tab {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.cos-nav-tab:hover { color: var(--text-primary); }

.cos-nav-tab.active {
    color: var(--gold-primary);
    font-weight: 600;
}

.cos-nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--gold-primary);
    border-radius: 2px 2px 0 0;
}

.cos-nav-tab .iconify { font-size: 1.125rem; flex-shrink: 0; }

.cos-nav-caret {
    font-size: 0.75rem !important;
    opacity: 0.5;
    transition: transform 0.15s ease;
}

.cos-nav-badge {
    background: linear-gradient(135deg, #F9C94C, #E5A91A);
    color: #1a1a2e;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* Nav dropdown */
.cos-nav-dropdown {
    position: relative;
    flex-shrink: 0;
}

.cos-nav-dropdown:hover .cos-nav-caret {
    transform: rotate(180deg);
    opacity: 1;
}

.cos-nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: rgba(15, 20, 35, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 0.375rem 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.cos-nav-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cos-nav-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.12s ease;
}

.cos-nav-menu-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.cos-nav-menu-item.active { color: var(--gold-primary); background: rgba(249,201,76,0.05); }
.cos-nav-menu-item .iconify { font-size: 1rem; flex-shrink: 0; }

/* ── Legacy command-nav (kept for old pages that still include navigation.php v1) ── */
.command-nav {
    display: flex;
    gap: 0.125rem;
    padding: 0 2rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 100;
    overflow-x: auto;
    scrollbar-width: none;
}

.command-nav::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
    .cos-nav { padding: 0 1rem; }
    .cos-nav-tab { padding: 0.625rem 0.75rem; font-size: 0.8125rem; gap: 0.3125rem; }
    .cos-nav-label { display: none; }
    .cos-nav-tab .iconify { font-size: 1.25rem; }
    .cos-nav-caret { display: none; }
}

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  METRIC CARDS                                                       ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 1.125rem 1.25rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.1);
}

.metric-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.metric-number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.metric-number.metric-gold {
    color: var(--gold-primary);
}

.metric-unit {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 1px;
}

/* Legacy metric-header/metric-value */
.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  PROGRESS BAR                                                       ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold-primary);
    border-radius: 2px;
    transition: width 1s ease-out;
}

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  COMPOSER                                                           ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.action-composer {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.875rem;
    overflow: hidden;
    margin-bottom: var(--space-6);
    width: 100%;
}

.composer-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}

.composer-tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.composer-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.composer-tab.active {
    color: var(--gold-primary);
    border-bottom-color: var(--gold-primary);
}

.composer-body {
    padding: var(--space-4);
}

.composer-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    min-height: 80px;
    font-family: inherit;
}

.composer-input:focus { outline: none; }
.composer-input::placeholder { color: var(--text-muted); }

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.composer-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  ACTIVITY FEED                                                      ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.feed-stream {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
}

.activity-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-muted));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-inverse);
}

.activity-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
}

.activity-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.activity-meta {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-2);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  RIGHT RAIL PANELS                                                  ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.rail-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    margin-bottom: var(--space-4);
    overflow: hidden;
}

.panel-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
}

.panel-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.panel-body { padding: var(--space-2); }

.action-checklist { padding: 0; }

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.checklist-item:hover { background: rgba(255,255,255,0.03); }
.checklist-item.completed { opacity: 0.5; }
.checklist-item.completed .checklist-text { text-decoration: line-through; color: var(--text-muted); }

.checklist-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}

.checklist-item.completed .checklist-checkbox {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
}

.checklist-content { flex: 1; }
.checklist-text { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; margin-bottom: 2px; }
.checklist-hint { font-size: 0.75rem; color: var(--text-muted); }

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  MODALS                                                            ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-container {
    background: var(--bg-elevated);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s var(--ease-spring);
}

.modal-overlay.active .modal-container { transform: scale(1) translateY(0); }

.modal-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.modal-body { padding: var(--space-5); }

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  SECTION TITLE / EMPTY STATE                                       ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

.section-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-primary);
}

.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-4);
    color: var(--text-muted);
}

.empty-state .iconify { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.3; }
.empty-state h3 { font-size: 1.125rem; color: var(--text-primary); margin-bottom: var(--space-2); }
.empty-state p { font-size: 0.875rem; margin-bottom: var(--space-4); }
/* ════════════════════════════════════════════════════════════════════════
   LIVE ROOMS · ASSETS · AGENTS   (added 2026-08-27)

   Live rooms replaces the Deal Lounge command centre's live card, which was
   gated behind a template registry that does not exist on production and
   therefore never rendered there. Assets and Agents came from the workspace
   page, which is gone — they were the only two things on it that were not
   already somewhere else.
   ════════════════════════════════════════════════════════════════════════ */

.xln-live .xln-section-title { display: flex; align-items: center; gap: 8px; }

/* The one place a pulsing dot is warranted: it means "happening right now". */
.xln-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--status-live, #E7563F);
    box-shadow: 0 0 0 0 rgba(231, 86, 63, 0.6);
    animation: xln-live-pulse 2s var(--ease-out, ease-out) infinite;
}
@keyframes xln-live-pulse {
    70%  { box-shadow: 0 0 0 7px rgba(231, 86, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 86, 63, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .xln-live-dot { animation: none; }
}

.xln-live-empty {
    margin: 0;
    padding: var(--space-4, 16px);
    background: var(--surface-1, #0F0F16);
    border: 1px dashed var(--border-default, rgba(255,255,255,0.11));
    border-radius: var(--radius-lg, 14px);
    color: var(--text-tertiary, rgba(255,255,255,0.50));
    font-size: var(--text-base, 14px);
    line-height: 1.55;
}

.xln-live-error {
    margin: var(--space-3, 12px) 0 0;
    font-size: var(--text-sm, 12px);
    color: var(--danger, #FF5B5B);
}
.xln-live-error[hidden] { display: none; }

.xln-live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-3, 12px);
}

.xln-live-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-4, 16px);
    background: var(--surface-1, #0F0F16);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.07));
    border-radius: var(--radius-lg, 14px);
    text-decoration: none;
    color: inherit;
    transition: border-color 150ms, background 150ms, transform 150ms;
}
.xln-live-card:hover {
    border-color: var(--border-hover, rgba(255,255,255,0.16));
    background: var(--surface-2, #161620);
    transform: translateY(-1px);
}
.xln-live-card.is-live { border-left: 3px solid var(--status-live, #E7563F); }

.xln-live-badge {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
    background: rgba(255,255,255,0.05);
    color: var(--text-tertiary, rgba(255,255,255,0.50));
    font-size: var(--text-xs, 11px);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.xln-live-badge.is-live {
    background: rgba(231, 86, 63, 0.14);
    color: var(--status-live, #E7563F);
}

.xln-live-title {
    font-size: var(--text-lg, 16px);
    font-weight: 600;
    color: var(--text-primary, #fff);
    line-height: 1.3;
}
.xln-live-meta {
    font-size: var(--text-sm, 12px);
    color: var(--text-tertiary, rgba(255,255,255,0.50));
    text-transform: capitalize;
}

/* ── Assets ───────────────────────────────────────────────────────────── */
.xln-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3, 12px);
}

.xln-asset {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3, 12px);
    padding: var(--space-4, 16px);
    background: var(--surface-1, #0F0F16);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.07));
    border-radius: var(--radius-lg, 14px);
}

.xln-asset__icon {
    flex-shrink: 0;
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-md, 10px);
    background: var(--accent-soft, rgba(249,201,76,0.08));
    color: var(--accent, #F9C94C);
    font-family: var(--font-mono, monospace);
    font-size: 14px;
}
.xln-asset__body { min-width: 0; }
.xln-asset__title {
    font-size: var(--text-base, 14px);
    font-weight: 600;
    color: var(--text-primary, #fff);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xln-asset__meta {
    margin-top: 3px;
    font-size: var(--text-sm, 12px);
    color: var(--text-tertiary, rgba(255,255,255,0.50));
    text-transform: capitalize;
}

/* ── Agents ───────────────────────────────────────────────────────────── */
.xln-agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-3, 12px);
}

.xln-agent {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3, 12px);
    padding: var(--space-4, 16px);
    background: var(--surface-1, #0F0F16);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.07));
    border-radius: var(--radius-lg, 14px);
    text-decoration: none;
    color: inherit;
    transition: border-color 150ms, background 150ms;
}
.xln-agent:hover {
    border-color: var(--border-hover, rgba(255,255,255,0.16));
    background: var(--surface-2, #161620);
}

.xln-agent__icon {
    flex-shrink: 0;
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-md, 10px);
    overflow: hidden;
    background: var(--role-steward-soft, rgba(167,139,250,0.14));
    color: var(--role-steward, #A78BFA);
    font-weight: 800;
}
.xln-agent__icon img { width: 100%; height: 100%; object-fit: cover; }

.xln-agent__name { font-size: var(--text-base, 14px); font-weight: 600; color: var(--text-primary, #fff); }
.xln-agent__desc {
    margin-top: 3px;
    font-size: var(--text-sm, 12px);
    color: var(--text-tertiary, rgba(255,255,255,0.50));
    line-height: 1.45;
}

/* Two secondary sections sharing one row. Collapses to stacked below 1100px,
   where two columns would leave each one too narrow to read. */
.xln-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4, 16px);
    align-items: start;
}
.xln-pair > .xln-section { margin-bottom: 0; }

/* A hidden section must not hold open a grid column. */
.xln-pair > .xln-section[hidden] { display: none; }

@media (max-width: 1100px) {
    .xln-pair { grid-template-columns: 1fr; }
}

/* Agent cards get narrower in a half-width column, so let them go single-file
   rather than squeezing two into 300px. */
.xln-pair .xln-agent-grid,
.xln-pair .xln-asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
