/* API Response Simulator — custom styles */

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* Card */
.card {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.card label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 0.25rem;
}

.card select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.card select:focus {
    outline: none;
    border-color: #2563eb;
}

/* Preset option */
.preset-option {
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #6b7280;
}

.preset-fields {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Schema editor */
.schema-editor {
    display: none;
}

.schema-editor.active {
    display: block;
}

.schema-editor textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    background: #f9fafb;
    color: #111827;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

.schema-editor textarea:focus {
    outline: none;
    border-color: #2563eb;
}

/* Count wrapper */
.count-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.count-wrapper input[type="range"] {
    flex: 1;
}

.count-display {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2563eb;
    min-width: 28px;
    text-align: right;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

#generateBtn {
    flex: 1;
    padding: 0.6rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

#generateBtn:hover:not(:disabled) {
    background: #1d4ed8;
}

#generateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.6rem 1rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

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

/* Output wrapper */
.output-wrapper {
    flex: 1;
}

.output-wrapper textarea {
    width: 100%;
    min-height: 300px;
    padding: 0.75rem;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    background: #f9fafb;
    color: #111827;
    resize: vertical;
    box-sizing: border-box;
}

/* Output actions */
.output-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.char-count {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.4rem;
}

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

/* How-to section */
.how-to {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.how-to h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.how-to ol {
    padding-left: 1.25rem;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.8;
    margin: 0;
}

/* FAQ section */
.faq {
    margin-bottom: 1.5rem;
}

.faq h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.faq-item {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.faq-question {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    background: #f9fafb;
    color: #111827;
}

.faq-answer {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
    border-top: 1px solid #e0e6ed;
}

/* Related section */
.related {
    margin-bottom: 1.5rem;
}

.related h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-link {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s;
}

.related-link:hover {
    background: #dbeafe;
}

/* Notification toast */
.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #059669;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Dark mode */
html[data-theme="dark"] .card,
html[data-theme="dark"] .how-to {
    background: #1f2937;
    border-color: #374151;
}

html[data-theme="dark"] .card h2,
html[data-theme="dark"] .how-to h3,
html[data-theme="dark"] .faq h3,
html[data-theme="dark"] .related h3 {
    color: #f9fafb;
}

html[data-theme="dark"] .card label {
    color: #d1d5db;
}

html[data-theme="dark"] .card select {
    background: #111827;
    color: #f9fafb;
    border-color: #374151;
}

html[data-theme="dark"] .preset-option {
    background: #374151;
    color: #9ca3af;
}

html[data-theme="dark"] .schema-editor textarea,
html[data-theme="dark"] .output-wrapper textarea {
    background: #111827;
    color: #f9fafb;
    border-color: #374151;
}

html[data-theme="dark"] .btn-secondary {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

html[data-theme="dark"] .how-to ol {
    color: #d1d5db;
}

html[data-theme="dark"] .faq-item {
    border-color: #374151;
}

html[data-theme="dark"] .faq-question {
    background: #111827;
    color: #f9fafb;
}

html[data-theme="dark"] .faq-answer {
    color: #d1d5db;
    border-color: #374151;
}

html[data-theme="dark"] .related-link {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1d4ed8;
}
