/* Playground New - Flat Design */

.playground-new-container {
    background: #f5f5f5;
    padding: 40px 20px;
}

.playground-new-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
}

/* Left Sidebar - Endpoints */
.endpoints-sidebar {
    background: white;
    border-radius: 8px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.endpoints-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #9ca3af;
    margin: 0 0 20px 0;
    text-transform: uppercase;
}

.endpoint-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.endpoint-card {
    background: #f9fafb;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.endpoint-card:hover {
    background: #f3f4f6;
}

.endpoint-card.active {
    background: white;
}

.endpoint-card[data-endpoint="scrape"].active {
    border-color: #fb923c;
}

.endpoint-card[data-endpoint="extract"].active {
    border-color: #3b82f6;
}

.endpoint-card[data-endpoint="serp"].active {
    border-color: #10b981;
}

.endpoint-card[data-endpoint="ai-scraper"].active {
    border-color: #ef4444;
}

.endpoint-card[data-endpoint="markdown"].active {
    border-color: #6366f1;
}

.endpoint-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.endpoint-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.endpoint-dot.orange {
    background: #fb923c;
}

.endpoint-dot.blue {
    background: #3b82f6;
}

.endpoint-dot.green {
    background: #10b981;
}

.endpoint-dot.red {
    background: #ef4444;
}

.endpoint-dot.indigo {
    background: #6366f1;
}

.endpoint-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.endpoint-description {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    padding-left: 16px;
    line-height: 1.4;
}

/* Right Panel - Form */
.form-panel {
    background: white;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.endpoint-form {
    display: none;
}

.endpoint-form.active {
    display: block;
}

.form-header {
    padding: 24px 28px;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}

.form-header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.form-header.orange .form-header-bar {
    background: #fb923c;
}

.form-header.blue .form-header-bar {
    background: #3b82f6;
}

.form-header.green .form-header-bar {
    background: #10b981;
}

.form-header.red .form-header-bar {
    background: #ef4444;
}

.form-header.indigo .form-header-bar {
    background: #6366f1;
}

.form-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
}

.form-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.form-body {
    padding: 24px 28px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.required {
    color: #ef4444;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #111827;
    transition: border-color 0.15s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
    font-family: 'Courier New', monospace;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.test-button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s ease;
}

.test-button.orange {
    background: #fb923c;
}

.test-button.orange:hover {
    background: #f97316;
}

.test-button.blue {
    background: #3b82f6;
}

.test-button.blue:hover {
    background: #2563eb;
}

.test-button.green {
    background: #10b981;
}

.test-button.green:hover {
    background: #059669;
}

.test-button.red {
    background: #ef4444;
}

.test-button.red:hover {
    background: #dc2626;
}

.test-button.indigo {
    background: #6366f1;
}

.test-button.indigo:hover {
    background: #4f46e5;
}

.test-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.test-button svg {
    flex-shrink: 0;
}

/* Messages */
.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.info-message {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.metadata-text {
    font-size: 11px;
    color: #6b7280;
    padding: 8px 0;
}

/* Results Panel */
#results-panel {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 28px;
}

.results-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.close-btn:hover {
    color: #374151;
}

.results-body {
    padding: 0 28px 28px 28px;
}

#results-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 500px;
    overflow-y: auto;
}

#results-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive */
@media (max-width: 1200px) {
    .playground-new-wrapper {
        grid-template-columns: 1fr;
    }

    .endpoints-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .playground-new-container {
        padding: 20px 10px;
    }

    .playground-new-wrapper {
        gap: 20px;
    }

    .endpoints-sidebar,
    .form-panel {
        padding: 16px;
    }

    .form-body {
        padding: 16px;
    }
}
