﻿/* WorkflowResultsList.css */
.workflow-results-page {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 0.75rem 0;
}

    .workflow-results-page .page-header {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: white;
        padding: 2rem;
        border-radius: 10px;
        margin-bottom: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .workflow-results-page .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .workflow-results-page .header-title h1 {
        margin: 0;
        font-size: 2rem;
        font-weight: 300;
    }

    .workflow-results-page .header-title p {
        margin: 0.5rem 0 0 0;
        opacity: 0.9;
        font-size: 1.1rem;
    }

    .workflow-results-page .header-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    /* Compact View */
    .workflow-results-page .page-header.compact {
        padding: 0.75rem 1.5rem;
        margin-bottom: 1rem;
    }

.compact-bar {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 1rem;
    height: 2.5rem;
}

.compact-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compact-icon {
    font-size: 1.25rem;
}

.compact-title {
    font-size: 1.25rem;
    font-weight: 500;
    white-space: nowrap;
}

.compact-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.filter-indicator {
    color: #ffc107;
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

.colfilter-indicator {
    color: #e4a023;
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.stat-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

    .stat-bubble.primary {
        background: rgba(99, 102, 241, 0.3);
    }

    .stat-bubble.success {
        background: rgba(34, 197, 94, 0.3);
    }

    .stat-bubble.warning {
        background: rgba(251, 146, 60, 0.3);
    }

    .stat-bubble.info {
        background: rgba(59, 130, 246, 0.3);
    }

.bubble-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.bubble-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.compact-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.compact-btn {
    padding: 0.25rem 0.75rem;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

    .stat-card .stat-icon {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
        opacity: 0.8;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
        font-weight: 600;
        margin: 0;
    }

    .stat-card .stat-label {
        color: white;
        font-size: 0.875rem;
        margin: 0;
    }

    .stat-card.primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

    .stat-card.success {
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
        color: white;
    }

    .stat-card.warning {
        background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
        color: white;
    }

    .stat-card.info {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
    }

/* Search and Filter Section - Collapsible */
.search-filter-section {
    background: transparent;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    margin-bottom: 0.3rem;
    transition: all 0.3s ease;
    position: relative;
}

    .search-filter-section.collapsed {
        padding: 1rem 1.5rem 0.5rem 1.5rem;
    }

        .search-filter-section.collapsed .filter-info {
            margin-top: 0 !important;
            border-top: none;
            padding-top: 0;
        }

    .search-filter-section .btn-outline-secondary {
        transition: all 0.2s ease;
    }

        .search-filter-section .btn-outline-secondary:hover {
            background-color: #6c757d;
            color: white;
        }

.quick-filters {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

    .quick-filters .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

.custom-date-range {
    padding: 1rem;
    background-color: #f3f4f6;
    border-radius: 8px;
    margin-top: 1rem;
}

.search-wrapper .input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 0.25rem;
}

.search-wrapper .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.filter-info {
    padding: 0.5rem 0;
    border-top: 1px solid #e9ecef;
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Results Table */
.results-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-results {
    margin-bottom: 0;
}

    .table-results thead {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
    }

    .table-results th {
        font-weight: 600;
        color: #495057;
        padding: 1rem;
        white-space: nowrap;
        border: none;
        position: relative;
    }

        .table-results th.sortable {
            cursor: pointer;
            user-select: none;
            transition: background-color 0.2s;
        }

            .table-results th.sortable:hover {
                cursor: pointer !important;
                background-color: #e9ecef;
            }

        .table-results th .d-flex {
            display: flex;
            align-items: center;
        }

        .table-results th i.bi-arrow-up,
        .table-results th i.bi-arrow-down {
            font-size: 0.875rem;
            color: #6366f1;
        }

    .table-results td {
        padding: 1rem;
        vertical-align: middle;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .table-results tbody tr:last-child td {
        border-bottom: none;
    }

    .table-results tbody tr:hover {
        background-color: #f8f9fa;
        cursor: pointer;
    }

    .table-results tbody tr.table-active {
        background-color: #e8eaf6;
    }

.select-col {
    width: 50px;
    text-align: center;
}

.status-col {
    width: 120px;
}

.actions-col {
    width: 140px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-complete {
    background-color: #d1fae5;
    color: #065f46;
}

.status-unknown {
    background-color: #e5e7eb;
    color: #374151;
}

.status-notstarted {
    background-color: #f3f4f6;
    color: #4b5563;
}

.status-started {
    background-color: #fef3c7;
    color: #92400e;
}

/* Customer and Tech Info */
.customer-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.customer-name {
    font-weight: 600;
    color: #1f2937;
}

.location-name {
    color: #6b7280;
    font-size: 0.875rem;
}

.tech-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dispatch-number {
    font-weight: 600;
    color: #6366f1;
}

.date-cell .date-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

    .action-buttons .btn {
        padding: 0.25rem 0.5rem;
    }

/* Search highlighting */
mark {
    background-color: #fef08a;
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: #6c757d;
}

.empty-state-icon,
.empty-icon {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h4,
.empty-state h5 {
    color: #495057;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #6366f1;
    border-color: #dee2e6;
}

    .page-link:hover {
        color: #8b5cf6;
        background-color: #f8f9fa;
        border-color: #dee2e6;
    }

.page-item.active .page-link {
    background-color: #6366f1;
    border-color: #6366f1;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Workflow Selector Styles */
.workflow-selector-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.selector-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .selector-header h2 {
        color: #1f2937;
        margin-bottom: 0.5rem;
    }

.workflow-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.workflow-selector-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .workflow-selector-card:hover {
        border-color: #6366f1;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    }

.workflow-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

    .workflow-card-header h5 {
        color: #1f2937;
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

.result-count-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.workflow-description {
    color: #6b7280;
    margin: 0.5rem 0;
    font-size: 0.775rem;
    line-height: 1.35;
}

.workflow-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.workflow-name-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* Workflow Dropdown Styles */
.workflow-name-section {
    position: relative;
}

.workflow-dropdown {
    cursor: pointer;
    display: inline-block;
}

    .workflow-dropdown p {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.2s;
        border-bottom: 2px dashed rgba(255, 255, 255, 0.5);
        padding-bottom: 2px;
        margin-bottom: 0;
    }

    .workflow-dropdown:hover p {
        color: rgba(255, 255, 255, 0.9);
        border-bottom-color: rgba(255, 255, 255, 0.8);
    }

.dropdown-arrow {
    font-size: 1rem;
    transition: transform 0.2s;
}

.workflow-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.5rem;
}

    .workflow-dropdown-menu .wf-dropdown-header {
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
        font-weight: 600;
        color: #4b5563;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .workflow-dropdown-menu .wf-dropdown-item {
        padding: 1rem;
        border-bottom: 1px solid #f3f4f6;
        cursor: pointer;
        transition: background-color 0.2s;
    }

        .workflow-dropdown-menu .wf-dropdown-item:hover {
            background-color: #f9fafb;
        }

        .workflow-dropdown-menu .wf-dropdown-item:last-child {
            border-bottom: none;
        }

    .workflow-dropdown-menu .wf-dropdown-item-title {
        color: #1f2937;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .workflow-dropdown-menu .wf-dropdown-item-desc {
        color: #6b7280;
        font-size: 0.875rem;
    }

/* Active Filter Bubbles */
.active-filter-bubbles {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

    .filter-bubble:hover {
        background: #c7d2fe;
        transform: scale(1.05);
    }

    .filter-bubble i {
        font-size: 0.75rem;
        opacity: 0.7;
    }

/* Pulse Button Animation */
.pulse-button {
    animation: pulse-animation 2s infinite;
}

/* Workflow selector search */
.workflow-selector-search {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

    .workflow-selector-search .input-group {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-radius: 0.5rem;
        overflow: hidden;
    }

    .workflow-selector-search .form-control {
        border: none;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .workflow-selector-search .input-group-text {
        background: white;
        border: none;
        padding: 0 1.5rem;
    }

/* Column Selector Styles */
.modal-xl {
    max-width: 1200px;
}

.column-selector-container {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 1rem;
    min-height: 500px;
}

.column-list-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-header {
    margin-bottom: 1rem;
}

.section-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.column-search {
    position: relative;
    margin-bottom: 0.5rem;
}

    .column-search .search-icon {
        position: absolute;
        left: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: #6c757d;
        font-size: 0.875rem;
    }

    .column-search input {
        padding-left: 2.25rem;
        border-radius: 0.375rem;
    }

.column-list {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow-y: auto;
    background: #f8f9fa;
    min-height: 400px;
    max-height: 500px;
}

.column-item {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

    .column-item:hover {
        background-color: #f8f9fa;
        border-color: #6c757d;
    }

    .column-item.selected {
        background-color: #e7f1ff;
        border-color: #0d6efd;
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
    }

.column-content {
    width: 100%;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.column-name {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
}

.position-badge {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.column-description {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.column-order-controls {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.order-btn {
    padding: 0.125rem 0.375rem;
    color: #6c757d;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: transparent;
    transition: all 0.2s;
}

    .order-btn:hover:not(:disabled) {
        color: #0d6efd;
        background-color: #e9ecef;
        border-color: #dee2e6;
    }

    .order-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

.column-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-action {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 1.1rem;
}

.list-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    background: white;
    margin-top: auto;
}

/* Mobile Responsive - Consolidated */
@media (max-width: 992px) {
    .modal-xl {
        max-width: 90%;
    }

    .column-selector-container {
        gap: 0.75rem;
    }

    .column-item {
        padding: 0.75rem;
        margin: 0.375rem;
    }

    .filter-info > .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
    }

    .filter-info .d-flex > div:first-child {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .active-filter-bubbles {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .filter-bubble {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .selection-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }

        .selection-controls .btn {
            flex: 1 1 auto;
            min-width: 120px;
        }

        .selection-controls .pulse-button {
            flex: 1 1 100%;
            margin-top: 0.5rem;
        }
}

@media (max-width: 768px) {
    .workflow-selector-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .workflow-selector-card {
        padding: 1rem;
    }

    .workflow-dropdown-menu {
        min-width: 280px;
        left: 0;
        right: 0;
    }

    .workflow-results-page {
        padding: 1rem 0;
    }

        .workflow-results-page .page-header {
            padding: 1.5rem;
            margin-bottom: 1rem;
        }

        .workflow-results-page .header-content {
            flex-direction: column;
            text-align: center;
        }

        .workflow-results-page .header-actions {
            width: 100%;
            justify-content: center;
            flex-direction: column;
        }

            .workflow-results-page .header-actions .btn {
                width: 100%;
            }

        .workflow-results-page .header-title h1 {
            font-size: 1.5rem;
        }

    .stats-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .search-filter-section {
        padding: 1rem;
    }

        .search-filter-section.collapsed {
            padding: 0.75rem 1rem;
        }

            .search-filter-section.collapsed .filter-info .selection-controls {
                flex-direction: column;
                width: 100%;
            }

                .search-filter-section.collapsed .filter-info .selection-controls .btn {
                    width: 100%;
                    margin-bottom: 0.5rem;
                }

    .quick-filters .btn-group {
        justify-content: center;
    }

    .quick-filters .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    .filter-info {
        font-size: 0.875rem;
    }

        .filter-info .text-muted {
            font-size: 0.75rem;
        }

    .badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.5rem !important;
    }

    .selection-controls .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .selection-controls .btn-lg {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .table-results th,
    .table-results td {
        padding: 0.75rem 0.5rem;
    }

    .workflow-results-page .page-header.compact {
        padding: 0.5rem 1rem;
    }

    .compact-bar {
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
    }

    .compact-title {
        display: none;
    }

    .compact-center {
        gap: 0.5rem;
    }

    .stat-bubble {
        padding: 0.2rem 0.75rem;
    }

    .bubble-value {
        font-size: 1rem;
    }

    .bubble-label {
        display: none;
    }

    .compact-btn {
        padding: 0.25rem 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

        .action-buttons .btn {
            width: 100%;
            font-size: 0.875rem;
        }

    .column-selector-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 1fr;
        gap: 1rem;
    }

    .column-actions {
        flex-direction: row;
        padding: 0.75rem 0;
        border-top: 1px solid #dee2e6;
        border-bottom: 1px solid #dee2e6;
    }

    .btn-action {
        width: 40px;
        height: 40px;
    }

    .column-list {
        min-height: 200px;
        max-height: 250px;
    }
}

@media (max-width: 576px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }

    .workflow-results-page .header-actions {
        flex-direction: column;
    }

        .workflow-results-page .header-actions .btn {
            width: 100%;
        }

    .workflow-results-page .page-header:not(.compact) {
        display: none;
    }

    .compact-bar {
        grid-template-columns: auto 1fr auto;
    }

    .compact-icon {
        font-size: 1.1rem;
    }

    .stat-bubble {
        padding: 0.15rem 0.5rem;
        gap: 0.25rem;
    }

    .bubble-value {
        font-size: 0.9rem;
    }

    .compact-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.875rem;
    }

        .compact-btn i {
            font-size: 0.875rem;
        }
}
