/* GoalGPT API Portal - Styles */
/* Inspired by serper.dev and football-data.org */

:root {
    /* Colors - Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Brand colors */
    --brand-primary: #1b9136;
    --brand-primary-hover: #158a2d;
    --brand-primary-light: rgba(27, 145, 54, 0.1);
    --brand-secondary: #f4c200;
    --brand-secondary-hover: #dbb000;

    /* Status colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Spacing */
    --container-max: 1200px;
    --section-padding: 80px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}

/* Utilities */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

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

[x-cloak] { display: none !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

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

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

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

.btn-icon {
    padding: 10px;
    border-radius: var(--radius-md);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-light);
}

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

.form-error {
    margin-top: 6px;
    font-size: 13px;
    color: var(--error);
}

.form-help {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--brand-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .nav-actions .btn-secondary {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    padding: 140px 0 100px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border-radius: var(--radius-full);
}

.hero h1 {
    margin-bottom: 20px;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.hero h1 span {
    color: var(--brand-primary);
}

.hero-subtitle {
    margin-bottom: 32px;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border-color);
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.hero-stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }
}

/* ============================================
   CODE PREVIEW
   ============================================ */

.code-preview {
    max-width: 700px;
    margin: 48px auto 0;
    background: #1e293b;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #0f172a;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #ef4444; }
.code-dot.yellow { background: #f59e0b; }
.code-dot.green { background: #10b981; }

.code-tabs {
    display: flex;
    margin-left: auto;
    gap: 4px;
}

.code-tab {
    padding: 4px 12px;
    font-size: 13px;
    color: #64748b;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.code-tab.active {
    color: #f8fafc;
    background: #334155;
}

.code-body {
    padding: 20px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    overflow-x: auto;
}

.code-body .comment { color: #64748b; }
.code-body .string { color: #86efac; }
.code-body .keyword { color: #f472b6; }
.code-body .property { color: #7dd3fc; }
.code-body .number { color: #fcd34d; }

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
    padding: var(--section-padding) 0;
}

.section-header {
    max-width: 600px;
    margin: 0 auto 60px;
    text-align: center;
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--brand-primary-light);
    border-radius: var(--radius-md);
    color: var(--brand-primary);
    font-size: 24px;
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 15px;
}

@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ============================================
   PRICING SECTION
   ============================================ */

.pricing {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    position: relative;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
}

.pricing-card.popular {
    border-color: var(--brand-primary);
    transform: scale(1.05);
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
}

.pricing-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.pricing-price {
    margin-bottom: 8px;
}

.pricing-price .amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pricing-price .currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pricing-price .period {
    font-size: 1rem;
    color: var(--text-muted);
}

.pricing-credits {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
    text-align: left;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features .check {
    color: var(--success);
}

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

.pricing-card .btn {
    width: 100%;
}

@media (max-width: 992px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .pricing-card.popular {
        transform: none;
    }
}

/* ============================================
   API ENDPOINTS SECTION
   ============================================ */

.endpoints {
    padding: var(--section-padding) 0;
}

.endpoints-list {
    max-width: 800px;
    margin: 0 auto;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.endpoint-item:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.endpoint-method {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.endpoint-method.get {
    background: var(--info-bg);
    color: var(--info);
}

.endpoint-method.post {
    background: var(--success-bg);
    color: var(--success);
}

.endpoint-path {
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    color: var(--text-primary);
}

.endpoint-desc {
    margin-left: auto;
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta {
    padding: var(--section-padding) 0;
    background: var(--brand-primary);
    color: white;
    text-align: center;
}

.cta h2 {
    color: white;
    margin-bottom: 16px;
}

.cta p {
    max-width: 500px;
    margin: 0 auto 32px;
    opacity: 0.9;
}

.cta .btn-secondary {
    background: white;
    color: var(--brand-primary);
    border: none;
}

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

/* ============================================
   FOOTER
   ============================================ */

.footer {
    padding: 48px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

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

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
}

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

.footer-copy {
    font-size: 14px;
    color: var(--text-muted);
}

@media (max-width: 576px) {
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-secondary);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form .btn {
    width: 100%;
    margin-top: 8px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 16px;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: var(--bg-secondary);
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

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

.stat-card-label {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary-light);
    border-radius: var(--radius-md);
    color: var(--brand-primary);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

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

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

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

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

/* API Keys Section */
.api-keys-list {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.api-key-item {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.api-key-info {
    flex: 1;
}

.api-key-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.api-key-value {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: var(--text-muted);
}

.api-key-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.api-key-actions {
    display: flex;
    gap: 8px;
}

/* Usage Chart */
.chart-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

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

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    width: 100%;
    max-width: 500px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Toast / Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

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

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.9);
}

/* Playground */
.playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.playground-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.playground-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.playground-body {
    padding: 20px;
}

.playground-response {
    background: #1e293b;
    color: #e2e8f0;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    padding: 20px;
    min-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
}

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

/* Copy button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.copy-btn.copied {
    color: var(--success);
}
