/**
 * Papo Webhook Tester - Apple/macOS Style (WebhookCool)
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
}

.papo-webhook-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #e8e8e8 0%, #d5d5d5 100%);
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Loading */
.papo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
}

.papo-spinner {
    border: 3px solid #e0e0e0;
    border-top: 3px solid #007aff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: papo-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes papo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.papo-loading p {
    color: #666;
    font-size: 14px;
}

/* Main Content - Card Flutuante */
.papo-main-content {
    width: 100%;
    max-width: 1400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: papo-fade-in 0.4s ease;
}

@keyframes papo-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header - Estilo macOS */
.papo-webhook-header {
    background: #ffffff;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.papo-header-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Bolinhas macOS */
.papo-header-left::before {
    content: '○ ○ ○';
    color: #d5d5d5;
    font-size: 12px;
    letter-spacing: 3px;
    position: absolute;
    left: 20px;
    top: 16px;
}

.papo-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.papo-emoji {
    font-size: 26px;
    line-height: 1;
}

.papo-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #000000;
    letter-spacing: -0.3px;
}

.papo-menu-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #999;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
}

.papo-menu-btn:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
}

/* Webhook Info */
.papo-webhook-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.papo-webhook-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.papo-webhook-id-input {
    background: transparent;
    border: none;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    width: auto;
    flex: 1;
}

.papo-webhook-id-input:focus {
    outline: none;
}

.papo-icon-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.papo-icon-btn:hover {
    color: #007aff;
    background: #f5f5f5;
}

.papo-webhook-url-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
}

.papo-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #999;
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.papo-url-input:focus {
    outline: none;
    color: #000;
}

.papo-copy-url-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.papo-copy-url-btn:hover {
    color: #007aff;
}

/* Two Columns Layout */
.papo-two-columns {
    display: flex;
    height: 600px;
}

/* Sidebar (Left) - Lista branca */
.papo-sidebar {
    width: 280px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.papo-sidebar-actions {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    background: #ffffff;
}

.papo-sidebar-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #999;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.papo-sidebar-btn:hover {
    background: #f8f8f8;
    color: #666;
    border-color: #d0d0d0;
}

/* Requests List */
.papo-requests-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
}

.papo-requests-list::-webkit-scrollbar {
    width: 10px;
}

.papo-requests-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.papo-requests-list::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 5px;
}

.papo-requests-list::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.papo-empty-state-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
    text-align: center;
}

.papo-empty-state-sidebar p {
    margin: 12px 0 0 0;
    font-size: 14px;
    color: #999;
}

/* Request Item - Estilo Lista */
.papo-request-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.12s;
    background: #ffffff;
}

.papo-request-item:hover {
    background: #f8f8f8;
}

.papo-request-item.active {
    background: #e8e8e8;
}

.papo-request-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.papo-method-badge {
    background: transparent;
    color: #000000;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0px;
}

.papo-request-time {
    font-size: 11px;
    color: #aaa;
    font-family: 'SF Mono', Monaco, monospace;
    white-space: nowrap;
}

.papo-request-path {
    display: none;
}

/* Details Panel (Right) - Fundo branco limpo */
.papo-details-panel {
    flex: 1;
    background: #ffffff;
    overflow: hidden;
}

.papo-request-details {
    height: 100%;
    overflow-y: auto;
    padding: 28px 36px;
}

.papo-request-details::-webkit-scrollbar {
    width: 10px;
}

.papo-request-details::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.papo-request-details::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 5px;
}

.papo-request-details::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.papo-empty-state-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ccc;
    text-align: center;
}

.papo-empty-state-details p {
    margin: 16px 0 4px 0;
    font-size: 16px;
    color: #999;
}

.papo-empty-state-details small {
    font-size: 13px;
    color: #bbb;
}

/* Details Content */
.papo-details-content {
    max-width: 100%;
}

.papo-details-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.papo-details-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.papo-details-title h2 {
    font-size: 18px;
    margin: 0;
    color: #000;
    font-weight: 600;
}

.papo-details-meta {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #999;
}

.papo-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sections */
.papo-detail-section {
    margin-bottom: 36px;
}

.papo-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.papo-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.papo-copy-section-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.papo-copy-section-btn:hover {
    background: #f8f8f8;
    color: #000;
    border-color: #d0d0d0;
}

/* Headers Table Style */
.papo-headers-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    font-size: 13px;
}

.papo-headers-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.papo-headers-table tr:last-child {
    border-bottom: none;
}

.papo-headers-table td {
    padding: 12px 16px;
    vertical-align: top;
}

.papo-headers-table td:first-child {
    color: #666;
    font-weight: 500;
    width: 200px;
    background: #fafafa;
    font-size: 13px;
}

.papo-headers-table td:last-child {
    color: #000;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    word-break: break-all;
    line-height: 1.5;
}

/* Code Block - JSON com syntax highlight */
.papo-code-block {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 16px 18px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #000;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.papo-code-block::-webkit-scrollbar {
    height: 8px;
}

.papo-code-block::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.papo-code-block::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.papo-code-block.empty {
    color: #999;
    font-style: italic;
}

/* JSON Syntax Highlight - Cores exatas WebhookCool */
.json-key {
    color: #0066d9;
}

.json-string {
    color: #00a000;
}

.json-number {
    color: #0066d9;
}

.json-boolean {
    color: #c48700;
}

.json-null {
    color: #999;
}

/* Toast - Estilo macOS */
.papo-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.papo-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.papo-toast.success {
    background: rgba(52, 199, 89, 0.95);
    color: #fff;
}

.papo-toast.error {
    background: rgba(255, 59, 48, 0.95);
    color: #fff;
}

/* Responsive */
@media (max-width: 1200px) {
    .papo-main-content {
        max-width: 100%;
        border-radius: 0;
    }
    
    .papo-webhook-container {
        padding: 0;
    }
}

@media (max-width: 768px) {
    .papo-two-columns {
        flex-direction: column;
        height: auto;
    }
    
    .papo-sidebar {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .papo-details-panel {
        min-height: 400px;
    }
    
    .papo-header-left::before {
        content: '';
    }
    
    .papo-logo {
        margin-left: 0;
    }
}

/* Modal styles */
.papo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.papo-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: papo-modal-appear 0.3s ease;
}

@keyframes papo-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.papo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
}

.papo-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.papo-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.papo-modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.papo-modal-content {
    padding: 25px;
}

.papo-modal-content p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.papo-modal-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.papo-modal-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    color: #333;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.papo-modal-url-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.papo-modal-copy-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.papo-modal-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.papo-modal-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #667eea;
}

.papo-modal-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.papo-modal-info p:last-child {
    margin-bottom: 0;
}

.papo-modal-info strong {
    color: #667eea;
}

.papo-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
    justify-content: flex-end;
}

.papo-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.papo-modal-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.papo-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.papo-modal-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
}

.papo-modal-btn-secondary:hover {
    background: #e9ecef;
    color: #333;
}

/* Responsive modal */
@media (max-width: 768px) {
    .papo-modal {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .papo-modal-url-container {
        flex-direction: column;
    }
    
    .papo-modal-copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .papo-modal-footer {
        flex-direction: column;
    }
    
    .papo-modal-btn {
        width: 100%;
    }
}

/* Smooth animations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
