/* Sentiment Page Specific Styles */

/* Equal height row */
.row-equal-height {
    display: flex;
    flex-wrap: wrap;
}

.row-equal-height > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* Chart Container Overrides */
.chart-container {
    margin-top: 10px;
    flex: 1;
    /* Use common.css responsive settings */
}

/* Specific style for sentiment trend chart */
#sentimentTrendChart {
    height: 100% !important;
    width: 100% !important;
}

/* Sentiment Overview Panel */
.sentiment-overview-panel, .sentiment-chart-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sentiment-overview-panel .card-body, .sentiment-chart-panel .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.overall-sentiment {
    text-align: center;
    margin-bottom: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sentiment-gauge-container {
    position: relative;
    height: 250px;
    margin: 1rem auto;
    max-width: 500px;
}

.sentiment-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sentiment-description {
    margin-top: 1rem;
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* Sentiment Stats */
.sentiment-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.stat-item {
    background-color: rgba(var(--primary-color-rgb), 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

/* Stat label/value typography is provided by common.css */

/* Last Updated Styling */
#lastUpdated {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: rgba(var(--primary-color-rgb), 0.1);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    display: inline-block;
    margin-top: 5px;
    cursor: help;
    transition: all 0.3s ease;
}

#lastUpdated:hover {
    background-color: rgba(var(--primary-color-rgb), 0.2);
}

/* Time range buttons are provided by common.css */

/* Sentiment Rankings Panel */
.sentiment-rankings-panel .card-body h3 {
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sentiment-rankings-panel .table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* Sentiment Table */
.sentiment-table {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Table cell/header styling is provided by common.css */

.sentiment-table .crypto-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    color: var(--text-color) !important;
}

.sentiment-table .crypto-name span {
    color: var(--text-color) !important;
    font-weight: 600;
    font-size: 0.95rem;
}

.sentiment-table .crypto-name small {
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
    opacity: 0.8;
}

.sentiment-table .crypto-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Sentiment Score Indicator */
.sentiment-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sentiment-score span {
    color: var(--text-color) !important;
    font-weight: 600;
    min-width: 50px;
}

.sentiment-indicator {
    width: 80px;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sentiment-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.sentiment-positive {
    background-color: var(--positive-color);
}

.sentiment-neutral {
    background-color: var(--neutral-color);
}

.sentiment-negative {
    background-color: var(--negative-color);
}

/* Sentiment Change */
.sentiment-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    width: fit-content;
}

.sentiment-change.positive {
    color: var(--positive-color) !important;
    background-color: rgba(var(--positive-color-rgb), 0.1);
}

.sentiment-change.negative {
    color: var(--negative-color) !important;
    background-color: rgba(var(--negative-color-rgb), 0.1);
}

.sentiment-change.neutral {
    color: var(--neutral-color) !important;
    background-color: rgba(var(--neutral-color-rgb), 0.1);
}

.sentiment-change i {
    font-size: 0.8rem;
}

/* Source Filter */
.source-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.source-button {
    padding: 6px 12px;
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.source-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.source-button.active {
    background-color: var(--primary-color);
    color: white;
}

/* Sentiment Sources */
.sentiment-sources {
    width: 100%;
    margin-top: 1rem;
}

.sentiment-source-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.3s ease;
    margin-bottom: 1rem;
}

.sentiment-source-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.source-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.source-type.news {
    background-color: rgba(var(--info-color-rgb), 0.1);
    color: var(--info-color);
}

.source-type.x {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000000;
}

.source-type.reddit {
    background-color: rgba(255, 69, 0, 0.1);
    color: #ff4500;
}

.source-timestamp {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 2px 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.source-content {
    margin-top: 0.5rem;
}

.source-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.source-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.source-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

.source-sentiment {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.source-sentiment.positive {
    color: var(--positive-color);
}

.source-sentiment.negative {
    color: var(--negative-color);
}

.source-sentiment.neutral {
    color: var(--neutral-color);
}

/* Loading and Error Overlays - Specific Overrides */
.loading-spinner p {
    margin-top: 10px;
    color: var(--text-color);
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Footer styles are now in footer.css */

/* Enhanced Source Styles */
.sources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sources-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.sources-filter {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.filter-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: var(--hover-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sentiment-sources-items {
    max-height: 800px;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-bg);
}

/* Custom scrollbar for WebKit browsers */
.sentiment-sources-items::-webkit-scrollbar {
    width: 8px;
}

.sentiment-sources-items::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

.sentiment-sources-items::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
    border: 2px solid var(--card-bg);
}

/* Update source item styles */
.sentiment-source-item {
    background-color: rgba(var(--primary-color-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid transparent;
}

.sentiment-source-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sentiment-source-item[data-source-type="news"] {
    border-left-color: var(--info-color);
}

.sentiment-source-item[data-source-type="x"] {
    border-left-color: #000000;
}

.sentiment-source-item[data-source-type="reddit"] {
    border-left-color: #ff4500;
}

/* Update source link styles */
.source-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.source-link i {
    margin-left: 6px;
    font-size: 12px;
}

.source-link:hover {
    background-color: rgba(var(--primary-color-rgb), 0.2);
    text-decoration: none;
}

.no-sources-message {
    padding: 20px;
    text-align: center;
    background-color: rgba(var(--primary-color-rgb), 0.05);
    border-radius: 8px;
    margin: 20px 0;
}

.no-sources-message p {
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sentiment-stats {
        grid-template-columns: 1fr;
    }

    .sentiment-sources {
        grid-template-columns: 1fr;
    }

    /* Removed footer container override to maintain consistency with other pages */

    .sentiment-table th,
    .sentiment-table td {
        padding: 8px 10px;
    }

    .sentiment-table .crypto-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .source-filter {
        flex-wrap: wrap;
    }

    .sources-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sources-filter {
        margin-top: 15px;
        width: 100%;
        justify-content: space-between;
    }
}
