
/* =============================================================================
   NARRATIVE CHART 2 - Weighted Index Chart Styles
   Light theme styling for the narrative profile chart
   ============================================================================= */

.narrative-chart2-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.narrative-chart2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.narrative-chart2-title h6 {
    color: #343a40;
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.narrative-chart2-title small {
    color: #6c757d;
    font-size: 0.8rem;
    display: block;
    margin-top: 2px;
}

.narrative-chart2-timeframes {
    display: flex;
    gap: 4px;
}

.narrative-chart2-timeframes .btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 45px;
}

.narrative-chart2-timeframes .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.narrative-chart2-timeframes .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.narrative-chart2-content {
    position: relative;
    padding: 20px;
    padding-bottom: 45px;
}

.narrative-chart2-info-button {
    position: absolute;
    bottom: 12px;
    right: 27px;
    z-index: 100;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.narrative-chart2-info-button:hover {
    opacity: 1;
}

.narrative-chart2-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.narrative-chart2-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

.narrative-chart2-loading p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.narrative-chart2-canvas-wrapper {
    position: relative;
    height: 350px;
    transition: opacity 0.3s ease;
}

.narrative-chart2-canvas-wrapper canvas {
    border-radius: 8px;
}

.narrative-chart2-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    display: none !important; /* Always hidden, only shown in modal */
}

.narrative-chart2-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.narrative-chart2-stats .stat-item {
    text-align: center;
    flex: 1;
}

.narrative-chart2-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: 500;
}

.narrative-chart2-stats .stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #343a40;
}

.narrative-chart2-stats .stat-value.text-success {
    color: #28a745 !important;
}

.narrative-chart2-stats .stat-value.text-danger {
    color: #dc3545 !important;
}

.narrative-chart2-metadata {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.metadata-section {
    margin-bottom: 16px;
}

.metadata-section:last-child {
    margin-bottom: 0;
}

.metadata-title {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.metadata-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.metadata-value {
    font-size: 0.8rem;
    color: #495057;
    font-weight: 600;
}

.top-tokens-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-token-item {
    display: grid;
    grid-template-columns: 20px 60px 1fr 60px;
    gap: 8px;
    align-items: center;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.75rem;
}

.token-rank {
    color: #6c757d;
    font-weight: 600;
}

.token-symbol {
    color: #007bff;
    font-weight: 700;
    text-transform: uppercase;
}

.token-name {
    color: #495057;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-weight {
    color: #28a745;
    font-weight: 600;
    text-align: right;
}

.narrative-chart2-error {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.narrative-chart2-error i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: #ffc107;
}

.narrative-chart2-error p {
    font-size: 1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .narrative-chart2-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        text-align: center;
    }

    .narrative-chart2-timeframes {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .narrative-chart2-timeframes .btn {
        padding: 6px 12px;
        font-size: 0.75rem;
        min-width: 40px;
    }

    .narrative-chart2-content {
        padding: 16px;
    }

    .narrative-chart2-canvas-wrapper {
        height: 280px;
    }

    .narrative-chart2-stats {
        flex-direction: column;
        gap: 12px;
    }

    .narrative-chart2-stats .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 8px 12px;
        background: #f8f9fa;
        border-radius: 6px;
    }

    .narrative-chart2-stats .stat-label {
        margin-bottom: 0;
        flex: 1;
    }

    .narrative-chart2-stats .stat-value {
        font-size: 1rem;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .metadata-item {
        padding: 4px 0;
    }

    .top-token-item {
        grid-template-columns: 20px 50px 1fr 50px;
        gap: 6px;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .narrative-chart2-wrapper {
        border-radius: 8px;
        margin: 0 -8px;
    }

    .narrative-chart2-header {
        padding: 10px 12px;
    }

    .narrative-chart2-title h6 {
        font-size: 0.9rem;
    }

    .narrative-chart2-title small {
        font-size: 0.75rem;
    }

    .narrative-chart2-timeframes .btn {
        padding: 4px 8px;
        font-size: 0.7rem;
        min-width: 35px;
    }

    .narrative-chart2-content {
        padding: 12px;
    }

    .narrative-chart2-canvas-wrapper {
        height: 240px;
    }

    .narrative-chart2-loading .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }

    .narrative-chart2-loading p {
        font-size: 0.8rem;
    }

    .narrative-chart2-error {
        padding: 40px 16px;
    }

    .narrative-chart2-error i {
        font-size: 2rem;
    }

    .narrative-chart2-error p {
        font-size: 0.9rem;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.narrative-chart2-loading {
    animation: pulse 2s infinite;
}

/* Enhanced hover effects */
.narrative-chart2-timeframes .btn:not(.active):hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
    color: #007bff;
}

.narrative-chart2-stats .stat-item:hover {
    background: #e9ecef !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Chart container enhancements */
.narrative-chart2-canvas-wrapper:hover canvas {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}
