/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* DataTables custom styling */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    color: #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #9ca3af !important;
    padding: 0.25rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa !important;
    border: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: rgba(139, 92, 246, 0.3) !important;
    color: #c4b5fd !important;
    border: none;
}

/* Complexity bars styling */
.complexity-bars {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.complexity-bars .bar {
    height: 0.5rem;
    width: 1rem;
    border-radius: 0.125rem;
    transition: all 0.3s ease;
}

.complexity-bars:hover .bar {
    transform: scaleY(1.2);
}

/* Difficulty color gradients */
.difficulty-simple { background-color: #10b981; }
.difficulty-basic { background-color: #84cc16; }
.difficulty-intermediate { background-color: #fbbf24; }
.difficulty-advanced { background-color: #f97316; }
.difficulty-expert { background-color: #ef4444; }

.dataTables_wrapper .dataTables_info {
    color: #9ca3af;
}

/* Hover effects for table rows */
#workflowsTable tbody tr {
    transition: all 0.2s;
}

#workflowsTable tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.05);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background-color: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.badge-warning {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Complexity bars */
.complexity-bars {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.complexity-bars .bars-container {
    display: flex;
    gap: 2px;
}

.complexity-bars .bar {
    height: 8px;
    width: 16px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.complexity-bars .bar.active {
    opacity: 1;
}

.complexity-bars .bar.inactive {
    opacity: 0.3;
    background-color: #374151 !important;
}

.complexity-bars .label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.25rem;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: #8b5cf6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Card hover effects */
.workflow-card {
    transition: all 0.3s;
    border: 1px solid transparent;
}

.workflow-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(45deg, #8b5cf6, #ec4899, #8b5cf6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(17, 24, 39, 0.95);
    color: #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

/* Modern Table Styles */
.modern-table-container {
    overflow: hidden;
    border-radius: 0.75rem;
}

/* Search Input Enhancement */
.search-input-modern:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Table Row Hover with Subtle Animation */
.table-row-modern {
    transition: all 0.15s ease;
}

.table-row-modern:hover {
    background-color: rgba(139, 92, 246, 0.05);
    transform: translateX(2px);
}

/* Modern Pagination */
.pagination-modern {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-modern button {
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-modern button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Active Filters Indicator */
.active-filter-indicator {
    position: relative;
}

.active-filter-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #8b5cf6;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* Enhanced Loading State */
.skeleton-loader {
    background: linear-gradient(90deg, 
        rgba(139, 92, 246, 0.1) 0%, 
        rgba(139, 92, 246, 0.2) 50%, 
        rgba(139, 92, 246, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Sort Icon Animation */
.sort-icon {
    transition: transform 0.2s ease;
}

.sort-icon-active {
    transform: scale(1.2);
}

/* Enhanced Badge Styles */
.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Results Counter Animation */
.results-counter {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clear Button Enhancement */
.clear-filters-btn {
    position: relative;
    overflow: hidden;
}

.clear-filters-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.clear-filters-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Mobile Responsive Table */
@media (max-width: 768px) {
    .table-mobile-card {
        display: block;
        background-color: rgba(31, 41, 55, 0.5);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .table-mobile-label {
        font-weight: 600;
        color: #9ca3af;
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
}

/* Multi-tag Search Input */
.multi-tag-search {
    min-height: 3rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.search-tag {
    animation: tagFadeIn 0.2s ease;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.search-tag button:hover {
    background-color: rgba(139, 92, 246, 0.3);
    border-radius: 50%;
}