/* Folyamatok (Processes) Page Styles */

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.page-header-left h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    margin: 0 0 4px 0;
    color: var(--dark-color, #2c3e50);
}

.page-header-left h1 i {
    color: var(--primary-color, #49ab7c);
}

.page-description {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* === Filters Container === */
.filters-container {
    background: var(--white, #ffffff);
    padding: 1rem;
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.1));
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
    align-items: center;
}

.filters-container .search-box {
    position: relative !important;
    flex: 1;
    min-width: 300px;
    margin-bottom: 0;
}

.filters-container .search-box i {
    position: absolute;
    left: 0.85rem !important;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b !important;
    font-size: 0.95rem !important;
    pointer-events: none;
    z-index: 1;
}

.filters-container .search-box input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.35rem !important;
    border: 1px solid #ddd;
    border-radius: var(--border-radius, 8px);
    font-size: 0.95rem;
}

.filters-container .filter-group {
    display: flex;
    flex-direction: row !important;
    gap: 0.75rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
}

.filters-container .filter-group select {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius, 8px);
    font-size: 0.95rem;
    background: var(--white, #ffffff);
    min-width: 150px;
}

.filters-container .filter-group select:focus {
    outline: none;
    border-color: var(--primary-color, #49ab7c);
}

/* === Page Content === */
.page-content {
    padding: 0 2rem 2rem 2rem;
}

/* === Process Cards Grid === */
.processes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    padding: 1rem !important;
    background: var(--white, #ffffff);
    border: 1px solid #d8e2ee;
    border-top: 0;
    border-radius: 0 0 var(--border-radius, 8px) var(--border-radius, 8px);
    box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.1));
}

/* Card Style */
.process-card {
    background: var(--white, #ffffff);
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.1));
    transition: all 0.2s ease;
    overflow: hidden;
}

.process-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.process-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.process-card-title {
    flex: 1;
}

.process-card-title h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--dark-color, #2c3e50);
    font-weight: 600;
}

.process-card-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #333;
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.process-card-body {
    padding: 1rem 1.25rem;
    cursor: pointer;
}

.process-description {
    color: #555;
    margin: 0 0 1rem 0;
    line-height: 1.6;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-muted {
    color: #999 !important;
    font-style: italic;
}

.process-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

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

.meta-item i {
    font-size: 0.8rem;
    color: #999;
}

/* === Badges === */
.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-draft {
    background: #f0f0f0;
    color: #666;
}

.status-active {
    background: rgba(73, 171, 124, 0.1);
    color: var(--primary-color, #49ab7c);
}

.status-archived {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* === Empty State === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--white, #ffffff);
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.1));
}

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--dark-color, #2c3e50);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.empty-state p {
    color: #666;
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
}

/* === Loading State === */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.loading-state p {
    margin-top: 1rem;
    color: #666;
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white, #ffffff);
    border-radius: var(--border-radius, 8px);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color, #2c3e50);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* === Form Styles === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color, #2c3e50);
    font-size: 0.9rem;
}

.required {
    color: #e74c3c;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius, 8px);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #49ab7c);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .processes-grid {
        grid-template-columns: 1fr;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-container .search-box {
        min-width: 100%;
    }

    .filters-container .filter-group {
        flex-direction: column;
    }

    .filters-container .filter-group select {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ============================================
   PROCESS DETAIL VIEW
   ============================================ */

.process-detail-view {
    background: #f8f9fa;
    min-height: calc(100vh - 200px);
    border-radius: 8px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.detail-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    font-size: 0.9rem;
}

.btn-back:hover {
    background: #e5e7eb;
}

.detail-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.detail-status {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(73, 171, 124, 0.1);
    color: #49ab7c;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.detail-header-right {
    display: flex;
    gap: 0.75rem;
}

.btn-icon-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-icon-text:hover {
    background: #e5e7eb;
}

.btn-icon-text.btn-primary {
    background: #49ab7c;
    border-color: #49ab7c;
    color: white;
}

.detail-content {
    display: flex;
    height: calc(100vh - 280px);
    min-height: 500px;
    overflow: hidden;
}

.detail-content.is-resizing {
    cursor: col-resize;
}

.detail-content.detail-inspector-hidden .panel-resizer,
.detail-content.detail-inspector-hidden .detail-panel-right {
    display: none;
}

.detail-content.detail-inspector-hidden .detail-panel-left {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border-right: none;
}

.detail-panel {
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 0;
}

.detail-panel-left {
    flex: 0 0 42%;
    border-right: 1px solid #e5e7eb;
    min-width: 340px;
}

.detail-panel-right {
    flex: 1 1 0;
    min-width: 420px;
}

#btnCloseStepInspector {
    display: none;
}


.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.step-view-toggle {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    gap: 0.2rem;
}

.btn-step-view {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-step-view:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #374151;
}

.btn-step-view.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.btn-tool {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
}

.btn-tool:hover {
    background: #e5e7eb;
}

.btn-add-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #49ab7c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-reorder-steps {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reorder-steps:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.btn-reorder-steps.active {
    background: #49ab7c;
    border-color: #49ab7c;
    color: #ffffff;
}

.bpmn-container {
    flex: 1;
    overflow: auto;
    padding: 1.25rem;
    background:
        radial-gradient(circle at top left, rgba(73, 171, 124, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.bpmn-placeholder {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.75);
}

.placeholder-content {
    text-align: center;
    color: #94a3b8;
}

.placeholder-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.placeholder-content h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #64748b;
}

.placeholder-content p {
    margin: 0 0 2rem;
    font-size: 0.9rem;
}

.placeholder-nodes {
    display: flex;
    align-items: center;
    justify-content: center;
}

.node {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.node-start {
    background: linear-gradient(135deg, #49ab7c, #3d9168);
    box-shadow: 0 4px 12px rgba(73, 171, 124, 0.3);
}

.node-task {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.node-gateway {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: rotate(45deg);
    border-radius: 6px;
}

.node-end {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.node-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #cbd5e1, #94a3b8);
}

.diagram-board {
    min-width: 100%;
    min-height: 100%;
    overflow: auto;
    cursor: grab;
    scrollbar-gutter: stable both-edges;
}

.diagram-board.diagram-panning {
    cursor: grabbing;
    user-select: none;
}

.diagram-surface {
    position: relative;
    display: inline-block;
    min-width: 100%;
    min-height: 100%;
    padding: 1rem;
}

.diagram-content {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    gap: 3rem;
    min-width: 100%;
    min-height: 100%;
}

.diagram-connections {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.diagram-path {
    fill: none;
    stroke: #9fb6c8;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.95;
}

.diagram-sequence {
    display: inline-flex;
    align-items: flex-start;
    gap: 2.5rem;
    width: max-content;
    min-width: 100%;
}

.diagram-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    min-width: 250px;
}

.diagram-node {
    position: relative;
    width: 250px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 1rem 1rem 1.05rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.diagram-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.diagram-node.selected {
    border-color: #49ab7c;
    box-shadow: 0 0 0 4px rgba(73, 171, 124, 0.14), 0 18px 34px rgba(15, 23, 42, 0.12);
}

.diagram-node-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(15, 23, 42, 0.08);
    color: #475569;
}

.diagram-node-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.diagram-node-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #475569;
}

.diagram-node-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.diagram-node-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.diagram-node-start {
    border-radius: 999px;
    border-color: rgba(73, 171, 124, 0.35);
    background: linear-gradient(145deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.96));
}

.diagram-node-start .diagram-node-badge {
    background: rgba(73, 171, 124, 0.12);
    color: #15803d;
}

.diagram-node-task {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
}

.diagram-node-task .diagram-node-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.diagram-node-document {
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(236, 254, 255, 0.98), rgba(207, 250, 254, 0.96));
    border-color: rgba(6, 182, 212, 0.28);
}

.diagram-node-document .diagram-node-badge {
    background: rgba(6, 182, 212, 0.12);
    color: #0f766e;
}

.diagram-node-optional {
    border-style: dashed;
    border-color: rgba(6, 182, 212, 0.35);
    background: linear-gradient(145deg, rgba(248, 250, 252, 0.98), rgba(236, 254, 255, 0.95));
}

.diagram-node-optional .diagram-node-badge {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
}

.diagram-node-gateway {
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.96));
    border-color: rgba(245, 158, 11, 0.35);
}

.diagram-node-gateway .diagram-node-badge {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.diagram-node-end {
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(254, 242, 242, 0.98), rgba(254, 226, 226, 0.96));
    border-color: rgba(239, 68, 68, 0.32);
}

.diagram-node-end .diagram-node-badge {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.diagram-node-subprocess {
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(245, 243, 255, 0.99), rgba(237, 233, 254, 0.96));
    border-color: rgba(139, 92, 246, 0.32);
}

.diagram-node-subprocess .diagram-node-badge {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.diagram-children {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem 1rem 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.5);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
}

.diagram-children-subprocess {
    background: rgba(245, 243, 255, 0.62);
    border-color: rgba(139, 92, 246, 0.3);
}

.diagram-group-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.diagram-group-label::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
}

.panel-resizer {
    width: 8px;
    background: #f3f4f6;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resizer-handle {
    width: 4px;
    height: 40px;
    background: #d1d5db;
    border-radius: 2px;
}

.flow-steps-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.flow-step {
    display: flex;
    gap: 1rem;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #49ab7c, #3d9168);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.step-number-end {
    background: linear-gradient(135deg, #10b981, #059669);
}

.step-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(180deg, #49ab7c, #e5e7eb);
    margin: 8px 0;
    min-height: 20px;
}

.step-content {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.step-content:hover {
    border-color: #49ab7c;
    box-shadow: 0 4px 12px rgba(73, 171, 124, 0.1);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.step-structure-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.35rem;
}

.step-structure-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.step-structure-btn:hover:not(:disabled) {
    background: #e5e7eb;
    color: #374151;
}

.step-structure-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.flow-steps-container:not(.reorder-mode) .step-structure-controls {
    display: none;
}

.step-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 0.35rem;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: grab;
    transition: all 0.2s;
}

.flow-steps-container:not(.reorder-mode) .step-drag-handle {
    display: none;
}

.step-drag-handle:hover {
    background: #e5e7eb;
    color: #374151;
}

.step-drag-handle:active {
    cursor: grabbing;
}

.step-type {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.step-type-start {
    background: rgba(73, 171, 124, 0.1);
    color: #49ab7c;
}

.step-type-task {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.step-type-gateway {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.step-type-end {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.step-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.step-content:hover .step-actions {
    opacity: 1;
}

.btn-step-action {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
}

.step-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.step-description {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.step-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.step-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.step-links {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e5e7eb;
}

.step-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
}

.step-branches {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-branch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.branch-yes {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.branch-no {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

/* Step Detail Panel */
.step-detail-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.step-detail-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #9ca3af;
    padding: 3rem;
}

.step-detail-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.step-detail-empty h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #6b7280;
}

.step-detail-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.step-detail-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.detail-step-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-label i {
    font-size: 0.75rem;
}

.detail-text {
    margin: 0;
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
}

.detail-value {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
}

.detail-branches {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-notes {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

.detail-notes:focus {
    outline: none;
    border-color: #49ab7c;
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Selected Step Highlight */
.step-content.selected {
    border-color: #49ab7c;
    background: rgba(73, 171, 124, 0.05);
    box-shadow: 0 0 0 3px rgba(73, 171, 124, 0.1);
}

@media (max-width: 768px) {
    .detail-content {
        flex-direction: column;
        height: auto;
    }

    .detail-panel-right {
        max-width: 100%;
    }

    .panel-resizer {
        display: none;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .step-view-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .btn-step-view {
        flex: 1;
        justify-content: center;
    }

    .diagram-sequence {
        flex-direction: column;
        width: 100%;
    }

    .diagram-stage,
    .diagram-node {
        width: min(100%, 320px);
        min-width: 0;
    }

    .diagram-children {
        width: 100%;
    }
}

/* Step Type Selector in Modal */
.step-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.type-option {
    position: relative;
    cursor: pointer;
}

.type-option input {
    position: absolute;
    opacity: 0;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.type-card i {
    font-size: 1.25rem;
}

.type-option input:checked+.type-card {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.type-card.start i {
    color: #49ab7c;
}

.type-card.task i {
    color: #3b82f6;
}

.type-card.gateway i {
    color: #f59e0b;
}

.type-card.end i {
    color: #ef4444;
}

.type-option input:checked+.type-card.start {
    border-color: #49ab7c;
    background: rgba(73, 171, 124, 0.1);
}

.type-option input:checked+.type-card.task {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.type-option input:checked+.type-card.gateway {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.type-option input:checked+.type-card.end {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.type-card.subprocess i {
    color: #8b5cf6;
}

.type-option input:checked+.type-card.subprocess {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

/* Nested Steps for Subprocess */
.nested-steps-container {
    margin-left: 20px;
    border-left: 2px dashed #e5e7eb;
    padding-left: 10px;
    margin-top: 10px;
    min-height: 12px;
}

.nested-steps-container.is-empty {
    min-height: 56px;
}

.nested-steps-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0.75rem;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 0.85rem;
}

.nested-steps-container .sortable-ghost .step-content,
.flow-steps-container .sortable-ghost .step-content {
    opacity: 0.45;
}

.nested-steps-container .sortable-drag .step-content,
.flow-steps-container .sortable-drag .step-content {
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.nested-steps-container.sortable-drag,
.flow-steps-container.sortable-drag {
    cursor: grabbing;
}

/* Process Card Icon Styles */
.process-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.process-icon-main {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Icon Selector Styles */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.icon-option {
    cursor: pointer;
}

.icon-option input {
    display: none;
}

.icon-card {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #6b7280;
    transition: all 0.2s;
}

.icon-option:hover .icon-card {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.icon-option input:checked+.icon-card {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.step-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0 5px;
    margin-right: 5px;
    transition: transform 0.2s;
}

.step-toggle-btn.expanded {
    transform: rotate(90deg);
}

.step-toggle-btn:hover {
    color: #3b82f6;
}

/* Icon Search Styles */
.icon-search-container {
    margin-bottom: 15px;
}

.icon-search-container .input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.icon-search-container .input-group-prepend {
    margin-right: -1px;
    display: flex;
}

.icon-search-container .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px 0 0 8px;
}

.icon-search-container .form-control {
    border-radius: 0 8px 8px 0;
    flex: 1;
}

.icon-selector {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f3f4f6;
}

.icon-selector::-webkit-scrollbar {
    width: 6px;
}

.icon-selector::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.icon-selector::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.step-type-card.subprocess {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.type-card.optional i {
    color: #06b6d4;
}

.type-option input:checked+.type-card.optional {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
}

/* Sub-process visual separation */
.nested-steps-container .step-number {
    background: linear-gradient(135deg, #58bdda, #3eaecf);
}

.nested-steps-container .step-line {
    background: linear-gradient(180deg, #58bdda, #e5e7eb);
}

/* Optional: Different hover effect for sub-steps */
.nested-steps-container .step-content:hover {
    border-color: #58bdda;
    box-shadow: 0 4px 12px rgba(88, 189, 218, 0.1);
}

/* Detail Link Card */
.detail-link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.detail-link-card:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #111827;
}

.detail-link-card .link-icon {
    color: #4b5563;
    font-size: 1.1rem;
}

.detail-link-card .link-text {
    font-weight: 500;
}

/* Step Link Badge */
.step-owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: #ecfdf5;
    color: #047857;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.step-owner-badge i {
    font-size: 0.75rem;
}

.step-link-badge {
    display: inline-block;
    margin-top: 0.5rem;
}

.step-link-badge a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.step-link-badge a:hover {
    background: #e0e7ff;
}

.step-link-badge i {
    font-size: 0.75rem;
}

/* Step Image Badge */
.step-image-badge {
    display: inline-block;
    margin-right: 0.5rem;
    cursor: pointer;
}

.step-image-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: #fdf2f8;
    /* Pinkish background */
    color: #db2777;
    /* Pink text */
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}

.step-image-badge:hover {
    background: #fce7f3;
}

.step-image-badge i {
    font-size: 0.75rem;
}

/* Image Gallery Styles */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #dc3545;
    font-size: 12px;
}

.gallery-remove:hover {
    background: #fff;
    color: #a71d2a;
}

.type-card.document i {
    color: #0891b2;
}

.type-option input:checked+.type-card.document {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
}

.node-document {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    border-radius: 4px;
    /* Slightly different shape? or just round/square */
}

.step-type-document {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
