﻿/* WorkflowList.css v9 */

/* Base Variables - WorkflowList Page-Specific */
.workflow-container {
    --wf-primary-color: #4a90e2;
    --wf-success-color: #28a745;
    --wf-warning-color: #ffc107;
    --wf-danger-color: #dc3545;
    --wf-info-color: #17a2b8;
    --wf-dark-color: #2c3e50;
    --wf-light-gray: #f8f9fa;
    --wf-border-color: #e9ecef;
    --wf-text-muted: #6c757d;
    --wf-shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --wf-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --wf-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --wf-transition: all 0.2s ease;
    
}

/* Container */
.workflow-container {
    padding: 10px 1.5rem 1.5rem 1.5rem; 
    max-width: 1400px;
    margin: 0 auto;
}

/* Modern Header */
.workflow-header {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--wf-shadow-sm);
    position: relative; /* Ensure it's contained!!! */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-title .page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--wf-dark-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--wf-primary-color);
    font-size: 2rem;
}

.page-subtitle {
    color: var(--wf-text-muted);
    margin: 0.25rem 0 0 0;
    font-size: 1rem;
}

/* Create Button */
.btn-create {
    background: var(--wf-primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--wf-transition);
    box-shadow: var(--wf-shadow-sm);
}

    .btn-create:hover {
        background: #3a7bc8;
        transform: translateY(-2px);
        box-shadow: var(--wf-shadow-md);
    }

    .btn-create i {
        font-size: 1.125rem;
    }

/* Filter Bar */
.filter-bar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--wf-shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Status Pills */
.status-pills {
    display: flex;
    background: var(--wf-light-gray);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.pill-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wf-text-muted);
    cursor: pointer;
    transition: var(--wf-transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

    .pill-btn:hover {
        background: rgba(0,0,0,0.05);
    }

    .pill-btn.active {
        background: white;
        color: var(--wf-dark-color);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.pill-count {
    background: rgba(0,0,0,0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pill-btn.active .pill-count {
    background: var(--wf-primary-color);
    color: white;
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wf-text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 2px solid var(--wf-border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: var(--wf-transition);
}

    .search-input:focus {
        outline: none;
        border-color: var(--wf-primary-color);
        box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    }

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--wf-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--wf-transition);
}

    .search-clear:hover {
        color: var(--wf-dark-color);
    }

/* Icon Button */
.btn-icon {
    background: white;
    border: 2px solid var(--wf-border-color);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--wf-transition);
    position: relative;
}

    .btn-icon:hover {
        border-color: var(--wf-primary-color);
        color: var(--wf-primary-color);
    }

.filter-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--wf-danger-color);
    border-radius: 50%;
    border: 2px solid white;
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--wf-shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-content {
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--wf-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wf-dark-color);
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--wf-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--wf-transition);
}

    .btn-close:hover {
        color: var(--wf-dark-color);
    }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.options-section {
    margin-bottom: 2rem;
}

    .options-section:last-child {
        margin-bottom: 1rem;
    }

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--wf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Toggle Switch */
.toggle-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

    .toggle-option input {
        display: none;
    }

.toggle-slider {
    width: 48px;
    height: 24px;
    background: var(--wf-border-color);
    border-radius: 24px;
    position: relative;
    transition: var(--wf-transition);
}

    .toggle-slider::after {
        content: '';
        width: 18px;
        height: 18px;
        background: white;
        border-radius: 50%;
        position: absolute;
        top: 3px;
        left: 3px;
        transition: var(--wf-transition);
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

.toggle-option input:checked + .toggle-slider {
    background: var(--wf-primary-color);
}

    .toggle-option input:checked + .toggle-slider::after {
        transform: translateX(24px);
    }

.toggle-label {
    font-size: 0.875rem;
    color: var(--wf-dark-color);
}

/* Custom Checkbox */
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 0;
}

    .checkbox-option input {
        display: none;
    }

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--wf-border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--wf-transition);
}

.checkbox-option input:checked + .checkbox-custom {
    background: var(--wf-primary-color);
    border-color: var(--wf-primary-color);
}

    .checkbox-option input:checked + .checkbox-custom::after {
        content: '\2713';
        position: absolute;
        color: white;
        font-size: 14px;
        font-weight: bold;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

.checkbox-option span:last-child {
    font-size: 0.875rem;
    color: var(--wf-dark-color);
}

.checkbox-option i {
    font-size: 1.125rem;
}

/* Table Wrapper */
.workflow-table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: visible;
    box-shadow: var(--wf-shadow-sm);
}

/* Workflow Table */
.workflow-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
}

    .workflow-table thead {
        background: var(--wf-light-gray);
        border-bottom: 2px solid var(--wf-border-color);
    }

    .workflow-table th {
        padding: 1rem 1.5rem;
        text-align: left;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--wf-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.sortable {
    cursor: pointer;
    user-select: none;
}

    .sortable:hover .th-content {
        color: var(--wf-dark-color);
    }

.th-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .th-content i {
        font-size: 0.625rem;
        opacity: 0.5;
    }

/* Workflow Table Body */
.workflow-table tbody tr {
    border-bottom: 1px solid var(--wf-border-color);
    transition: var(--wf-transition);
}

    .workflow-table tbody tr:hover {
        background: var(--wf-light-gray);
    }

    .workflow-table tbody tr.inactive td {
        color: rgba(0, 0, 0, 0.6);
    }

    .workflow-table tbody tr.inactive .workflow-title,
    .workflow-table tbody tr.inactive .workflow-description,
    .workflow-table tbody tr.inactive .meta-item,
    .workflow-table tbody tr.inactive .workflow-id,
    .workflow-table tbody tr.inactive .steps-count,
    .workflow-table tbody tr.inactive .status-indicator {
        opacity: 0.7;
    }

    /* Keep dropdown at full opacity even in inactive rows - so it doesn't bleed up from our .inactive parent dimming */
    .workflow-table tbody tr.inactive .dropdown,
    .workflow-table tbody tr.inactive .dropdown-menu,
    .workflow-table tbody tr.inactive .btn-action {
        opacity: 1;
    }

.workflow-table td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
}

/* Workflow Column Styles */
.col-id {
    width: 80px;
}

.workflow-id {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    color: var(--wf-text-muted);
    font-weight: 600;
}

.col-name {
    min-width: 300px;
}

.workflow-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.workflow-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.workflow-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wf-dark-color);
    margin: 0;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wf-transition);
}

    .status-badge.active {
        background: rgba(40, 167, 69, 0.1);
        color: var(--wf-success-color);
    }

        .status-badge.active:hover {
            background: rgba(40, 167, 69);
            color: white;
        }

    .status-badge.inactive {
        background: rgba(255, 193, 7, .50);
        color: darkgrey;
    }

        .status-badge.inactive:hover {
            background: rgba(255, 193, 7, 1);
            color: #44494e;
        }

    .status-badge i {
        font-size: 1rem;
    }

.workflow-description {
    font-size: 0.875rem;
    color: var(--wf-text-muted);
    margin: 0;
    line-height: 1.5;
}

.workflow-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--wf-text-muted);
}

    .meta-item i {
        font-size: 0.875rem;
    }

.workflow-tag {
    background: var(--wf-primary-color);
    color: white;
    padding: 0.125rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Features Column */
.col-features {
    width: 140px;
}

.feature-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.feature-badge {
    width: 32px;
    height: 32px;
    background: var(--wf-light-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wf-transition);
}

    .feature-badge:hover {
        transform: scale(1.1);
    }

    .feature-badge i {
        font-size: 1rem;
    }

/* Steps Column */
.col-steps {
    width: 100px;
}

.steps-count {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--wf-light-gray);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wf-dark-color);
}

    .steps-count i {
        font-size: 0.875rem;
        color: var(--wf-text-muted);
    }

/* Status Column */
.col-status {
    width: 200px;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-info.published .status-indicator {
    color: var(--wf-success-color);
}

.status-info.draft .status-indicator {
    color: var(--wf-warning-color);
}

.status-indicator i {
    font-size: 1rem;
}

.status-dates {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

    .status-dates small {
        font-size: 0.75rem;
        color: var(--wf-text-muted);
    }

.date-modified {
    font-weight: 600;
    cursor: pointer;
}

.date-published {
    cursor: pointer;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-action {
    background: white;
    border: 2px solid var(--wf-border-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--wf-transition);
    position: relative;
}

    .btn-action:hover {
        transform: translateY(-2px);
        box-shadow: var(--wf-shadow-sm);
    }

    .btn-action.primary {
        border-color: var(--wf-primary-color);
        color: var(--wf-primary-color);
    }

        .btn-action.primary:hover {
            background: var(--wf-primary-color);
            color: white;
        }

    .btn-action.info {
        border-color: var(--wf-info-color);
        color: var(--wf-info-color);
    }

        .btn-action.info:hover {
            background: var(--wf-info-color);
            color: white;
        }

    .btn-action.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

        .btn-action.disabled:hover {
            transform: none;
            box-shadow: none;
            background: white;
            color: var(--wf-info-color);
        }

    .btn-action i {
        font-size: 1rem;
    }

.action-count {
    position: absolute;
    top: -8px;
    right: -8px;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

    .action-count.inactive {
        background: var(--wf-warning-color) !important;
    }
    .action-count.active {
        background: var(--wf-success-color) !important;
    }

/* Dropdown - Workflow specific */
.workflow-table .dropdown {
    position: relative;
}

.workflow-table .dropdown-toggle {
    background: white;
}

.workflow-table .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--wf-shadow-lg);
    min-width: 180px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: var(--wf-transition);
}

    .workflow-table .dropdown-menu.show {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }

.workflow-table .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: var(--wf-transition);
    font-size: 0.875rem;
    color: var(--wf-dark-color);
}

    .workflow-table .dropdown-item:hover {
        background: var(--wf-light-gray);
    }

    .workflow-table .dropdown-item i {
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }

.workflow-table .dropdown-divider {
    height: 1px;
    background: var(--wf-border-color);
    margin: 0.5rem 0;
}

.workflow-table .dropdown-item.danger {
    color: var(--wf-danger-color);
}

    .workflow-table .dropdown-item.danger:hover {
        background: rgba(220, 53, 69, 0.1);
    }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: var(--wf-border-color);
    margin-bottom: 1.5rem;
}

.empty-state h5 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wf-dark-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--wf-text-muted);
    margin-bottom: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .workflow-container {
        padding: 90px 1rem 1rem 1rem; 
    }

    .col-name {
        min-width: 250px;
    }

    .workflow-header-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .btn-create {
        width: 100%;
        justify-content: center;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .status-pills {
        width: 100%;
        justify-content: center;
    }

    .search-wrapper {
        max-width: none;
    }

    .workflow-table {
        font-size: 0.875rem;
    }

        .workflow-table th,
        .workflow-table td {
            padding: 0.75rem;
        }

    .action-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .workflow-table-wrapper {
        overflow-x: auto;
    }

    .workflow-table {
        min-width: 800px;
    }

    .modal-dialog {
        margin: 1rem;
        width: auto;
    }
}

/* Print Styles */
@media print {
    .workflow-header,
    .filter-bar,
    .col-actions,
    .btn-action {
        display: none !important;
    }

    .workflow-table {
        font-size: 10pt;
    }

        .workflow-table tbody tr {
            border-bottom: 1px solid #ddd;
        }
}

/* Loading State */
.quote-footer {
    margin-top: 1.5rem;
    font-style: italic;
    color: var(--wf-text-muted);
    font-size: 0.875rem;
}

    .quote-footer i {
        margin-right: 0.5rem;
    }
