/**
 * Webhook Simulation Styles
 */

/* ============================================================================
   Banner
   ============================================================================ */

.webhook-banner {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe4cc 100%);
    border-left: 4px solid #fa8c16;
    color: #873800;
}

/* ============================================================================
   Webhook URL Section
   ============================================================================ */

.webhook-url-container {
    margin-top: 12px;
}

.webhook-url-box {
    background: #1a202c;
    border: 2px solid #4a5568;
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #68d391;
    word-break: break-all;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.webhook-url-placeholder {
    color: #718096;
    font-style: italic;
}

.webhook-url-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-generate { flex: 1; }
.btn-copy { min-width: 100px; }

/* ============================================================================
   Instructions
   ============================================================================ */

.webhook-instructions {
    background: #f0f5ff;
    border: 1px solid #adc6ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.instruction-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.instruction-icon {
    font-size: 18px;
    margin-right: 8px;
}

.instruction-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d39c4;
}

.instruction-steps {
    margin: 0;
    padding: 0;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    list-style: none;
}

.instruction-step:last-child {
    margin-bottom: 0;
}

.instruction-step .step-number {
    background: #2f54eb;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 10px;
}

.instruction-step .step-text {
    color: #434343;
    font-size: 13px;
    line-height: 1.5;
}

.instruction-step .step-text strong {
    color: #1d39c4;
}

/* ============================================================================
   Event Log
   ============================================================================ */

.webhook-log-card {
    position: relative;
}

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

.log-header h3 {
    margin: 0;
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.webhook-log {
    background: #1a202c;
    border-radius: 8px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

/* Status Indicator */
.webhook-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

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

.status-disconnected {
    background: #fafafa;
    color: #8c8c8c;
}

.status-disconnected .status-dot {
    background: #bfbfbf;
}

.status-listening {
    background: #f6ffed;
    color: #389e0d;
}

.status-listening .status-dot {
    background: #52c41a;
    animation: pulse 2s infinite;
}

.status-receiving {
    background: #e6f7ff;
    color: #096dd9;
}

.status-receiving .status-dot {
    background: #1890ff;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Clear Button */
.btn-icon {
    background: transparent;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #fafafa;
    border-color: #bfbfbf;
}

/* Empty State */
.webhook-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 168px;
    color: #718096;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.empty-text {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.empty-subtext {
    font-size: 12px;
    opacity: 0.8;
    text-align: center;
    max-width: 300px;
}

/* ============================================================================
   Event Entry
   ============================================================================ */

.webhook-event {
    background: #2d3748;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    border-left: 4px solid #667eea;
}

.webhook-event:last-child {
    margin-bottom: 0;
}

.webhook-event.event-completed { border-left-color: #48bb78; }
.webhook-event.event-pending { border-left-color: #ecc94b; }
.webhook-event.event-failed { border-left-color: #fc8181; }
.webhook-event.event-refunded { border-left-color: #9f7aea; }

.webhook-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s;
}

.webhook-event-header:hover {
    background: rgba(0, 0, 0, 0.3);
}

.event-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Source Badge */
.event-source {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-source.real {
    background: #38a169;
    color: white;
}

.event-source.simulated {
    background: #718096;
    color: white;
}

/* Type Badge */
.event-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-completed { background: #48bb78; color: white; }
.badge-pending { background: #ecc94b; color: #744210; }
.badge-failed { background: #fc8181; color: white; }
.badge-refunded { background: #9f7aea; color: white; }

.event-time {
    font-size: 11px;
    color: #a0aec0;
    font-family: 'Courier New', monospace;
}

.event-toggle {
    color: #a0aec0;
    font-size: 12px;
    transition: transform 0.2s;
}

.event-toggle.expanded {
    transform: rotate(180deg);
}

/* Event Body */
.webhook-event-body {
    padding: 12px;
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.webhook-event-body.show {
    display: block;
}

.webhook-event-body pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================================================
   Simulate Section
   ============================================================================ */

.simulate-description {
    color: #666;
    font-size: 13px;
    margin: 0 0 16px 0;
}

/* ============================================================================
   About Card
   ============================================================================ */

.about-webhooks-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.about-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

.about-icon {
    font-size: 20px;
    margin-right: 10px;
}

.about-title {
    font-size: 16px;
    font-weight: 700;
    color: #343a40;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.about-description {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    margin: 0;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.about-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.about-feature .feature-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.about-feature .feature-text {
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 640px) {
    .webhook-url-actions {
        flex-direction: column;
    }

    .btn-copy {
        min-width: auto;
    }

    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .log-actions {
        width: 100%;
        justify-content: space-between;
    }

    .webhook-event {
        position: relative;
    }

    .webhook-event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .event-toggle {
        position: absolute;
        right: 12px;
        top: 12px;
    }
}
