/* Webhook Inspector Enhanced Styles */

/* Form Panel */
.webhook-form-panel {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-small {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
}

.btn-tiny {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-copy {
    background: #10b981;
    color: white;
}

.btn-copy:hover {
    background: #059669;
}

/* Endpoint Panel */
.endpoint-panel {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.endpoint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.endpoint-header h3 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
}

.endpoint-actions {
    display: flex;
    gap: 8px;
}

/* URL Display */
.url-display {
    margin-bottom: 24px;
}

.url-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.url-container input {
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    background: #f8fafc;
    color: #1f2937;
}

.url-container input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Webhook Stats */
.webhook-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    color: #10b981;
}

.status-inactive {
    color: #ef4444;
}

/* Request Filters */
.request-filters {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row select,
.filter-row input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

.filter-row select:focus,
.filter-row input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Requests Panel */
.requests-panel {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

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

.requests-actions {
    display: flex;
    gap: 8px;
}

.requests-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Request Items */
.request-item {
    border-bottom: 1px solid #f3f4f6;
    padding: 20px 24px;
    transition: all 0.2s ease;
}

.request-item:hover {
    background: #fafbfc;
}

.request-item:last-child {
    border-bottom: none;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.request-method-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-get { background: #dbeafe; color: #1e40af; }
.method-post { background: #dcfce7; color: #166534; }
.method-put { background: #fef3c7; color: #b45309; }
.method-delete { background: #fecaca; color: #b91c1c; }
.method-patch { background: #e0e7ff; color: #3730a3; }
.method-head { background: #f3e8ff; color: #6b21a8; }
.method-options { background: #f0f9ff; color: #0c4a6e; }

.request-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
}

.request-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.request-actions {
    display: flex;
    gap: 6px;
}

.request-summary {
    margin-bottom: 12px;
}

.request-summary > div {
    margin-bottom: 6px;
    font-size: 13px;
}

.request-url,
.request-query,
.request-body-preview {
    color: #4b5563;
    word-break: break-all;
}

/* Request Details */
.request-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 16px;
    overflow: hidden;
}

.detail-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.detail-tab {
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.detail-tab:hover {
    background: #e2e8f0;
    color: #374151;
}

.detail-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
}

.detail-content {
    position: relative;
}

.detail-panel {
    display: none;
    padding: 16px;
}

.detail-panel.active {
    display: block;
}

.detail-panel pre {
    margin: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
}

.detail-panel code {
    color: #374151;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.file-info {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #6b7280;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* My Webhooks Panel */
.my-webhooks-panel {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.my-webhooks-panel h3 {
    margin: 0 0 20px 0;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
}

.webhooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.webhook-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.webhook-card:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.webhook-card h4 {
    margin: 0 0 8px 0;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
}

.webhook-url {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
    margin-bottom: 12px;
    line-height: 1.4;
}

.webhook-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.webhook-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.webhook-status.active {
    background: #d1fae5;
    color: #065f46;
}

.webhook-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Pagination */
.pagination-controls {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

#page-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .webhook-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .url-container {
        flex-direction: column;
    }
    
    .url-container input {
        margin-bottom: 8px;
    }
    
    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .request-meta {
        gap: 12px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row > * {
        width: 100%;
    }
    
    .webhooks-grid {
        grid-template-columns: 1fr;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .webhook-form-panel,
    .endpoint-panel,
    .requests-panel,
    .my-webhooks-panel {
        padding: 16px;
    }
    
    .webhook-stats {
        grid-template-columns: 1fr;
    }
    
    .request-item {
        padding: 16px;
    }
    
    .request-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}