@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@700;800&display=swap');

:root {
    --bg-core: #050505;
    --bg-surface: #0f0f0f;
    --primary: hsl(16, 100%, 50%); /* Fire orange */
    --primary-glow: rgba(255, 69, 0, 0.4);
    --accent-cyan: #00f2ff;
    --accent-purple: #bd00ff;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-light: rgba(255, 255, 255, 0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    --easing: cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

body {
    background-color: var(--bg-core);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Background elements */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.orb-primary {
    width: 40vw;
    height: 40vw;
    background: var(--primary);
    top: -10vw;
    left: -10vw;
}

.orb-purple {
    width: 30vw;
    height: 30vw;
    background: var(--accent-purple);
    bottom: 10vw;
    right: -10vw;
}

/* Layout */
.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-accent {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Navigation tabs */
.nav-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.tabs-pill {
    display: inline-flex;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    padding: 0.35rem;
    gap: 0.2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--easing);
}

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

.tab-btn.active {
    background: var(--text-main);
    color: var(--bg-core);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Main Content Views */
.view-section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.view-section.active {
    display: block;
    animation: fadeInUp 0.5s var(--easing) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: transform 0.3s var(--easing), border-color 0.3s var(--easing);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    max-width: 600px;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.3s var(--easing);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 69, 0, 0.15);
    background: #141414;
}

input::placeholder {
    color: #444;
}

.action-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 1.1rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--easing);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.action-btn:hover {
    background: hsl(16, 100%, 55%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    background: #333;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.loader-wrapper {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-left-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-text {
    transition: opacity 0.2s ease;
}

/* Output Layout */
.result-container {
    margin-top: 2rem;
    display: none;
}

.result-container.active {
    display: block;
    animation: fadeInUp 0.4s var(--easing) forwards;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.8rem;
}

.result-title {
    font-size: 0.85rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.token-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.token-copy-btn {
    white-space: nowrap;
}

.code-block {
    background: #0a0a0a;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #e5e5e5;
    overflow-x: auto;
    line-height: 1.6;
}

.payload-grid {
    display: grid;
    gap: 0.9rem;
}

.payload-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.payload-key {
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.payload-value {
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.payload-token code {
    color: #f4f4f4;
    display: block;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    overflow-x: auto;
}

.payload-pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #ddd;
}

.payload-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.payload-success {
    color: #39d98a;
    background: rgba(57, 217, 138, 0.12);
    border: 1px solid rgba(57, 217, 138, 0.35);
}

.payload-fail {
    color: #ff7070;
    background: rgba(255, 112, 112, 0.1);
    border: 1px solid rgba(255, 112, 112, 0.3);
}

.payload-null {
    color: #999;
    font-style: italic;
}

.payload-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

.json-key { color: var(--accent-cyan); }
.json-string { color: #a3be8c; }
.json-number { color: #d08770; }
.json-boolean { color: var(--accent-purple); }
.json-null { color: #bf616a; }

.error-msg {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.05);
    border: 1px solid rgba(255, 77, 77, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    display: none;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    background: rgba(20, 20, 20, 0.5);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    transition: transform 0.3s var(--easing);
}

.doc-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.2);
}

.doc-endpoint {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.9rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: #0a0a0a;
    border-radius: var(--radius-sm);
    border: 1px solid #222;
}

.doc-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.doc-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.method-tag {
    display: inline-block;
    background: rgba(0, 242, 255, 0.1);
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }
    
    .logo {
        font-size: 2.2rem;
    }
    
    .tabs-pill {
        flex-wrap: wrap;
        border-radius: var(--radius-md);
        justify-content: center;
    }
    
    .tab-btn {
        border-radius: var(--radius-sm);
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card:hover, .doc-card:hover {
        transform: none; /* Disable hover jumps on mobile */
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .token-actions {
        width: 100%;
        justify-content: flex-start;
    }
}