/* Advanced Visualizations CSS */
/* Chart containers and animations */

/* Visualization Section Layout */
.lf-visualizations-section {
    padding: 40px 0;
    background: #f8f9fa;
}

.lf-visualizations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.lf-map-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 300px;
}

.chart-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chart-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-container .chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.chart-container .chart-actions {
    display: flex;
    gap: 10px;
}

.chart-container .chart-action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chart-container .chart-action-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* Chart Canvas Wrapper */
.chart-canvas-wrapper {
    position: relative;
    height: calc(100% - 50px);
    min-height: 250px;
}

/* Map Container Styles */
#family-journey-map {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.map-container {
    position: relative;
    background: #f0f0f0;
}

.map-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-control-btn {
    background: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-control-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.map-control-btn.active {
    background: #4CAF50;
    color: white;
}

/* Map Info Window Styles */
.map-info-window {
    padding: 10px;
    min-width: 200px;
}

.map-info-window h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.map-info-window p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.map-info-window p strong {
    color: #333;
}

/* Real-time Visual Indicators */
.visual-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.visual-indicator.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.visual-indicator.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.visual-indicator.status-inactive {
    background: #fafafa;
    color: #757575;
}

/* Progress Ring */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s;
}

.progress-ring-bg {
    stroke: #e0e0e0;
}

.progress-ring-progress {
    stroke: #4CAF50;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-ring-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    display: block;
}

.progress-ring-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Gauge Meter */
.gauge-meter {
    position: relative;
    width: 200px;
    height: 120px;
    margin: 0 auto;
}

.gauge-meter-track {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 100px 100px 0 0;
    background: linear-gradient(to right, #f44336 0%, #ff9800 25%, #ffc107 50%, #8bc34a 75%, #4caf50 100%);
    opacity: 0.2;
}

.gauge-meter-fill {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 100px 100px 0 0;
    background: linear-gradient(to right, #f44336 0%, #ff9800 25%, #ffc107 50%, #8bc34a 75%, #4caf50 100%);
    transform-origin: center bottom;
    transition: transform 0.5s ease;
}

.gauge-meter-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 80px;
    background: #333;
    transform-origin: center bottom;
    transition: transform 0.5s ease;
    border-radius: 2px;
}

.gauge-meter-center {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
}

.gauge-meter-value {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* Animation Classes */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Live Data Indicator */
.live-data-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #e8f5e9;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
}

.live-data-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Chart Legend Customization */
.chart-legend-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.chart-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-container {
        padding: 15px;
    }
    
    .chart-container .chart-title {
        font-size: 16px;
    }
    
    #family-journey-map {
        height: 400px;
    }
    
    .map-controls {
        top: 10px;
        left: 10px;
    }
    
    .map-control-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .progress-ring {
        width: 100px;
        height: 100px;
    }
    
    .progress-ring-value {
        font-size: 24px;
    }
    
    .gauge-meter {
        width: 160px;
        height: 100px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) and (prefers-color-scheme: light) {
    .chart-container {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .chart-container .chart-title {
        color: #e0e0e0;
    }
    
    .chart-container .chart-action-btn {
        color: #bbb;
    }
    
    .chart-container .chart-action-btn:hover {
        background: #2a2a2a;
        color: #fff;
    }
    
    .map-control-btn {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .map-control-btn.active {
        background: #4CAF50;
    }
    
    .progress-ring-value {
        color: #e0e0e0;
    }
    
    .visual-indicator.status-inactive {
        background: #2a2a2a;
        color: #bbb;
    }
}

/* Print Styles */
@media print {
    .chart-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .chart-actions,
    .map-controls {
        display: none;
    }
    
    #family-journey-map {
        height: 400px;
    }
}