/**
 * Sovbit Relay Admin Panel
 * Modern Dark Theme with Bitcoin Orange & Nostr Purple
 */

/* ========================================================================
   Custom Fonts
   ======================================================================== */
@font-face {
    font-family: 'Brighton';
    src: url('../fonts/BrightontwoSquareNbp-wvB8.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'USSR';
    src: url('../fonts/USSR STENCIL WEBFONT.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Supermolot';
    src: url('../fonts/Supermolot Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

/* ========================================================================
   CSS Variables
   ======================================================================== */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-card: #1e1e2e;
    --bg-card-hover: #252535;

    /* Bitcoin Orange */
    --bitcoin-orange: #f7931a;
    --bitcoin-orange-hover: #ff9e2c;
    --bitcoin-orange-dark: #d97706;

    /* Nostr Purple */
    --nostr-purple: #a855f7;
    --nostr-purple-hover: #9333ea;
    --nostr-purple-light: #c084fc;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.05);
    --border-gradient: linear-gradient(135deg, var(--bitcoin-orange) 0%, var(--nostr-purple) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow-orange: 0 0 20px rgba(247, 147, 26, 0.3);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.3);

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ========================================================================
   Base Styles
   ======================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Supermolot', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(247, 147, 26, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Brighton', 'USSR', sans-serif;
    font-weight: 400;
    letter-spacing: 0.5px;
}

code, .monospace {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ========================================================================
   Login Page
   ======================================================================== */
.login-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow-y: auto;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(247, 147, 26, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    padding: 50px 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    max-width: 200px;
    margin: 0 auto 20px;
    display: block;
}

.login-header img {
    max-width: 200px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--bitcoin-orange) 0%, var(--nostr-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.extension-status {
    text-align: center;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.extension-status .checking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.extension-status .checking .spinner {
    width: 20px;
    height: 20px;
}

.extension-status .found {
    color: var(--success);
    font-weight: 600;
    font-size: 15px;
}

.extension-status .found::before {
    content: '✓ ';
    font-size: 18px;
}

.extension-status .not-found {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.extension-status .not-found::before {
    content: '⚠️ ';
    font-size: 18px;
}

.login-content {
    margin-bottom: 20px;
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    gap: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--nostr-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 1rem 0;
    position: relative;
}
.login-divider::before,
.login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--border-color);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.form-control:focus {
    border-color: var(--nostr-purple);
}

.login-footer {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.footer-section {
    margin-bottom: 20px;
}

.footer-section h3 {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section h4 {
    font-size: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.extension-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extension-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 13px;
}

.extension-link:hover {
    border-color: var(--nostr-purple);
    background: rgba(168, 85, 247, 0.05);
    color: var(--text-primary);
}

.extension-link svg {
    flex-shrink: 0;
    color: var(--nostr-purple);
}

.extension-link span {
    font-weight: 600;
    color: var(--text-primary);
}

.extension-link small {
    color: var(--text-muted);
    margin-left: auto;
    font-size: 11px;
}

.footer-notice {
    margin-top: 20px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-notice svg {
    flex-shrink: 0;
    color: var(--nostr-purple);
}

/* ========================================================================
   Dashboard Layout
   ======================================================================== */
.dashboard-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.navbar {
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-logo {
    height: 32px;
}

.navbar-brand img {
    height: 32px;
}

.navbar-brand span {
    font-family: 'Brighton', sans-serif;
    font-size: 20px;
    background: linear-gradient(135deg, var(--bitcoin-orange) 0%, var(--nostr-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
    position: relative;
}

.navbar-menu a svg {
    flex-shrink: 0;
}

.navbar-menu a:hover {
    color: var(--nostr-purple);
    background: rgba(168, 85, 247, 0.1);
}

.navbar-menu a.active {
    color: var(--bitcoin-orange);
    background: rgba(247, 147, 26, 0.1);
}

.navbar-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--bitcoin-orange);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.user-info span {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-npub {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 6px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 30px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.section-header h1 {
    font-size: 28px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.section-header h2 {
    font-size: 28px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ========================================================================
   Stat Cards
   ======================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
    cursor: default;
}

.stat-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(247, 147, 26, 0.1);
    color: var(--bitcoin-orange);
    margin-bottom: 16px;
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: var(--nostr-purple);
}

.stat-icon.orange {
    background: rgba(247, 147, 26, 0.1);
    color: var(--bitcoin-orange);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--bitcoin-orange);
    font-family: 'Brighton', sans-serif;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-value.purple {
    color: var(--nostr-purple);
}

.stat-trend {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ========================================================================
   Charts
   ======================================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    transition: var(--transition-fast);
}

.chart-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.chart-period {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.storage-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.storage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.storage-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.storage-value {
    color: var(--bitcoin-orange);
    font-weight: 700;
    font-family: 'Brighton', sans-serif;
}

.storage-info strong {
    color: var(--bitcoin-orange);
    font-weight: 600;
}

#storage-tables {
    margin-top: 20px;
}

#storage-tables div {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    transition: var(--transition-fast);
}

#storage-tables div:hover {
    background: rgba(168, 85, 247, 0.05);
}

#storage-tables div:last-child {
    border-bottom: none;
}

/* ========================================================================
   Buttons
   ======================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--bitcoin-orange);
    color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--bitcoin-orange-dark);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--nostr-purple);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--nostr-purple-hover);
    opacity: 0.9;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--nostr-purple);
    background: rgba(168, 85, 247, 0.05);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================================================
   Forms & Inputs
   ======================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 4px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--nostr-purple);
    background: rgba(168, 85, 247, 0.05);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
}

/* ========================================================================
   Tables
   ======================================================================== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.data-table td {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(168, 85, 247, 0.05);
}

.data-table .loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.data-table .loading .spinner {
    width: 20px;
    height: 20px;
}

.pubkey-short {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: rgba(168, 85, 247, 0.2);
    color: var(--nostr-purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ========================================================================
   Pagination
   ======================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.pagination button {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-fast);
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    background: var(--nostr-purple);
    border-color: var(--nostr-purple);
    color: white;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .current-page {
    padding: 10px 16px;
    font-weight: 600;
    color: var(--bitcoin-orange);
}

/* ========================================================================
   Modals
   ======================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 22px;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.modal-form {
    padding: 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
}

/* ========================================================================
   Toast Notifications
   ======================================================================== */
#toast-container {
    position: fixed;
    top: 80px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    opacity: 0;
    transform: translateX(400px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--nostr-purple);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

/* ========================================================================
   Error Messages
   ======================================================================== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message::before {
    content: '⚠️';
    font-size: 18px;
}

/* ========================================================================
   Utility Classes
   ======================================================================== */
.gradient-text {
    background: linear-gradient(135deg, var(--bitcoin-orange) 0%, var(--nostr-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                var(--border-gradient) border-box;
}

.glow-orange {
    box-shadow: var(--shadow-glow-orange);
}

.glow-purple {
    box-shadow: var(--shadow-glow-purple);
}

.text-orange {
    color: var(--bitcoin-orange);
}

.text-purple {
    color: var(--nostr-purple);
}

.text-muted {
    color: var(--text-muted);
}

/* ========================================================================
   Responsive Design
   ======================================================================== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }

    .navbar-menu {
        display: none; /* Hide on mobile - would need hamburger menu */
    }

    .main-content {
        padding: 24px 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 40px 30px;
    }

    #toast-container {
        right: 20px;
        left: 20px;
    }

    .toast {
        min-width: auto;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .navbar-brand span {
        display: none;
    }

    .user-npub {
        font-size: 11px;
        padding: 4px 8px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }
}

/* ========================================================================
   Dark Mode Scrollbar
   ======================================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.3) var(--bg-secondary);
}

/* ========================================================================
   Content Moderation Panel
   ======================================================================== */

.mod-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.mod-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}

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

.mod-tab.active {
    color: var(--nostr-purple);
    border-bottom-color: var(--nostr-purple);
}

.mod-count {
    background: var(--nostr-purple);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

/* Nav badge (pending count in sidebar) */
.nav-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.mod-loading,
.mod-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
}

.mod-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s;
}

.mod-tile:hover { border-color: var(--nostr-purple); }

.mod-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    overflow: hidden;
}

.mod-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mod-thumb-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-muted);
}

.mod-video-badge {
    position: absolute;
    top: 6px;
    left: 8px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
}

.mod-info {
    padding: 10px 12px 6px;
    flex: 1;
}

.mod-filename {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mod-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.mod-pubkey { font-family: monospace; }

.mod-mime {
    font-size: 11px;
    color: var(--text-muted);
}

.mod-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px 12px;
    flex-wrap: wrap;
}

.mod-actions .btn { flex: 1; min-width: 0; font-size: 12px; padding: 5px 8px; }

.btn-success {
    background: #16a34a;
    color: #fff;
    border: 1px solid #15803d;
}
.btn-success:hover { background: #15803d; }

.btn-warning {
    background: #d97706;
    color: #fff;
    border: 1px solid #b45309;
}
.btn-warning:hover { background: #b45309; }

/* Blocklist table */
.mod-blocklist-container { overflow-x: auto; }

.mod-blocklist-container .data-table td.mono {
    font-family: monospace;
    font-size: 12px;
}

/* ── Uploader-grouped view ──────────────────────────────────────────────────── */

.mod-uploaders-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
}
.mod-uploaders-summary strong { color: var(--text-primary); }

.mod-uploaders { display: flex; flex-direction: column; gap: 10px; }

.mod-uploader-row {
    display: grid;
    grid-template-columns: auto minmax(180px, 1.4fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
}
.mod-uploader-row.is-blocked { opacity: 0.55; }
.mod-uploader-row.is-selected {
    border-color: var(--nostr-purple);
    box-shadow: 0 0 0 1px var(--nostr-purple);
}

.mod-upl-select { display: flex; cursor: pointer; }
.mod-upl-select input { cursor: pointer; width: 16px; height: 16px; margin: 0; }

.mod-uploader-id { display: flex; align-items: center; gap: 8px; min-width: 0; }

.mod-badge-blocked {
    background: #ef4444;
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.mod-uploader-stats { text-align: right; white-space: nowrap; }
.mod-uploader-count { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.mod-uploader-sub   { font-size: 11px; color: var(--text-muted); }

.mod-samples { display: flex; gap: 6px; overflow: hidden; }

.mod-sample {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}
.mod-sample img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mod-sample-blank img { display: none; }

.mod-uploader-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 900px) {
    .mod-uploader-row { grid-template-columns: 1fr; }
    .mod-uploader-stats { text-align: left; }
    .mod-uploader-actions { justify-content: flex-start; }
}

/* ── Queue toolbars, selection, pager ───────────────────────────────────────── */

.mod-filter-bar,
.mod-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
    min-height: 20px;
}

.mod-filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
}

.mod-selectall { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.mod-selectall input { cursor: pointer; }

.mod-tile { position: relative; }
.mod-tile.is-selected { border-color: var(--nostr-purple); box-shadow: 0 0 0 1px var(--nostr-purple); }

.mod-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.75);
    border-radius: 5px;
    padding: 4px;
    display: flex;
    cursor: pointer;
}
.mod-select input { cursor: pointer; width: 16px; height: 16px; margin: 0; }

/* .mod-thumb already sets aspect-ratio 16/9, which reserves the box before the
   lazy-loaded image arrives — no extra sizing needed here. */

.mod-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.mod-pager-label { font-size: 13px; color: var(--text-muted); }

/* ── Identity actions (copy npub / open profile) ────────────────────────────── */

.mod-id-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

.mod-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.mod-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--nostr-purple);
}

/* ── Missing-file tiles ─────────────────────────────────────────────────────── */

.mod-tile.is-missing { opacity: 0.65; }

.mod-thumb-missing {
    flex-direction: column;
    gap: 4px;
    font-size: 22px;
    color: var(--text-muted);
}
.mod-thumb-missing span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Video player modal ─────────────────────────────────────────────────────── */

.mod-thumb-playable { cursor: pointer; }

.mod-player-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.mod-player-modal.active { display: flex; }

.mod-player-content {
    position: relative;
    width: min(960px, 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mod-player-content video {
    width: 100%;
    max-height: 80vh;
    background: #000;
    border-radius: 10px;
    outline: none;
}

.mod-player-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}
.mod-player-close:hover { background: var(--bg-card-hover); }

.mod-player-rawlink {
    align-self: flex-end;
    font-size: 12px;
    color: var(--text-muted);
}
.mod-player-rawlink:hover { color: var(--text-primary); }

/* ── npub ban form ──────────────────────────────────────────────────────────── */

.mod-ban-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
/* Inputs are styled by element selector app-wide; only sizing is needed here. */
.mod-ban-form input[type="text"] { flex: 1; min-width: 200px; }
.mod-ban-form #mod-ban-reason { flex: 0 1 180px; }

/* ── Video Streams Panel ──────────────────────────────────────────────────────── */

.video-stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vstat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.vstat-n {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.vstat-l {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.vstat-ready  .vstat-n { color: var(--success); }
.vstat-queued .vstat-n { color: var(--warning); }
.vstat-error  .vstat-n { color: var(--danger); }

.video-error-msg {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-info {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}
