:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #131316;
    --bg-tertiary: #1a1a1f;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --border: #27272a;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-links {
    display: flex;
    gap: 1.5rem;
}

.header-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.header-links a:hover {
    color: var(--text-primary);
}

/* Hero */
.hero {
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-metamask {
    background: #f6851b;
    color: white;
}

.btn-metamask:hover {
    background: #e2761b;
    transform: translateY(-1px);
}

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

/* Sections */
section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.info-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.info-card-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.info-card-value.mono {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9rem;
}

/* Resource Links */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.resource-grid .resource-section {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .resource-section {
        padding: 1rem;
    }

    .resource-link-row {
        flex-wrap: nowrap;
    }

    .resource-link-row .resource-link {
        font-size: 0.85rem;
    }

    .endpoint-status {
        min-width: 50px;
        font-size: 0.65rem;
    }
}

.resource-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.resource-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.resource-link:hover {
    color: var(--accent-hover);
}

.resource-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.resource-meta {
    color: var(--text-muted);
    font-size: 0.85em;
}

/* Resource link row with status indicator */
.resource-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.resource-link-row .resource-link {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.endpoint-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 55px;
    justify-content: flex-end;
    white-space: nowrap;
}

.endpoint-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.endpoint-status.checking::before {
    background: var(--text-muted);
    animation: pulse 1.5s infinite;
}

.endpoint-status.online::before {
    background: var(--success);
    box-shadow: 0 0 4px var(--success);
}

.endpoint-status.offline::before {
    background: #ef4444;
    box-shadow: 0 0 4px #ef4444;
}

/* Genesis Info */
.genesis-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.genesis-table tr {
    border-bottom: 1px solid var(--border);
}

.genesis-table tr:last-child {
    border-bottom: none;
}

.genesis-table td {
    padding: 0.75rem 0;
    vertical-align: middle;
}

.genesis-table td:first-child {
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 180px;
    white-space: nowrap;
}

.genesis-table td:last-child {
    width: auto;
}

.genesis-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.genesis-value code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Live Status */
.live-status-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.status-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.status-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.status-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.status-row {
    display: grid;
    gap: 1rem;
}

.status-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.status-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.status-row.secondary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-value.mono {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.status-value.healthy {
    color: var(--success);
}

.status-value.unhealthy {
    color: #f59e0b;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.ok {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-indicator.warn {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
    animation: pulse-warn 1.5s infinite;
}

@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-lag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.status-alert {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.375rem;
    color: #f59e0b;
    font-size: 0.85rem;
}

.empty-queue {
    color: var(--text-muted);
    font-style: italic;
}

.queue-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.status-loading,
.status-unavailable {
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
}

.status-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}

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

@media (max-width: 640px) {
    .status-row.cols-2,
    .status-row.cols-3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Fork Schedule */
.fork-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.fork-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border);
}

.fork-item {
    position: relative;
    padding: 0.75rem 0;
}

.fork-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateX(-4px);
}

.fork-item.active::before {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.fork-item.upcoming::before {
    background: var(--text-muted);
}

.fork-name {
    font-weight: 600;
    color: var(--text-primary);
}

.fork-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.fork-epoch {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Footer */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--text-primary);
}

/* Notice Section */
.notice-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

.notice-text a {
    color: var(--accent);
}

.notice-meta {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }

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

    .header-links {
        display: none;
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: #ef4444;
}
