/* Custom CSS for Insurance Value Stream Dashboard */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Value Stream Flow Styling */
.value-stream-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    min-width: fit-content;
}

.value-stream-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.value-stream-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.value-stream-item.active {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    transform: scale(1.05);
}

.value-stream-arrow {
    color: #6B7280;
    font-size: 1.25rem;
    margin: 0 0.25rem;
}

/* Hierarchical Content Styling */
.level-1 {
    margin-bottom: 1.5rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.level-1-header {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    color: white;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.level-1-header:hover {
    background: linear-gradient(135deg, #374151 0%, #4B5563 100%);
}

.level-1-header.active {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
}

.level-1-content {
    display: none;
    padding: 0;
    background: #F9FAFB;
}

.level-1-content.show {
    display: block;
}

.level-2 {
    border-bottom: 1px solid #E5E7EB;
    background: white;
}

.level-2:last-child {
    border-bottom: none;
}

.level-2-header {
    background: #F3F4F6;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: between;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.level-2-header:hover {
    background: #E5E7EB;
    border-left-color: #3B82F6;
}

.level-2-header.active {
    background: #EFF6FF;
    color: #1E40AF;
    border-left-color: #3B82F6;
}

.level-2-content {
    display: none;
    padding: 0;
    background: #FAFBFC;
}

.level-2-content.show {
    display: block;
}

.level-3-item {
    padding: 0.75rem 2rem;
    border-bottom: 1px solid #F3F4F6;
    color: #6B7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-3-item:hover {
    background: #F3F4F6;
    color: #374151;
    padding-left: 2.5rem;
}

.level-3-item.active {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid #F59E0B;
}

.level-3-item:last-child {
    border-bottom: none;
}

/* Filter Panel Styling */
.filter-category {
    margin-bottom: 1.5rem;
    background: #F9FAFB;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #E5E7EB;
}

.filter-category-header {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-category-header:hover {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
}

.filter-options {
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.filter-option:hover {
    background: #E5E7EB;
}

.filter-option.active {
    background: #DBEAFE;
    color: #1E40AF;
    font-weight: 500;
}

.filter-checkbox {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    accent-color: #3B82F6;
}

/* Icons and Visual Elements */
.category-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
    color: #6B7280;
}

.expand-icon {
    transition: transform 0.3s ease;
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

/* Highlighting for Active Filters */
.highlighted {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%) !important;
    border-left: 4px solid #F59E0B !important;
    color: #92400E !important;
    font-weight: 600 !important;
    transform: scale(1.02);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.1);
}

.highlighted .level-1-header,
.highlighted .level-2-header {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: white !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .flex {
        flex-direction: column;
    }
    
    aside {
        width: 100% !important;
        max-height: none !important;
    }
    
    main {
        max-height: none !important;
    }
    
    .value-stream-flow {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .value-stream-item {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 640px) {
    .value-stream-item {
        font-size: 0.6rem;
        padding: 0.375rem 0.75rem;
    }
    
    .level-1-header,
    .level-2-header {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .level-3-item {
        padding: 0.5rem 1.5rem;
        font-size: 0.8rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: #6B7280;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4B5563;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Impact Indicators */
.impact-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-left: 0.5rem;
}

.impact-high {
    background-color: #EF4444;
}

.impact-medium {
    background-color: #F59E0B;
}

.impact-low {
    background-color: #10B981;
}

/* Cross-Value Chain Impact Styling */
.lifecycle-impacted {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%) !important;
    border-left: 4px solid #8B5CF6 !important;
    color: #581C87 !important;
    font-weight: 600 !important;
    position: relative;
    animation: pulse-highlight 2s ease-in-out;
}

.lifecycle-impacted-category {
    border: 2px solid #8B5CF6 !important;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2) !important;
    background: linear-gradient(135deg, #F3F4F6 0%, #EDE9FE 100%) !important;
}

.lifecycle-impacted .level-1-header,
.lifecycle-impacted .level-2-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%) !important;
    color: white !important;
    position: relative;
}

.lifecycle-impacted .level-1-header::before,
.lifecycle-impacted .level-2-header::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #EC4899, #8B5CF6, #3B82F6);
}

.impact-connection {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139, 92, 246, 0.9);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: connection-pulse 1.5s ease-in-out infinite;
}

.impact-count-badge {
    font-weight: 700;
    font-size: 0.75rem;
    animation: badge-glow 2s ease-in-out infinite alternate;
}

/* Impact Summary Banner */
.impact-summary-banner {
    margin: 1rem 0;
    z-index: 10;
    position: relative;
}

.category-impact {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Interconnection Lines */
.process-interconnection {
    position: relative;
}

.process-interconnection::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: linear-gradient(to right, #8B5CF6, #EC4899);
    transform: translateY(-50%);
}

/* Strategic Impact Levels */
.impact-level-critical {
    border-left-color: #DC2626 !important;
    background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%) !important;
}

.impact-level-high {
    border-left-color: #F59E0B !important;
    background: linear-gradient(135deg, #FFFBEB 0%, #FED7AA 100%) !important;
}

.impact-level-medium {
    border-left-color: #3B82F6 !important;
    background: linear-gradient(135deg, #EFF6FF 0%, #BFDBFE 100%) !important;
}

.impact-level-low {
    border-left-color: #10B981 !important;
    background: linear-gradient(135deg, #ECFDF5 0%, #A7F3D0 100%) !important;
}

/* Cross-Chain Visualization Enhancements */
.cross-chain-connector {
    position: absolute;
    left: -2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent 0%, #8B5CF6 20%, #8B5CF6 80%, transparent 100%);
    z-index: 1;
}

.value-stream-impact-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6B7280;
}

.flow-connector {
    width: 20px;
    height: 1px;
    background: linear-gradient(to right, #8B5CF6, transparent);
}

/* Animations */
@keyframes pulse-highlight {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); 
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); 
    }
}

@keyframes connection-pulse {
    0%, 100% { 
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-50%) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes badge-glow {
    0% { 
        box-shadow: 0 0 5px rgba(139, 92, 246, 0.5); 
    }
    100% { 
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.8); 
    }
}

/* Enhanced Value Stream Header for Impacts */
.value-stream-item.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.value-stream-item.has-impacts {
    position: relative;
}

.value-stream-item.has-impacts::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #EC4899;
    border-radius: 50%;
    animation: connection-pulse 1.5s ease-in-out infinite;
}