/* n8n Integration Styles */

.n8n-status-panel {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    overflow: hidden;
}

.status-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
}

.status-badge.connected {
    background: rgba(16, 185, 129, 0.3);
}

.status-badge.disconnected {
    background: rgba(239, 68, 68, 0.3);
}

.status-badge i {
    font-size: 0.6rem;
}

.status-details {
    padding: 1.5rem 2rem;
    display: grid;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.status-item .label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.status-item .value {
    font-weight: 500;
    color: var(--text);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-actions {
    padding: 0 2rem 1.5rem;
}

/* Section Title */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--primary);
}

/* Workflows Grid */
.workflows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.workflow-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.workflow-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.workflow-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--wf-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.workflow-info {
    flex: 1;
    min-width: 0;
}

.workflow-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.workflow-info p {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.workflow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.workflow-tags .tag {
    padding: 0.2rem 0.6rem;
    background: var(--bg);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.workflow-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.status-dot.active {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.status-dot.inactive {
    background: #ef4444;
}

/* Actions Panel */
.actions-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.action-card:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.action-card i {
    font-size: 1.75rem;
    color: var(--primary);
}

.action-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    text-align: center;
}

/* Result Panel */
.result-panel {
    background: var(--card);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.result-header {
    background: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-panel pre {
    margin: 0;
    padding: 1.5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 400px;
}

.btn-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(255,255,255,0.1);
}

/* Docs Panel */
.docs-panel {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.docs-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.docs-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.docs-section h3 i {
    color: var(--primary);
}

.docs-section p {
    margin: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 6px;
}

.endpoint .method {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.endpoint .method.get {
    background: #10b981;
    color: white;
}

.endpoint .method.post {
    background: #3b82f6;
    color: white;
}

.endpoint .method.put {
    background: #f59e0b;
    color: white;
}

.endpoint .method.delete {
    background: #ef4444;
    color: white;
}

.endpoint code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text);
}

.docs-section details {
    margin-top: 1rem;
}

.docs-section summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
    padding: 0.5rem 0;
}

.docs-section ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.docs-section li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.docs-section li code {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 50vh;
}

.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--bg);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Button Variants */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Status Message */
.status-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: none;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
    display: block;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
    display: block;
}

.status-message.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #2563eb;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .workflows-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .status-item .value {
        max-width: 100%;
    }
    
    .modal-content {
        width: 95%;
    }
}
