/* ============================================
   DIPCATCHER - GATED PAGES SHARED STYLES
   Single source of truth for all authenticated pages
   ============================================ */

/* --- Gated Header (top bar with title + market status + user menu) --- */
.gated-header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px 45px;
    background: #0a0f1c;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease;
}

body.sidebar-collapsed .gated-header {
    left: 80px;
}

.gh-page-title h1 {
    font-size: 24px;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
    line-height: 1.3;
}

.gh-page-title .gh-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 400;
}

.gh-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gh-markets {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-markets-label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.gh-market-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
}

.gh-market-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.gh-market-dot.open {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.gh-market-dot.closed {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

.gh-user-menu {
    position: relative;
}

.gh-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.gh-user-btn:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

.gh-tier-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.gh-tier-badge.free,
.gh-tier-badge.bronze {
    background: rgba(205, 127, 50, 0.15);
    color: #cd7f32;
}

.gh-tier-badge.silver {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.gh-tier-badge.gold {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.gh-tier-badge.platinum {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.gh-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 200;
}

.gh-user-dropdown.open {
    display: block;
}

/* Push main content down when gated header exists.
   JS dynamically sets --gated-header-height based on actual rendered height.
   Fallback to 70px if JS hasn't run yet. */
body.has-gated-header .main-content {
    padding-top: calc(2rem + var(--gated-header-height, 70px));
}

/* When gated header is active, the original .page-header is hidden via JS.
   Zero out all spacing so it contributes absolutely no vertical space,
   even if display:none is somehow overridden or removed. */
body.has-gated-header .page-header[style*="display: none"],
body.has-gated-header .page-header[style*="display:none"] {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* --- Page Header (benchmark: signals.html) --- */
.page-header {
    background: #0f172a;
    border: none;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 8px;
}

.page-header .subtitle {
    color: #94a3b8;
    font-size: 14px;
}

/* --- Stat Cards --- */
.stat-card {
    background: #0f172a;
    border: none;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.stat-card .value {
    font-size: 32px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 4px;
}

.stat-card .label {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

.stat-card.highlight .value {
    color: #3b82f6;
}

/* --- Glance Cards --- */
.glance-card {
    background: #0f172a;
    border: none;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.glance-card:hover {
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.glance-card-title {
    color: #e2e8f0;
}

.glance-card-count {
    color: #f8fafc;
}

.glance-card-label {
    color: #94a3b8;
}

/* --- Section Cards --- */
.section-card {
    background: #0f172a;
    border: none;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.section-card h3 {
    color: #f8fafc;
}

/* --- Status Badges (dark theme) --- */
.badge-success,
.badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-warning,
.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-danger,
.badge-failed,
.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* --- Tables --- */
.table-container {
    background: #0f172a;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

thead,
th {
    background: #0a0f1c;
    color: #94a3b8;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* --- Filter/Action Bars --- */
.filter-bar,
.market-bar {
    background: #0f172a;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* --- Buttons (shared patterns) --- */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.15);
    color: #f8fafc;
}

/* --- Search Inputs --- */
.search-box input,
.search-input {
    background: #111827;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #f8fafc;
    padding: 8px 12px;
    font-size: 14px;
}

.search-box input:focus,
.search-input:focus {
    border-color: #3b82f6;
    outline: none;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .gated-header {
        left: 0;
        padding: 12px 16px;
    }
    .gh-page-title h1 {
        font-size: 18px;
    }
}
