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

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-code: #0d1117;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --method-get: #22c55e;
}

/* Light Theme */
html.light {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-code: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

html.light .navbar {
    background: rgba(248, 250, 252, 0.95);
}

html.light .endpoint-example code {
    color: #334155;
}

html.light .example-header {
    background: rgba(0, 0, 0, 0.03);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-github {
    display: flex;
    align-items: center;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.theme-toggle .moon-icon { display: block; }
.theme-toggle .sun-icon { display: none; }

html.light .theme-toggle .moon-icon { display: none; }
html.light .theme-toggle .sun-icon { display: block; }

/* Hero */
.hero {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.hero-base-url {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-code);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.hero-base-url code {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    color: var(--primary);
}

/* Main Content */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.api-section {
    margin-bottom: 4rem;
}

.api-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.api-section h2 svg {
    color: var(--primary);
}

/* Endpoint Card */
.endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.method.get {
    background: rgba(34, 197, 94, 0.2);
    color: var(--method-get);
}

.endpoint-url {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--text);
}

.endpoint-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.endpoint-example {
    background: var(--bg-code);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.endpoint-example pre {
    padding: 1rem;
    overflow-x: auto;
}

.endpoint-example code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: #e2e8f0;
}

/* Copy Button */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.copy-btn.small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Note */
.note {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Language Table */
.lang-table {
    margin: 1.5rem 0;
}

.lang-table h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.lang-item {
    background: var(--bg-code);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.lang-item code {
    color: var(--primary);
    font-family: 'Fira Code', monospace;
    margin-right: 0.5rem;
}

/* Collections Info */
.collections-info {
    margin-top: 1.5rem;
}

.collections-info h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.collections-info ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    list-style: none;
}

.collections-info li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text);
}

.collections-info li::before {
    content: "•";
    color: var(--primary);
    margin-right: 0.5rem;
}

.collections-info li code {
    color: var(--primary);
    font-family: 'Fira Code', monospace;
    background: var(--bg-code);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* Code Tabs */
.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tab-content {
    display: none;
    background: var(--bg-code);
    border-radius: 0.75rem;
    overflow: hidden;
}

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

.tab-content pre {
    padding: 1.5rem;
    overflow-x: auto;
}

.tab-content code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
}

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

.footer-note {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-links a:not(.nav-github) {
        display: none;
    }
    
    .hero-badges {
        flex-wrap: wrap;
    }
    
    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== API Status Banner ===== */
.api-status-banner {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 99;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.status-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 500;
}

.usage-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.usage-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.usage-bar {
    width: 100px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.close-status {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-status:hover {
    color: var(--text);
}

/* ===== Setup Steps ===== */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.step {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-code);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step-content a {
    color: var(--primary);
    text-decoration: none;
}

.step-content a:hover {
    text-decoration: underline;
}

/* ===== Registration Form ===== */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Form Select Styles */
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Form Textarea Styles */
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Envato Section Styles */
.envato-section {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.envato-section .form-group {
    margin-bottom: 0;
}

.envato-section .form-group label {
    color: #f59e0b;
}

/* Purchase Code Input Group */
.purchase-input-group {
    display: flex;
    gap: 8px;
}

.purchase-input-group input {
    flex: 1;
}

.purchase-input-group .btn {
    white-space: nowrap;
    padding: 12px 16px;
}

/* Secondary Button */
.btn-secondary {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-secondary:hover {
    background: rgba(245, 158, 11, 0.3);
}

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

/* Verification Status */
.verification-status {
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.875rem;
}

.verification-status.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.verification-status.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.verification-status.loading {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-block {
    width: 100%;
}

/* ===== Info Box ===== */
.info-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.info-box h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.info-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Registration Result ===== */
.registration-result {
    text-align: center;
    padding: 32px;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.result-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

.registration-result h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.registration-result p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

.status-badge.approved {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

/* ===== Method Badge ===== */
.method.info {
    background: #3b82f6;
}

.method.post {
    background: #8b5cf6;
}

/* ===== Nav Register Button ===== */
.nav-register {
    background: var(--primary);
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-block;
}

.nav-register:hover {
    background: var(--primary-dark);
}

/* ===== Code Tabs ===== */
.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    background: var(--bg-code);
    padding: 8px 8px 0;
    border-radius: 8px 8px 0 0;
}

.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
}

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

.tab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
}

.tab-content {
    display: none;
    background: var(--bg-code);
    padding: 20px;
    border-radius: 0 0 8px 8px;
    margin-top: -8px;
}

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

/* ===== Endpoint Card Hover ===== */
.endpoint-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.endpoint-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ===== Verification Section Styles ===== */
.verification-step {
    margin-bottom: 20px;
}

.verification-result {
    text-align: center;
    padding: 32px;
    background: var(--bg-code);
    border-radius: 8px;
    margin-top: 20px;
}

.verification-result .result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.verification-result .result-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

.verification-result h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.verification-result h3[style*="color: #EF4444"] {
    color: #ef4444 !important;
}

.verification-result p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.verification-details {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    margin-top: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--text);
    font-weight: 500;
}

/* Domain Step Styles */
.domain-step {
    margin-top: 20px;
}

.verified-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 20px;
}

.verified-info-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.verified-info-box p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.verified-info-box p strong {
    color: var(--primary);
}

/* Success Button */
.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

/* Status Badge Active State */
.status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

/* Hide element */
.hidden {
    display: none !important;
}

/* Loading Animation for Buttons */
.btn:disabled {
    position: relative;
}

.btn:disabled .loading-spinner-btn {
    display: inline-block;
}

.loading-spinner-btn {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Router Section Highlight Styles */
h2.highlighted, h3.highlighted {
    animation: sectionHighlight 2s ease-out;
}

@keyframes sectionHighlight {
    0% {
        background: rgba(99, 102, 241, 0.2);
        padding-left: 12px;
        border-left: 4px solid var(--primary);
    }
    100% {
        background: transparent;
        padding-left: 0;
        border-left: none;
    }
}

/* Nav Link Active State */
.nav-links a.active {
    color: #fff !important;
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* Smooth section transitions */
.api-section {
    scroll-margin-top: 80px;
}

/* Install Banner */
.install-banner {
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
