/* Additional styles for visualizations */
.visualization-container {
    position: relative;
    width: 100%;
    margin: 30px 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
    transition: all 0.3s ease;
}

.visualization-container:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.visualization-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.visualization-container:hover .visualization-image {
    transform: scale(1.02);
}

.visualization-caption {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    border-top: 1px solid #eee;
}

.chart-container {
    position: relative;
    height: auto;
    margin: 20px 0;
    overflow: hidden;
}

.chart-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.chart-container:hover img {
    transform: scale(1.02);
}

/* Responsive adjustments for visualizations */
@media (max-width: 768px) {
    .visualization-container {
        margin: 20px 0;
    }
    
    .visualization-caption {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* Lightbox for visualizations */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border: 5px solid white;
    border-radius: 4px;
}

.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    text-align: center;
    border-radius: 0 0 4px 4px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
}

/* Interactive data visualization elements */
.interactive-chart {
    position: relative;
    margin: 30px 0;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 15px 10px 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 5px;
}

.legend-text {
    font-size: 0.9rem;
}

.legend-item.inactive {
    opacity: 0.5;
}

/* Comparison visualization enhancements */
.comparison-container {
    position: relative;
}

.comparison-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.toggle-button {
    padding: 8px 15px;
    margin: 0 5px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Animation for chart elements */
@keyframes growBar {
    from { width: 0; }
    to { width: 100%; }
}

.animated-bar {
    animation: growBar 1s ease-out forwards;
}

/* Responsive image gallery for mobile */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.gallery-item {
    flex: 1 1 calc(50% - 10px);
    min-width: 150px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.gallery-image {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.8rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .gallery-item {
        flex: 1 1 100%;
    }
}
