:root {
    --bg-base: #0e0a0a;
    --bg-surface: rgba(28, 20, 20, 0.65);
    --bg-surface-solid: #1c1414;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(249, 115, 22, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #857272;
    
    --color-primary: #f97316; /* Laranja vibrante */
    --color-primary-hover: #ea580c; /* Laranja escuro / Vermelho */
    --color-primary-glow: rgba(249, 115, 22, 0.35);
    
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-error: #ef4444;
    --color-error-bg: rgba(239, 68, 68, 0.1);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Layout App */
.app-container {
    display: flex;
    flex: 1;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: rgba(14, 10, 10, 0.9);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), width var(--transition-normal);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    position: absolute;
    height: 100%;
}

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

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.btn-clear-history {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-clear-history:hover {
    color: var(--color-error);
    background: var(--color-error-bg);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-history {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 0.9rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

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

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

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-payload-preview {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
}

.app-header {
    height: 72px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 10, 10, 0.4);
    backdrop-filter: blur(8px);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px var(--color-primary-glow);
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.webhook-info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 50%;
    max-width: 600px;
    min-width: 280px;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.webhook-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 6px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-fast);
}

.webhook-input:focus {
    border-color: var(--color-primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Workspace Grid */
.workspace-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    padding: 24px 32px;
    min-height: 0;
}

@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

/* Panels */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    transition: border-color var(--transition-normal);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-icon {
    color: var(--color-primary);
    display: flex;
    align-items: center;
}

.panel h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Select element template */
.select-template {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.select-template:hover {
    background: rgba(255, 255, 255, 0.08);
}

.select-template option {
    background: var(--bg-surface-solid);
    color: var(--text-primary);
}

/* Editors & Containers */
.editor-container {
    flex: 1;
    display: flex;
    position: relative;
    background: rgba(5, 5, 10, 0.3);
    min-height: 300px;
}

.line-numbers {
    width: 48px;
    padding: 16px 0;
    text-align: right;
    padding-right: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    user-select: none;
    line-height: 1.5;
}

textarea#jsonInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    padding: 16px;
    resize: none;
    line-height: 1.5;
    tab-size: 2;
    overflow-y: auto;
}

/* Validation status bar */
.validation-status-bar {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    transition: all var(--transition-normal);
}

.validation-status-bar.success {
    background: var(--color-success-bg);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.validation-status-bar.error {
    background: var(--color-error-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.success .status-indicator {
    background: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
}

.error .status-indicator {
    background: var(--color-error);
    box-shadow: 0 0 10px var(--color-error);
}

/* Action areas */
.send-action-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: flex-end;
}

/* Response panel specific */
.response-body-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(5, 5, 10, 0.3);
    overflow: auto;
    position: relative;
    min-height: 300px;
}

.response-placeholder {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    text-align: center;
    max-width: 250px;
}

.response-placeholder svg {
    color: var(--text-muted);
    opacity: 0.5;
}

.response-placeholder p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.response-code-display {
    padding: 20px;
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #fed7aa; /* Tons laranja claro */
    overflow: auto;
    width: 100%;
    height: 100%;
}

.response-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge.status-2xx {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.status-4xx, .badge.status-5xx {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.meta-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #ef4444);
    color: white;
    border: none;
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.95;
    box-shadow: 0 6px 16px var(--color-primary-glow);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary.btn-large {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon.text-danger:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

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

.loading .btn-text {
    display: none;
}

.loading .spinner {
    display: block;
}
