/* Schema Generator Styles */
:root {
    --sg-primary: #10b981;
    --sg-primary-dark: #059669;
    --sg-secondary: #3b82f6;
    --sg-accent: #8b5cf6;
    --sg-bg: #ffffff;
    --sg-surface: #f8fafc;
    --sg-border: #e2e8f0;
    --sg-text: #1e293b;
    --sg-text-light: #64748b;
    --sg-radius: 12px;
    --sg-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --sg-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.schema-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--sg-text);
    line-height: 1.6;
}

/* Hero */
.sg-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.sg-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.sg-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin: 0 0 1rem;
    color: var(--sg-text);
}

.sg-subtitle {
    font-size: 1.25rem;
    color: var(--sg-text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Tool Wrapper */
.sg-tool-wrapper {
    background: var(--sg-surface);
    border-radius: var(--sg-radius);
    padding: 1.5rem;
    margin-bottom: 3rem;
    border: 1px solid var(--sg-border);
    box-shadow: var(--sg-shadow-lg);
}

.sg-layout {
    display: grid;
    grid-template-columns: 280px 1fr 400px;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .sg-layout {
        grid-template-columns: 260px 1fr;
    }
    .sg-output-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .sg-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sg-sidebar {
    background: white;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-border);
    padding: 1rem;
    height: fit-content;
}

.sg-sidebar h3 {
    font-size: 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--sg-border);
}

.sg-type-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sg-type-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: white;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sg-type-btn:hover {
    background: var(--sg-surface);
    border-color: var(--sg-border);
}

.sg-type-btn.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--sg-primary);
}

.type-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sg-surface);
    border-radius: 8px;
}

.sg-type-btn.active .type-icon {
    background: var(--sg-primary);
}

.type-info {
    display: flex;
    flex-direction: column;
}

.type-info strong {
    font-size: 0.95rem;
    color: var(--sg-text);
}

.type-info span {
    font-size: 0.8rem;
    color: var(--sg-text-light);
}

/* Main Form Area */
.sg-main {
    background: white;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-border);
    padding: 1.5rem;
}

.sg-form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sg-border);
}

.sg-form-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.sg-form-header p {
    margin: 0;
    color: var(--sg-text-light);
    font-size: 0.95rem;
}

/* Form */
.sg-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sg-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sg-field label {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sg-field label .required {
    color: var(--sg-danger);
}

.sg-field input,
.sg-field textarea,
.sg-field select {
    padding: 0.75rem;
    border: 1px solid var(--sg-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.sg-field input:focus,
.sg-field textarea:focus,
.sg-field select:focus {
    outline: none;
    border-color: var(--sg-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sg-field small {
    font-size: 0.8rem;
    color: var(--sg-text-light);
}

.sg-field-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.sg-array-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sg-array-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.sg-array-item input {
    flex: 1;
}

.sg-btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--sg-border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sg-btn-icon:hover {
    background: var(--sg-danger);
    color: white;
    border-color: var(--sg-danger);
}

.sg-add-btn {
    padding: 0.625rem;
    background: var(--sg-surface);
    border: 1px dashed var(--sg-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--sg-text-light);
    transition: all 0.2s;
}

.sg-add-btn:hover {
    border-color: var(--sg-primary);
    color: var(--sg-primary);
    background: rgba(16, 185, 129, 0.05);
}

/* Actions */
.sg-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sg-border);
}

.sg-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sg-btn-primary {
    background: linear-gradient(135deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.39);
}

.sg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.23);
}

.sg-btn-secondary {
    background: white;
    color: var(--sg-text);
    border: 1px solid var(--sg-border);
}

.sg-btn-secondary:hover {
    background: var(--sg-surface);
    border-color: var(--sg-primary);
}

.sg-btn-small {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    background: white;
    border: 1px solid var(--sg-border);
}

.sg-btn-small:hover {
    background: var(--sg-primary);
    color: white;
    border-color: var(--sg-primary);
}

/* Output Panel */
.sg-output-panel {
    background: #1e293b;
    border-radius: var(--sg-radius);
    padding: 1.5rem;
    color: white;
    display: flex;
    flex-direction: column;
}

.sg-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sg-output-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.sg-output-actions {
    display: flex;
    gap: 0.5rem;
}

.sg-code-block {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.25rem;
    overflow: auto;
    max-height: 400px;
    margin: 0 0 1rem;
    border: 1px solid #334155;
}

.sg-code-block code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.sg-validation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.sg-validation.valid {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.sg-validation.invalid {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.sg-preview {
    margin-top: 1rem;
}

.sg-preview h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #94a3b8;
}

.sg-preview-box {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    color: var(--sg-text);
}

/* Info Sections */
.sg-info-sections {
    margin-bottom: 3rem;
}

.sg-section {
    margin-bottom: 3rem;
}

.sg-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--sg-text);
}

.sg-section > p {
    color: var(--sg-text-light);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Benefits */
.sg-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.sg-benefit {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-border);
}

.sg-benefit > span {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sg-benefit strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--sg-text);
}

.sg-benefit p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--sg-text-light);
}

/* Types Grid */
.sg-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.sg-type-card {
    background: white;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-border);
    padding: 1.5rem;
    transition: all 0.3s;
}

.sg-type-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sg-shadow-lg);
}

.sg-type-card h4 {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sg-type-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--sg-text-light);
    line-height: 1.6;
}

/* Steps */
.sg-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.sg-step {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-border);
}

.step-num {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.sg-step h4 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.sg-step p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--sg-text-light);
}

/* FAQ */
.sg-faq {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.sg-faq > h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.sg-faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sg-faq-item {
    background: white;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-border);
    overflow: hidden;
}

.sg-faq-q {
    width: 100%;
    padding: 1.25rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.sg-faq-q:hover {
    background: var(--sg-surface);
}

.sg-faq-q span {
    font-size: 1.5rem;
    color: var(--sg-primary);
    transition: transform 0.3s;
}

.sg-faq-item.active .sg-faq-q span {
    transform: rotate(45deg);
}

.sg-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
    padding: 0 1.25rem;
    color: var(--sg-text-light);
    line-height: 1.7;
}

.sg-faq-item.active .sg-faq-a {
    max-height: 200px;
    padding: 0 1.25rem 1.25rem;
}

/* CTA */
.sg-cta {
    background: linear-gradient(135deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    padding: 3rem;
    border-radius: var(--sg-radius);
    text-align: center;
    box-shadow: var(--sg-shadow-lg);
}

.sg-cta h3 {
    font-size: 1.875rem;
    margin-bottom: 1rem;
}

.sg-cta > p {
    font-size: 1.125rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.sg-cta-btn {
    background: white;
    color: var(--sg-primary);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.sg-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .schema-container {
        padding: 1rem;
    }
    
    .sg-tool-wrapper {
        padding: 1rem;
    }
    
    .sg-benefits,
    .sg-types-grid,
    .sg-steps {
        grid-template-columns: 1fr;
    }
    
    .sg-field-group {
        grid-template-columns: 1fr;
    }
    
    .sg-cta {
        padding: 2rem 1.5rem;
    }
}