/* Generic Modal Styles */
.generic-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30000; /* Highest priority - above automation modal (10000) and notifications (20000) */
    padding: 20px;
}

/* Tooltip Icon Styles - moved to /css/tooltip.css for centralized management */

/* Workflow List Styles */
.workflow-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.workflow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.workflow-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--info);
}

.workflow-item:last-child {
    margin-bottom: 0;
}

.workflow-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.workflow-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 20px;
}

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

.workflow-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Button Styles - Moved to components/buttons.css */
/* All button styles consolidated in components/buttons.css */

.generic-modal-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 5px 20px var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 90vh;
    max-width: 90vw;
}

/* Size variants */
.generic-modal-content.modal-small {
    width: 400px;
    height: auto;
}

.generic-modal-content.modal-medium {
    width: 600px;
    height: auto;
}

.generic-modal-content.modal-large {
    width: 900px;
    height: 700px;
}

.generic-modal-content.modal-full {
    width: 95vw;
    height: 95vh;
}

/* Header */
.generic-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.generic-modal-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.25rem;
}

.generic-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.generic-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Body */
.generic-modal-body {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
    min-height: 0;
}

/* For iframe content */
.generic-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-secondary);
}

/* When body contains iframe, remove padding */
.generic-modal-body:has(.generic-modal-iframe) {
    padding: 0;
}

/* Footer */
.generic-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Resizable */
.generic-modal-content.resizable {
    resize: both;
    overflow: auto;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--border-color) 50%);
}

/* Responsive */
@media (max-width: 768px) {
    .generic-modal {
        padding: 10px;
    }
    
    .generic-modal-content.modal-large,
    .generic-modal-content.modal-medium {
        width: 100%;
        height: 90vh;
    }
    
    .generic-modal-header {
        padding: 1rem;
    }
    
    .generic-modal-body {
        padding: 1rem;
    }
    
    .generic-modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .generic-modal-footer .btn {
        width: 100%;
    }
}

/* Animation */
.generic-modal {
    animation: fadeIn 0.2s ease-out;
}

.generic-modal-content {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scrollbar styling for modal content */
.generic-modal-body::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.generic-modal-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.generic-modal-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
    border: 2px solid var(--bg-tertiary);
}

.generic-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Dark theme scrollbar overrides */
.dark-theme .generic-modal-body::-webkit-scrollbar-track,
.dark-mode .generic-modal-body::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.dark-theme .generic-modal-body::-webkit-scrollbar-thumb,
.dark-mode .generic-modal-body::-webkit-scrollbar-thumb {
    background: #555;
    border-color: #2a2a2a;
}

.dark-theme .generic-modal-body::-webkit-scrollbar-thumb:hover,
.dark-mode .generic-modal-body::-webkit-scrollbar-thumb:hover {
    background: #666;
}