:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --bg-color: #f8fafc;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-border: rgba(0, 0, 0, 0.1);
    --text: #0f172a;
    --text-muted: #64748b;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Dynamic Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #e2e8f0 0%, var(--bg-color) 100%);
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.8;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

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

header {
    text-align: center;
    animation: fadeDown 0.8s ease-out forwards;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0 1rem;
}

/* Glass Card */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    animation: fadeUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

input,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: rgba(255, 255, 255, 0.9);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
}

select {
    appearance: none;
    cursor: pointer;
}

/* Buttons */
.submit-btn {
    margin-top: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

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

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Error Container */
.error-container {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
    padding: 1rem;
    border-radius: 8px;
    margin-top: -0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeUp 0.3s ease-out forwards;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Results Container */
.results-container {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
    animation: fadeUp 0.5s ease-out forwards;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);

}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.results-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.badge {
    background: var(--success-bg);
    color: #047857;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.icon-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.code-wrapper {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.code-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.code-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.code-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

pre {
    margin: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

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

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

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Schema Editor Styles */
.schema-editor {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.schema-editor h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.editor-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.editor-grid h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.field-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.parent-toggle {
    font-weight: 600;
    margin-top: 0.25rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.input-row input {
    padding: 0.6rem;
    font-size: 0.85rem;
}

.submit-btn.small {
    padding: 0.6rem 1rem;
    margin: 0;
}

.custom-fields-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.custom-field-tag {
    background: var(--primary-light);
    color: var(--primary-hover);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-field {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.7;
}

.remove-field:hover {
    opacity: 1;
}
