/* Ensure all Activity Log and Investment Trend text is visible in light theme, including inside alert/colored boxes and Plotly annotations */
.light-theme .activity-timeline, 
.light-theme .activity-item, 
.light-theme .activity-log-details, 
.light-theme .activity-log-row, 
.light-theme .activity-log-details *,
.light-theme .activity-log-row *,
.light-theme .activity-log-success, 
.light-theme .activity-log-success *,
.light-theme .activity-log-warning, 
.light-theme .activity-log-warning *,
.light-theme .activity-log-error, 
.light-theme .activity-log-error * {
    color: #334155 !important;
}

.light-theme .investment-trend-container, 
.light-theme .investment-trend-content, 
.light-theme .investment-trend-chart, 
.light-theme .investment-trend-label, 
.light-theme .investment-trend-value, 
.light-theme .investment-trend-container *,
.light-theme .investment-trend-content *,
.light-theme .investment-trend-chart *,
.light-theme .investment-trend-label *,
.light-theme .investment-trend-value * {
    color: #334155 !important;
}

.light-theme .js-plotly-plot .annotation text,
.light-theme .js-plotly-plot .hovertext text,
.light-theme .js-plotly-plot .g-annotation text,
.light-theme .js-plotly-plot .g-annotation,
.light-theme .js-plotly-plot .g-gtitle,
.light-theme .js-plotly-plot .g-title,
.light-theme .js-plotly-plot .g-legend {
    fill: #334155 !important;
    color: #334155 !important;
    stroke: none !important;
    opacity: 1 !important;
}
/* Force all Plotly chart text, axis, and legend labels to dark color in light theme for Investment Trend */
.light-theme .js-plotly-plot .xtick text,
.light-theme .js-plotly-plot .ytick text,
.light-theme .js-plotly-plot .legendtext,
.light-theme .js-plotly-plot .g-xtitle text,
.light-theme .js-plotly-plot .g-ytitle text,
.light-theme .js-plotly-plot .g-title text,
.light-theme .js-plotly-plot .g-legend text,
.light-theme .js-plotly-plot .g-gtitle text,
.light-theme .js-plotly-plot .g-annotation text,
.light-theme .js-plotly-plot .g-annotation,
.light-theme .js-plotly-plot .g-gtitle,
.light-theme .js-plotly-plot .g-title,
.light-theme .js-plotly-plot .g-legend {
    fill: #334155 !important;
    color: #334155 !important;
    stroke: none !important;
    opacity: 1 !important;
}

.light-theme .investment-trend-container, .light-theme .investment-trend-content, .light-theme .investment-trend-chart, .light-theme .investment-trend-label, .light-theme .investment-trend-value {
    color: #334155 !important;
}
.light-theme .activity-timeline, .light-theme .activity-item, .light-theme .activity-log-details, .light-theme .activity-log-row {
    color: #334155 !important;
}
/* Fix Activity Log and Investment Trend font for light theme */
.light-theme .activity-timeline, .light-theme .activity-item, .light-theme .activity-log-details, .light-theme .activity-log-row {
    color: #334155 !important;
}
.light-theme .investment-trend-container, .light-theme .investment-trend-content, .light-theme .investment-trend-chart, .light-theme .investment-trend-label, .light-theme .investment-trend-value {
    color: #334155 !important;
}
.light-theme .investment-trend-chart svg text {
    fill: #334155 !important;
}
/* Fix Activity Log font for light theme */
.light-theme .activity-timeline, .light-theme .activity-item {
    color: #334155 !important;
}
/* =============================================================================
   WORKFLOW PAGE STYLES
   Professional, clean design inspired by Hyperleap
   ============================================================================= */

/* Custom scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Smooth fade-in animation for content */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Staggered fade-in for lists */
.fade-in-stagger > * {
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

.fade-in-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* Portfolio container styling */
.portfolio-container {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.portfolio-container:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Card hover effects */
.hover-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.hover-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 212, 255, 0.2);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 212, 255, 0.08) !important;
}

/* Professional typography */
h2 {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

h3, h4, h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.text-muted {
    color: #94a3b8 !important;
    font-size: 0.9rem;
}

.text-muted-bright {
    color: #cbd5e1 !important;
    font-size: 0.9rem;
}

.text-muted-dark {
    color: #64748b !important;
    font-size: 0.9rem;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.section-header .badge {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .portfolio-container {
        padding: 0.75rem;
        border-radius: 12px;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    .custom-scrollbar {
        height: calc(100vh - 160px) !important;
    }
    
    .hover-card {
        border-radius: 10px;
    }
    
    .hover-card:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 576px) {
    .portfolio-container {
        padding: 0.5rem;
        border-radius: 10px;
    }
    
    h2 {
        font-size: 1.2rem;
    }
}

/* Loading animation */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Shimmer loading effect */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Status indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    position: relative;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    opacity: 0.3;
}

.status-indicator.positive {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator.positive::after {
    background-color: #10b981;
    animation: pulse-ring 2s infinite;
}

.status-indicator.negative {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-indicator.negative::after {
    background-color: #ef4444;
    animation: pulse-ring 2s infinite;
}

.status-indicator.neutral {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Card content animation */
.card-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-content {
    transform: translateY(-2px);
}

/* Metric Cards */
.metric-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.25s ease;
}

.metric-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.02em;
}

.metric-card .metric-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.metric-card .metric-change {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.metric-card .metric-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.metric-card .metric-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

@media (max-width: 576px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .metric-card {
        padding: 0.875rem;
    }
    
    .metric-card .metric-value {
        font-size: 1.25rem;
    }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    color: #f8fafc;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
    border-radius: 1px;
}

.activity-item {
    position: relative;
    padding: 0.75rem 0;
    padding-left: 1rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 12px;
    height: 12px;
    background: #0a0f1a;
    border: 2px solid #00d4ff;
    border-radius: 50%;
}

.activity-item:last-child::before {
    border-color: #7c3aed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #64748b;
}

.empty-state h4 {
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto;
}

/* Workflow Step Cards */
.workflow-step {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.7) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.workflow-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff 0%, #7c3aed 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.workflow-step:hover {
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.workflow-step:hover::before {
    opacity: 1;
}

.workflow-step.active::before {
    opacity: 1;
}

.workflow-step-number {
    width: 32px;
    height: 32px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #00d4ff;
    margin-bottom: 0.75rem;
}

.workflow-step h5 {
    color: #f8fafc;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.workflow-step p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* =============================================================================
   SIGNAL CRITERIA DETAILS - Dark Theme Text Visibility Fix
   ============================================================================= */

/* Force white text in criteria container for dark theme */
.criteria-container,
.criteria-container *,
.criteria-container span,
.criteria-container li,
.criteria-container ul,
.criteria-container ul li,
.criteria-container ul li span,
.criteria-container .criteria-list,
.criteria-container .criteria-list li,
.criteria-container .criteria-list li span,
.criteria-container .criteria-item,
.criteria-container .criteria-item span,
.criteria-container .criteria-text {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Group headers - amber color */
.criteria-container .criteria-group-header,
.criteria-group-header,
.criteria-container h6,
.criteria-group h6 {
    color: #fbbf24 !important;
}

/* Subtitle and muted text */
.criteria-container .criteria-subtitle,
.criteria-container .text-muted {
    color: #cbd5e1 !important;
}

/* Title styling */
.criteria-container .criteria-title,
.criteria-title {
    color: #f8fafc !important;
}

/* Success/Danger icons brightness */
.criteria-container .text-success,
.criteria-icon.text-success {
    color: #4ade80 !important;
}

.criteria-container .text-danger,
.criteria-icon.text-danger {
    color: #f87171 !important;
}

/* Modal and accordion body overrides for dark theme */
.modal-body .criteria-container *,
.accordion-body .criteria-container *,
.card-body .criteria-container * {
    color: #ffffff !important;
}

.modal-body .criteria-group-header,
.accordion-body .criteria-group-header,
.card-body .criteria-group-header {
    color: #fbbf24 !important;
}