/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
}

.dashboard-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header-row {
    background-color: #0c2b30;
    color: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 10px;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.update-info {
    text-align: right;
    font-size: 14px;
}

.update-info p {
    margin: 5px 0;
}

/* Sections */
.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #0c2b30;
    margin-top: 10px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e1e5ea;
}

/* Card title */
.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* Alerts Section - Enhanced */
.alerts-section {
    margin-bottom: 25px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.alerts-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    padding: 0 10px;
}

.alert-card {
    transition: transform 0.2s;
    margin-bottom: 15px !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.alert-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.alert-danger {
    border-left: 8px solid #c47a6a;
}

.alert-warning {
    border-left: 8px solid #c4a46a;
}

.alert-info {
    border-left: 8px solid #5f8f93;
}

.alert-secondary {
    border-left: 8px solid #6c757d;
}

.severity-critical {
    color: #c47a6a;
    font-weight: bold;
    font-size: 18px;
}

.severity-high {
    color: #c4886a;
    font-weight: bold;
    font-size: 17px;
}

.severity-medium {
    color: #5f8f93;
    font-size: 16px;
}

.severity-low {
    color: #6c757d;
    font-size: 16px;
}

/* Grouped Alert Styles - Phase 5.3 */
.grouped-alert-card {
    border: 2px solid #5f8f93 !important;
    border-left-width: 8px !important;
    position: relative;
    overflow: hidden;
}

.grouped-alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #5f8f93 transparent transparent;
}

.grouped-alert-indicator {
    background-color: #e7f1ff;
    padding: 8px 12px;
    border-radius: 4px;
    color: #5f8f93;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.timeframe-badge {
    font-size: 12px !important;
    padding: 5px 8px !important;
    margin-right: 5px !important;
    margin-bottom: 8px !important;
    background-color: #5f8f93 !important;
    color: white !important;
    border-radius: 20px !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 4px rgba(95, 143, 147, 0.2);
}

/* Alert dates */
.alert-date {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.alert-date-label {
    color: #6c757d;
    font-size: 12px;
}

.alert-date-value {
    color: #495057;
    font-family: 'Consolas', monospace;
}

/* Clickable card styles */
.clickable-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.clickable-card:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Alert detail page styles */
.alert-detail-container {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.alert-detail-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 5px solid #5f8f93;
}

.alert-detail-section {
    margin-bottom: 30px;
}

.alert-detail-graph {
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert-id-display {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    user-select: all;
    cursor: pointer;
}

.alert-id-display:hover {
    background-color: #e9ecef;
}

.alert-metadata {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.alert-metadata-row {
    display: flex;
    margin-bottom: 10px;
}

.alert-metadata-label {
    font-weight: 600;
    width: 150px;
    color: #495057;
}

.alert-metadata-value {
    color: #212529;
}

.impact-analysis {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid #6c757d;
    margin-bottom: 20px;
}

.suggested-actions {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid #5f8f93;
    margin-bottom: 20px;
}

.recency-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    background-color: #c4a46a;
    color: #212529;
}

.recency-badge.recent {
    background-color: #c47a6a;
    color: white;
}

/* Route information styling */
.card-title span.route-info {
    font-weight: 500;
    font-size: 110%;
    background-color: #c47a6a; 
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 8px;
    display: inline-block;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    text-transform: uppercase;
}

/* Route banner styling */
.route-banner {
    background-color: #c47a6a;
    color: white;
    padding: 10px 15px;
    margin: -1.25rem -1.25rem 1rem -1.25rem; /* Negative margins to make it full width */
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-bottom: 3px solid #0c2b30;
    text-align: center;
}

.route-banner i {
    margin-right: 8px;
}

.card-body p {
    font-size: 16px;
    margin: 10px 0;
    line-height: 1.5;
}

.no-alerts {
    padding: 30px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 18px;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

/* Alert tabs styling */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    color: #495057;
    background-color: #f8f9fa;
    margin-right: 5px;
    border-radius: 6px 6px 0 0;
    font-size: 16px;
    padding: 10px 20px;
}

.nav-tabs .nav-link.active {
    color: #0c2b30;
    background-color: white;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
    border-top: 3px solid #0c2b30;
}

/* Charts */
.charts-row {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #0c2b30;
}

/* Footer */
.footer-row {
    background-color: #0c2b30;
    color: white;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.footer-content p {
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .header-row {
        text-align: center;
    }
    
    .update-info {
        text-align: center;
        margin-top: 10px;
    }
}

/* Animation for alerts */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-card {
    animation: fadeIn 0.3s ease-in-out;
}

/* Refresh button */
.btn-primary {
    background-color: #0c2b30;
    border-color: #0c2b30;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: #0c2b30;
    border-color: #0c2b30;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Vessel distribution chart section */
#vessel-timeframe-dropdown {
    margin-bottom: 15px;
}

/* Map and Filters */
.map-row {
    margin-bottom: 20px;
}

.filters-column {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #0c2b30;
    margin-top: 0;
    margin-bottom: 10px;
}

.map-column {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Dropdown and Date Range styles */
/* .Select-control dark theme override is below with !important */

.DateRangePickerInput {
    border: 1px solid #ddd;
}

/* Brand and Logo Styles */
.brand-text {
    font-size: 24px;
    font-weight: 600;
    color: #0c2b30;
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.5px;
}

/* Global Macro Event Timeline - Flashing animations */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes flash-new {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: none; }
}

.new-event-marker {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.new-event-callout {
    animation: flash-new 2s ease-in-out infinite;
}

/* Pulsing alert indicators for severe events */
@keyframes pulse-critical {
    0%, 100% { 
        opacity: 1; 
        text-shadow: none;
    }
    50% { 
        opacity: 0.7; 
        text-shadow: none;
    }
}

@keyframes pulse-high {
    0%, 100% { 
        opacity: 1; 
        text-shadow: none;
    }
    50% { 
        opacity: 0.8; 
        text-shadow: none;
    }
}

@keyframes pulse-badge {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(196, 164, 106, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(196, 164, 106, 0);
    }
}

@keyframes blink-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pulse-critical {
    animation: pulse-critical 1.5s ease-in-out infinite;
}

.pulse-high {
    animation: pulse-high 2s ease-in-out infinite;
}

.pulse-badge {
    animation: pulse-badge 2s ease-in-out infinite;
}

.blink-dot {
    animation: blink-dot 1s ease-in-out infinite;
}

/* Scrape status indicator */
.scrape-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #6795a3;
    padding: 4px 8px;
    background: rgba(6, 12, 14, 0.8);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.scrape-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7cb4b9;
}

.scrape-status .dot.stale {
    background: #c4a46a;
}

.scrape-status .dot.very-stale {
    background: #c47a6a;
}

/* N8N-style Workflow Animations — node-pulse, node-processing, connector-flow
   are defined below in the dark theme section (lines ~759-782) */

@keyframes progress-glow {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   AGENT PIPELINE WORKFLOW STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.workflow-node {
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.workflow-node.active {
    border-color: #7cb4b9 !important;
    animation: node-pulse 1.5s ease-in-out infinite;
    box-shadow: none;
}

.workflow-node.processing {
    border-color: #c4a46a !important;
    animation: node-processing 0.6s ease-in-out infinite;
    box-shadow: none;
}

.workflow-node.complete {
    border-color: #7cb4b9 !important;
    background: linear-gradient(135deg, #15272a, #0c2b30) !important;
    box-shadow: none;
}

.workflow-node.inactive {
    border-color: #3a6a70 !important;
    background: #15272a !important;
    opacity: 0.6;
}

.workflow-node.inactive .workflow-node-icon {
    filter: grayscale(80%);
    opacity: 0.7;
}

.workflow-connector {
    transition: all 0.3s ease-in-out;
}

.workflow-connector.inactive {
    color: #335e62 !important;
    opacity: 0.4;
}

.workflow-connector.active {
    color: #7cb4b9 !important;
    animation: connector-flow 0.5s ease-in-out infinite;
    text-shadow: none;
}

/* Container States */
.workflow-container-inactive {
    opacity: 0.9;
}

.workflow-container-inactive #workflow-progress-bar {
    background: transparent !important;
    animation: none !important;
}

.workflow-container-inactive #workflow-progress-container {
    opacity: 0.5;
}

/* Active scraping state - pulsing glow on container */
#scrape-workflow-container.workflow-container-active {
    animation: container-pulse 2s ease-in-out infinite;
    border-bottom-color: #7cb4b9 !important;
}

@keyframes container-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(124, 180, 185, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(124, 180, 185, 0.4);
    }
}

#workflow-progress-container.active {
    background: #15272a !important;
    display: block !important;
}

.workflow-node.error {
    border-color: #c47a6a !important;
    background: linear-gradient(135deg, #15272a, #2a1212) !important;
    animation: error-shake 0.5s ease-in-out;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Node icon animations */
.workflow-node-icon {
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.workflow-node.processing .workflow-node-icon {
    animation: icon-bounce 0.6s ease-in-out infinite;
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
}

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

@keyframes node-processing {
    0%, 100% {
        border-color: #c4a46a;
        box-shadow: none;
    }
    50% {
        border-color: #c4a46a;
        box-shadow: none;
    }
}

@keyframes node-pulse {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes connector-flow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; text-shadow: none; }
}

#workflow-progress-bar {
    animation: progress-glow 2s ease-in-out infinite;
}

/* Pipeline nodes row - flexible grid for future expansion */
#pipeline-nodes-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DARK THEME DROPDOWN STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Dash dropdown - dark theme styling */
.Select-control {
    background-color: #15272a !important;
    border-color: #335e62 !important;
}

.Select-value-label {
    color: #def1f3 !important;
}

.Select-placeholder {
    color: #90bfc4 !important;
}

.Select-input input {
    color: #def1f3 !important;
}

.Select-arrow {
    border-color: #90bfc4 transparent transparent !important;
}

.Select.is-open .Select-arrow {
    border-color: transparent transparent #90bfc4 !important;
}

.Select-menu-outer {
    background-color: #15272a !important;
    border-color: #335e62 !important;
}

.Select-menu {
    background-color: #15272a !important;
}

.Select-option {
    background-color: #15272a !important;
    color: #def1f3 !important;
}

.Select-option:hover,
.Select-option.is-focused {
    background-color: #335e62 !important;
    color: #def1f3 !important;
}

.Select-option.is-selected {
    background-color: #5f8f93 !important;
    color: white !important;
}

/* VirtualizedSelect (used by dcc.Dropdown) */
.VirtualizedSelectOption {
    background-color: #15272a !important;
    color: #def1f3 !important;
}

.VirtualizedSelectFocusedOption {
    background-color: #335e62 !important;
    color: #def1f3 !important;
}

/* Single value display */
.Select-value {
    color: #def1f3 !important;
}

.Select--single > .Select-control .Select-value {
    color: #def1f3 !important;
}

/* Clear button */
.Select-clear-zone {
    color: #90bfc4 !important;
}

.Select-clear-zone:hover {
    color: #c47a6a !important;
}

/* Multi-select tags */
.Select--multi .Select-value {
    background-color: #5f8f93 !important;
    border-color: #5f8f93 !important;
    color: white !important;
}

.Select--multi .Select-value-icon {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.Select--multi .Select-value-icon:hover {
    background-color: #376f75 !important;
    color: white !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   3D MAP NEW CRITICAL EVENT PULSING ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Pulsing border around the 3D map container when new critical events exist */
@keyframes map-border-pulse {
    0%, 100% {
        box-shadow: 
            inset 0 0 0 2px rgba(176, 104, 88, 0.3);
    }
    50% {
        box-shadow: 
            inset 0 0 0 4px rgba(176, 104, 88, 0.8);
    }
}

@keyframes alert-badge-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(176, 104, 88, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(176, 104, 88, 0);
    }
}

@keyframes alert-badge-glow {
    0%, 100% {
        text-shadow: none;
        box-shadow: none;
    }
    50% {
        text-shadow: none;
        box-shadow: none;
    }
}

@keyframes triangle-pulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(196, 164, 106, 0.5));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 15px rgba(196, 164, 106, 1)) drop-shadow(0 0 25px rgba(196, 164, 106, 0.6));
    }
}

@keyframes ring-expand {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* 3D Map container pulsing border - applied when new critical events exist */
.kepler-map-has-alerts {
    animation: map-border-pulse 2s ease-in-out infinite;
    border-radius: 12px;
}

/* Floating alert badge */
.kepler-alert-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #b06858 0%, #9a5a4c 100%);
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.5px;
    animation: alert-badge-glow 1.5s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.kepler-alert-badge:hover {
    transform: scale(1.05);
}

.kepler-alert-badge .badge-icon {
    font-size: 18px;
    animation: triangle-pulse 1s ease-in-out infinite;
}

.kepler-alert-badge .badge-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 4px;
}

/* Ring animation container */
.kepler-alert-ring {
    position: absolute;
    pointer-events: none;
    z-index: 50;
}

.kepler-alert-ring::before,
.kepler-alert-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    border: 3px solid rgba(176, 104, 88, 0.6);
    animation: ring-expand 2s ease-out infinite;
}

.kepler-alert-ring::after {
    animation-delay: 1s;
}

/* Legend badge for new events */
.kepler-legend-new-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #c4a46a 0%, #c4a46a 100%);
    border-radius: 4px;
    color: #020505;
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    animation: pulse-badge 2s ease-in-out infinite;
}

/* Subtle shimmer effect for the 3D map section header when alerts exist */
@keyframes header-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.kepler-section-has-alerts .kepler-section-header {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(176, 104, 88, 0.1) 25%,
        rgba(176, 104, 88, 0.2) 50%,
        rgba(176, 104, 88, 0.1) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: header-shimmer 3s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PIPELINE NODE TOOLTIPS - Rich hover information for each data source
   ═══════════════════════════════════════════════════════════════════════════════ */

.pipeline-node-container {
    position: relative;
    display: inline-block;
}

/* Show tooltip on hover */
.pipeline-node-container:hover .pipeline-tooltip,
.pipeline-node-container:hover .pipeline-tooltip-arrow {
    display: block !important;
    animation: tooltip-fade-in 0.2s ease-out forwards;
}

/* Highlight node on hover */
.pipeline-node-container:hover .workflow-node {
    border-color: #5f8f93 !important;
    box-shadow: none;
    transform: scale(1.05);
}

/* Tooltip styling */
.pipeline-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #15272a 0%, #060c0e 100%);
    border: 1px solid #5f8f93;
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 240px;
    max-width: 300px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 5px 15px rgba(95, 143, 147, 0.2);
    z-index: 1000;
    display: none;
    text-align: left;
    pointer-events: none;
}

/* Tooltip arrow */
.pipeline-tooltip-arrow {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #5f8f93;
    display: none;
}

/* Tooltip fade-in animation */
@keyframes tooltip-fade-in {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Tooltip header */
.pipeline-tooltip > div:first-child {
    color: #def1f3;
    border-bottom: 1px solid #335e62;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

/* Tooltip details text */
.pipeline-tooltip > div:nth-child(2) {
    color: #90bfc4;
    font-size: 11px;
    line-height: 1.5;
}

/* Reliability badge */
.pipeline-tooltip .reliability-badge {
    background: rgba(124, 180, 185, 0.15);
    border: 1px solid rgba(124, 180, 185, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    color: #7cb4b9;
}

/* Source type badges */
.pipeline-tooltip .source-badge-news {
    background: #5f8f93;
}

.pipeline-tooltip .source-badge-osint {
    background: #c4886a;
}

.pipeline-tooltip .source-badge-processing {
    background: #6fa8b8;
}

.pipeline-tooltip .source-badge-system {
    background: #6795a3;
}

/* Dynamic news summary area in tooltip */
.pipeline-tooltip [id^="tooltip-summary-"] {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #335e62;
    font-size: 10px;
    color: #9ec4c9;
    max-height: 80px;
    overflow-y: auto;
}

/* Loading state for tooltip summary */
.pipeline-tooltip .tooltip-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6795a3;
    font-style: italic;
}

.pipeline-tooltip .tooltip-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid #335e62;
    border-top-color: #5f8f93;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Scrollbar styling for tooltip */
.pipeline-tooltip [id^="tooltip-summary-"]::-webkit-scrollbar {
    width: 4px;
}

.pipeline-tooltip [id^="tooltip-summary-"]::-webkit-scrollbar-track {
    background: #15272a;
}

.pipeline-tooltip [id^="tooltip-summary-"]::-webkit-scrollbar-thumb {
    background: #3a6a70;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BREAKING / CONFIRMED BADGE ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(176, 104, 88, 0.7);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 4px rgba(176, 104, 88, 0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BREAKING NEWS TICKER - Scrolling banner for real-time breaking events
   ═══════════════════════════════════════════════════════════════════════════════ */

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

#breaking-news-ticker {
    overflow: hidden;
}

#breaking-news-ticker-content {
    /* Animation duration controlled by inline style in Python (60s) */
    /* Only set display and gap here, not animation */
    display: inline-flex;
    gap: 40px;
}

#breaking-news-ticker-content:hover {
    animation-play-state: paused;
}

/* Breaking news item styling */
.breaking-news-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: #def1f3;
    font-size: 12px;
    padding: 0 20px;
    border-left: 1px solid rgba(176, 104, 88, 0.3);
}

.breaking-news-item:first-child {
    border-left: none;
}

.breaking-news-item .location {
    color: #c4886a;
    font-weight: 600;
}

.breaking-news-item .time {
    color: #6795a3;
    font-size: 10px;
}

.breaking-news-item .media-icon {
    color: #6fa8b8;
    font-size: 10px;
}

/* Flash animation for ticker when new breaking event arrives */
@keyframes ticker-flash {
    0%, 100% {
        background: linear-gradient(90deg, rgba(176, 104, 88, 0.15), rgba(6, 12, 14, 0.95));
    }
    50% {
        background: linear-gradient(90deg, rgba(176, 104, 88, 0.4), rgba(176, 104, 88, 0.2));
    }
}

#breaking-news-ticker.has-new {
    animation: ticker-flash 1s ease-in-out 3;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MEDIA GALLERY POPUP - Lightbox for OSINT images and videos
   ═══════════════════════════════════════════════════════════════════════════════ */

#media-gallery-modal {
    animation: gallery-fade-in 0.3s ease-out;
}

@keyframes gallery-fade-in {
    0% {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Navigation buttons */
#media-gallery-prev:hover,
#media-gallery-next:hover {
    background: rgba(196, 136, 106, 0.8);
    transform: translateY(-50%) scale(1.1);
}

#media-gallery-close:hover {
    background: rgba(196, 122, 106, 0.8);
    transform: scale(1.1);
}

/* Thumbnail hover effects */
#media-gallery-thumbnails img:hover,
#media-gallery-thumbnails div:hover {
    opacity: 1 !important;
    border-color: #c4886a !important;
    transform: scale(1.1);
}

/* Image loading animation */
#media-gallery-content img {
    animation: image-load 0.5s ease-out;
}

@keyframes image-load {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* View Media button pulse on hover */
button[id*="media-view-btn"]:hover {
    background: linear-gradient(90deg, #6fa8b8, #9ec4c9) !important;
    transform: scale(1.05);
    box-shadow: none;
}