/* Process Management Styles */

/* Draggable items */
.draggable {
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.draggable.selected {
    outline: 2px solid #3b82f6;
}

/* Droppable areas */
.droppable {
    transition: background-color 0.3s;
}

.droppable.drag-over {
    background-color: #dbeafe;
}

/* Requirement indicators */
.requirement-indicator {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.requirement-indicator:hover {
    transform: scale(1.1);
}

.requirement-tooltip {
    white-space: nowrap;
    z-index: 1000;
    min-width: max-content;
}

.requirement-tooltip br {
    display: block;
    content: "";
    margin: 2px 0;
}

/* Sliding window */
#requirement-details-window {
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

/* Tab buttons */
.tab-button {
    transition: background-color 0.3s, color 0.3s;
}

.tab-button:hover {
    background-color: #e5e7eb;
}

.tab-button.active {
    background-color: #3b82f6;
    color: white;
}

/* Toggle sections */
.toggle-content {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

/* Remove button */
.remove-from-step-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-from-step-btn:hover {
    opacity: 1;
}

/* Filter controls */
.filter-controls {
    gap: 0.5rem;
}

/* Process choice dropdown */
#process-choice {
    transition: border-color 0.3s;
}

#process-choice:focus {
    border-color: #3b82f6;
    outline: none;
    ring: 2px;
    ring-color: #93c5fd;
}

/* Save button states */
#save-process {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#save-process:hover {
    transform: translateY(-1px);
}

/* Unsaved changes indicator */
.unsaved-indicator {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Orange button for unsaved state */
.bg-orange-500 {
    background-color: #f97316;
}

.hover\:bg-orange-600:hover {
    background-color: #ea580c;
}

/* Step name editing */
.step-name-input {
    transition: all 0.3s ease;
    min-width: 200px;
}

.step-name-input:hover {
    background-color: #f8fafc;
}

.step-name-input:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.step-name-input.step-name-changed {
    background-color: #fef3c7;
    border-color: #f59e0b;
}

.step-name-input.step-name-changed:focus {
    background-color: #fffbeb;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
}

/* Modal styles */
#requirement-details-modal {
    backdrop-filter: blur(2px);
}

#requirement-details-modal .bg-white {
    max-width: 70%;
    max-height: 90%;
    min-width: 65%;
    min-height: 60%;
}

/* Ensure tab content is scrollable */
#requirement-details-modal #tab-content {
    max-height: calc(100vh - 300px);
    min-height: 400px;
}

/* Improve scrollbar styling for modal content */
#requirement-details-modal #tab-content::-webkit-scrollbar {
    width: 8px;
}

#requirement-details-modal #tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#requirement-details-modal #tab-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#requirement-details-modal #tab-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure modal content doesn't overflow */
#requirement-details-modal .tab-content {
    overflow-y: auto;
    padding-right: 8px;
}

/* Chat messages container in modal */
#requirement-details-modal #modal-chat-messages {
    max-height: 400px;
    overflow-y: auto;
}

/* Prevent modal backdrop from being scrollable */
body.modal-open {
    overflow: hidden !important;
}

/* Info popup modal (fallback) styles */
#info-popup-modal {
    backdrop-filter: blur(2px);
}

#info-popup-modal .modal-content-scrollable {
    max-width: 70%;
    min-width: 65%;
}

/* Ensure modal backdrop click area extends to edges */
#info-popup-modal,
#requirement-details-modal {
    padding: 1rem;
}

/* Responsive modal sizing */
@media (max-width: 768px) {
    #requirement-details-modal .bg-white,
    #info-popup-modal .modal-content-scrollable {
        max-width: 95%;
        min-width: 90%;
        max-height: 95%;
    }
    
    #requirement-details-modal #tab-content {
        max-height: calc(100vh - 200px);
    }
}