:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --border-color: #475569;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-muted);
}

code {
    background-color: var(--surface-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Search Section */
.search-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-box button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-box button:hover {
    background-color: var(--accent-hover);
}

.quick-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.quick-links a {
    color: var(--accent-color);
    text-decoration: none;
}

.quick-links a:hover {
    text-decoration: underline;
}

/* Tabs */
.tabs {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-color);
    background-color: var(--surface-hover);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.tab-content {
    display: none;
    padding: 2rem;
}

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

.tab-content h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Loading & Error */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem;
}

/* Content Styles */
.did-document {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.did-section {
    margin-bottom: 1.5rem;
}

.did-section:last-child {
    margin-bottom: 0;
}

.did-section h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.did-section p, .did-section ul {
    color: var(--text-color);
}

.did-section ul {
    list-style: none;
    padding-left: 0;
}

.did-section li {
    padding: 0.5rem;
    background-color: var(--surface-color);
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.service-card, .key-card, .op-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.service-card h4, .key-card h4, .op-card h4 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.op-card.nullified {
    opacity: 0.5;
    border-color: var(--error-color);
}

.op-card .op-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.op-card .op-type {
    background-color: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.op-card .op-type.tombstone {
    background-color: var(--error-color);
}

.op-card .op-type.legacy {
    background-color: var(--warning-color);
    color: #000;
}

.op-card .nullified-badge {
    background-color: var(--error-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.op-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* JSON Display */
pre {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.json-key {
    color: #93c5fd;
}

.json-string {
    color: #86efac;
}

.json-number {
    color: #fca5a5;
}

.json-boolean {
    color: #fcd34d;
}

.json-null {
    color: #9ca3af;
}

/* Export Section */
.export-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.export-section h2 {
    margin-bottom: 1rem;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.export-controls input {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.export-controls button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background-color: var(--success-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.export-controls button:hover {
    background-color: #16a34a;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

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

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: left;
        border-bottom: none;
        border-left: 2px solid transparent;
    }
    
    .tab-btn.active {
        border-bottom: none;
        border-left-color: var(--accent-color);
    }
}
