/**
 * Unified News Block Styles
 * Shared CSS for all news visualization blocks:
 * - CustomNewsMarkdownBlock
 * - KeyPointsBlock
 * - NumbersBlock
 * - EntitiesBlock
 * - RelationshipsBlock
 * - TimelineBlock
 */

/* ====================================
   Base Container Styles
   ==================================== */

.news-block-container {
    /* background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important; */
    /* border: 1px solid #e9ecef !important; */
    border-radius: 12px !important;
    padding: 2rem 0rem 2rem 0rem !important;
    /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important; */
    position: relative !important;
    overflow: hidden !important;
    margin: 2rem 0 !important;
}

/* Top gradient accent bar */
.news-block-container::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    border-radius: 12px 12px 0 0 !important;
}

/* Block-specific gradient colors */
.news-block-container[data-block-type="markdown"]::before,
.news-block-container[data-block-type="simple-text"]::before {
    background: linear-gradient(90deg, #0d6efd, #6610f2, #20c997, #fd7e14) !important;
}

.news-block-container[data-block-type="key-points"]::before {
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107, #dc3545) !important;
}

.news-block-container[data-block-type="numbers"]::before {
    background: linear-gradient(90deg, #17a2b8, #6610f2, #e83e8c, #fd7e14) !important;
}

.news-block-container[data-block-type="entities"]::before {
    background: linear-gradient(90deg, #6610f2, #e83e8c, #fd7e14, #20c997) !important;
}

.news-block-container[data-block-type="timeline"]::before {
    background: linear-gradient(90deg, #3498db, #9b59b6, #e74c3c, #f39c12) !important;
}

.news-block-container[data-block-type="relationships"]::before {
    background: linear-gradient(90deg, #fd7e14, #e83e8c, #6610f2, #17a2b8) !important;
}

/* ====================================
   Header Styles
   ==================================== */

.news-block-header {
    border-bottom: 2px solid #e9ecef !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.news-block-title {
    color: #212529 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
}

.news-block-title i {
    margin-right: 0.5rem !important;
    font-size: 1.3rem !important;
}

/* ====================================
   Common Item/Content Styles
   ==================================== */

/* Universal item container (for entities, key points, relationships, etc.) */
.news-item {
    display: flex !important;
    padding: 1rem !important;
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.news-item:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Universal subheader (entity names, timeline titles, relationship labels) */
/* .news-subheader {
    color: #212529 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-bottom: 0.5rem !important;
} */


/* Universal badge/label */
/* .news-badge {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
} */

/* Icon colors by block type */
.news-block-container[data-block-type="markdown"] .news-block-title i,
.news-block-container[data-block-type="simple-text"] .news-block-title i {
    color: #0d6efd !important;
}

.news-block-container[data-block-type="key-points"] .news-block-title i {
    color: #ffc107 !important;
}

.news-block-container[data-block-type="numbers"] .news-block-title i {
    color: #17a2b8 !important;
}

.news-block-container[data-block-type="entities"] .news-block-title i {
    color: #6610f2 !important;
}

.news-block-container[data-block-type="timeline"] .news-block-title i {
    color: #3498db !important;
}

.news-block-container[data-block-type="relationships"] .news-block-title i {
    color: #fd7e14 !important;
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 768px) {
    .news-block-container {
        padding: 1.5rem !important;
    }

    .news-block-title {
        font-size: 1.25rem !important;
    }

    .news-block-title i {
        font-size: 1.15rem !important;
    }

    .news-block-body {
        font-size: 0.95rem !important;
    }

    .news-block-body h1 {
        font-size: 1.5rem !important;
    }

    .news-block-body h2 {
        font-size: 1.25rem !important;
    }

    .news-block-body h3 {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 480px) {
    .news-block-container {
        padding: 1rem !important;
        margin: 1.25rem 0 !important;
    }

    .news-block-title {
        font-size: 1.1rem !important;
    }

    .news-block-title i {
        font-size: 1rem !important;
    }

    .news-block-body {
        font-size: 0.9rem !important;
    }

    .news-block-body h1 {
        font-size: 1.25rem !important;
    }

    .news-block-body h2 {
        font-size: 1.1rem !important;
    }

    .news-block-body h3 {
        font-size: 1rem !important;
    }
}

/* ====================================
   Dark Mode Support
   ==================================== */

@media (prefers-color-scheme: dark) {
    .news-block-container {
        background: linear-gradient(135deg, #212529 0%, #343a40 100%) !important;
        border-color: #495057 !important;
        color: #f8f9fa !important;
    }

    .news-block-title {
        color: #f8f9fa !important;
    }

    .news-block-body {
        color: #e9ecef !important;
    }

    .news-block-body h1,
    .news-block-body h2,
    .news-block-body h3,
    .news-block-body h4,
    .news-block-body h5,
    .news-block-body h6 {
        color: #f8f9fa !important;
    }

    .news-block-body blockquote {
        color: #dee2e6 !important;
        background: rgba(13, 110, 253, 0.15) !important;
    }
}

/* ====================================
   Print Styles
   ==================================== */

@media print {
    .news-block-container {
        background: #ffffff !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .news-block-body {
        color: #000000 !important;
    }
}

/* ====================================
   Key Points Block Specific
   ==================================== */

.key-points-grid {
    display: grid !important;
    gap: 1.25rem !important;
    grid-template-columns: 1fr !important;
}

@media (min-width: 768px) {
    .key-points-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    }
}

.key-point-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1rem !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    border-left: 4px solid #007bff !important;
}

/* Sentiment-based border colors */
.key-point-item[data-sentiment="positive"] {
    border-left-color: #28a745 !important;
}

.key-point-item[data-sentiment="neutral"] {
    border-left-color: #007bff !important;
}

.key-point-item[data-sentiment="negative"] {
    border-left-color: #dc3545 !important;
}

/* Hover effects with sentiment-based colors */
.key-point-item[data-sentiment="positive"]:hover {
    border-left-color: #1e7e34 !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15) !important;
    transform: translateY(-2px) !important;
}

.key-point-item[data-sentiment="neutral"]:hover {
    border-left-color: #0056b3 !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15) !important;
    transform: translateY(-2px) !important;
}

.key-point-item[data-sentiment="negative"]:hover {
    border-left-color: #c82333 !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Sentiment-based bullet colors */
.key-point-item[data-sentiment="positive"] .key-point-bullet {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.key-point-item[data-sentiment="neutral"] .key-point-bullet {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
}

.key-point-item[data-sentiment="negative"] .key-point-bullet {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.card-item-text {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}

/* ====================================
   Numbers Block Specific
   ==================================== */

.numbers-table-wrapper {
    overflow-x: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.numbers-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #ffffff !important;
}

.numbers-table thead {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: #ffffff !important;
}

.numbers-table th {
    padding: 1rem !important;
    font-weight: 600 !important;
    text-align: left !important;
    text-transform: uppercase !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.5px !important;
}

.numbers-table tbody tr {
    border-bottom: 1px solid #e9ecef !important;
    transition: background-color 0.2s ease !important;
}

.numbers-table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.numbers-table td {
    padding: 1rem !important;
}

.description-cell {
    display: flex !important;
    align-items: center !important;
}

.metric-icon {
    margin-right: 0.75rem !important;
    color: #17a2b8 !important;
    font-size: 1.2rem !important;
}

/* .metric-text {
    color: #495057 !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    line-height: 1.3 !important;
} */

.value-cell {
    text-align: right !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.metric-value {
    color: #17a2b8 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    display: inline !important;
}

.metric-unit {
    color: #495057 !important;
    font-size: 0.875rem !important;
    margin-left: 0.25rem !important;
    font-weight: 500 !important;
    display: inline !important;
}

/* ====================================
   Entities Block Specific
   ==================================== */

.entities-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1rem !important;
    margin-top: 1rem !important;
}

.entity-item {
    display: flex !important;
    padding: 1rem !important;
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.entity-item:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: #6610f2 !important;
}

.faun-bullet {
    flex-shrink: 0 !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 1rem !important;
    font-size: 1.1rem !important;
    color: #ffffff !important;
}

/* Category-specific bullet colors */
.faun-bullet[data-category="people"] {
    background: linear-gradient(135deg, #6610f2, #8b5cf6) !important;
}

.faun-bullet[data-category="organizations"] {
    background: linear-gradient(135deg, #e83e8c, #ec4899) !important;
}

.faun-bullet[data-category="tools"] {
    background: linear-gradient(135deg, #fd7e14, #fb923c) !important;
}

.faun-bullet[data-category="events"] {
    background: linear-gradient(135deg, #20c997, #34d399) !important;
}

.faun-bullet[data-category="regulatory"] {
    background: linear-gradient(135deg, #dc3545, #ef4444) !important;
}

.faun-bullet[data-category="industries"] {
    background: linear-gradient(135deg, #17a2b8, #06b6d4) !important;
}

.faun-bullet[data-sentiment="neutral"] {
    background: linear-gradient(135deg, #007bff, #5f43ff) !important;
}

.faun-bullet[data-sentiment="positive"] {
    background: linear-gradient(135deg, #28a745, #92ff49) !important;
}

.faun-bullet[data-sentiment="negative"] {
    background: linear-gradient(135deg, #ff0000, #ff4e4e) !important;
}

/* .entity-content {
    flex: 1 !important;
}

.entity-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 0.5rem !important;
} */

.entity-name {
    color: #212529 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.entity-badge {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa) !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    color: #495057 !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.entity-description {
    font-family: Lora !important;
    color: #585858 !important;
    font-size: 22px !important;
    letter-spacing: -0.03px !important;
    line-height: 1.9 !important;
}

/* ====================================
   Timeline Block Specific
   ==================================== */

.timeline-wrapper {
    position: relative !important;
    padding: 0 1rem !important;
}

.timeline-line {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 3px !important;
    background: linear-gradient(to bottom, #3498db, #2980b9) !important;
    transform: translateX(-50%) !important;
    border-radius: 2px !important;
}

.timeline-event {
    position: relative !important;
    margin-bottom: 2rem !important;
    display: flex !important;
    align-items: flex-start !important;
}

.timeline-event:nth-child(odd) {
    flex-direction: row !important;
}

.timeline-event:nth-child(even) {
    flex-direction: row-reverse !important;
}

.timeline-marker {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 2 !important;
    width: 20px !important;
    height: 20px !important;
    background: #3498db !important;
    border: 3px solid #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3) !important;
}

.timeline-marker i {
    font-size: 0.5rem !important;
    color: #ffffff !important;
}

.timeline-content {
    width: 45% !important;
    padding: 1rem 1.5rem !important;
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
    display: block !important;
}

/* Override .news-item flex for timeline to make it vertical */
[data-block-type="timeline"] .news-item.timeline-content {
    display: block !important;
}

.timeline-content:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: #3498db !important;
}

.timeline-date {
    color: #3498db !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.3 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.timeline-event-title {
    color: #212529 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.3 !important;
}

.timeline-description {
    font-family: Lora !important;
    color: #585858 !important;
    font-size: 22px !important;
    letter-spacing: -0.03px !important;
    line-height: 1.9 !important;
}

/* Responsive timeline */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px !important;
    }

    .timeline-event,
    .timeline-event:nth-child(even) {
        flex-direction: row !important;
    }

    .timeline-marker {
        left: 20px !important;
    }

    .timeline-content {
        width: calc(100% - 60px) !important;
        margin-left: 60px !important;
    }
}

/* ====================================
   Relationships Block Specific
   ==================================== */

.relationships-description {
    color: #6c757d !important;
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
    font-style: italic !important;
}

.relationships-list {
    margin-bottom: 2rem !important;
}

.relationship-item {
    padding: 1rem !important;
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-left: 4px solid #fd7e14 !important;
    border-radius: 6px !important;
    margin-bottom: 0.75rem !important;
    transition: all 0.3s ease !important;
}

.relationship-item:hover {
    border-left-color: #e83e8c !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transform: translateX(4px) !important;
}

.relationship-entities {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-bottom: 0.5rem !important;
    flex-wrap: wrap !important;
}

.relationship-source,
.relationship-target {
    font-weight: 600 !important;
    color: #212529 !important;
    font-size: 1rem !important;
    line-height: 1.3 !important;
}

.relationship-arrow {
    color: #fd7e14 !important;
    font-weight: bold !important;
    font-size: 1rem !important;
}

.relationship-type {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    background: linear-gradient(135deg, #fff3e0, #ffe5cc) !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    color: #fd7e14 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
}

.relationship-desc {
    color: #495057 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
}

.relationships-viz {
    margin-top: 2rem !important;
    border-top: 2px solid #e9ecef !important;
    padding-top: 2rem !important;
}

.relationships-embed-wrapper {
    width: 100% !important;
    height: 520px !important;
    position: relative !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
}

.relationships-embed-frame {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #f8f9fa !important;
}

/* Responsive relationships */
@media (max-width: 992px) {
    .relationships-embed-wrapper {
        height: 480px !important;
    }
}

@media (max-width: 768px) {
    .relationships-embed-wrapper {
        height: 420px !important;
    }
}

@media (max-width: 480px) {
    .relationships-embed-wrapper {
        height: 360px !important;
    }
}

/* Dark mode for relationships iframe */
@media (prefers-color-scheme: dark) {
    .relationships-embed-wrapper {
        background: #2c3036 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    }
}

.viz-iframe {
    width: 100% !important;
    height: 600px !important;
    border: none !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
