/* Charts CSS for Password Strength Analyzer */

/* Chart Container Styles */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 300px;
}

/* Chart.js Customization */
.chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Custom Chart Colors */
.chart-colors {
    --chart-primary: #84a98c;
    --chart-secondary: #52796f;
    --chart-warning: #f59e0b;
    --chart-danger: #ef4444;
    --chart-info: #06b6d4;
    --chart-purple: #8b5cf6;
    --chart-pink: #ec4899;
    --chart-gray: #cad2c5;
}

/* Pie Chart Specific Styles */
.pie-chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pie-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.5rem;
}

/* Bar Chart Styles */
.bar-chart-container {
    position: relative;
    width: 100%;
    height: 250px;
}

.bar-chart-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Progress Bar Styles */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out, background-color 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Strength Meter Styles */
.strength-meter {
    position: relative;
    width: 100%;
    height: 12px;
    background: linear-gradient(
        90deg,
        #ef4444 0%,
        #f97316 20%,
        #f59e0b 40%,
        #22c55e 60%,
        #16a34a 100%
    );
    border-radius: 6px;
    overflow: hidden;
}

.strength-meter-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: #1f2937;
    border-radius: 2px;
    transition: left 0.8s ease-out;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

/* Entropy Visualization */
.entropy-visualization {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.entropy-bar {
    flex: 1;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.entropy-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
    transition: width 0.8s ease-out;
}

.entropy-label {
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 60px;
    text-align: right;
}

/* Time-to-Crack Timeline */
.timeline-container {
    position: relative;
    margin: 1rem 0;
}

.timeline-bar {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.timeline-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-marker {
    width: 12px;
    height: 12px;
    background-color: #6b7280;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Character Frequency Chart */
.frequency-chart {
    display: flex;
    align-items: end;
    gap: 2px;
    height: 100px;
    margin: 1rem 0;
}

.frequency-bar {
    flex: 1;
    background-color: #3b82f6;
    border-radius: 2px 2px 0 0;
    transition: height 0.5s ease-out;
    position: relative;
}

.frequency-bar:hover {
    background-color: #2563eb;
}

.frequency-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Responsive Chart Adjustments */
@media (max-width: 768px) {
    .pie-chart-container {
        height: 150px;
    }
    
    .bar-chart-container {
        height: 200px;
    }
    
    .frequency-chart {
        height: 80px;
    }
    
    .pie-chart-legend {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .timeline-labels {
        font-size: 0.625rem;
    }
    
    .frequency-label {
        font-size: 0.625rem;
    }
}

/* Chart Loading States */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.chart-loading::after {
    content: 'Loading chart...';
    color: #6b7280;
    font-size: 0.875rem;
}

/* Chart Error States */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background-color: #fef2f2;
    border-radius: 8px;
    border: 2px dashed #fca5a5;
    color: #dc2626;
    font-size: 0.875rem;
}

/* Chart Tooltips */
.chart-tooltip {
    position: absolute;
    background-color: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chart-tooltip.show {
    opacity: 1;
}

/* Chart Animation Classes */
.chart-fade-in {
    animation: chartFadeIn 0.6s ease-out;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chart-slide-up {
    animation: chartSlideUp 0.5s ease-out;
}

@keyframes chartSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart Accessibility */
.chart-container[role="img"] {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.chart-container[role="img"]:focus {
    outline-color: #3b82f6;
}

/* High Contrast Mode for Charts */
@media (prefers-contrast: high) {
    .progress-bar-container {
        background-color: #000000;
        border: 1px solid #000000;
    }
    
    .strength-meter {
        background: linear-gradient(
            90deg,
            #000000 0%,
            #333333 20%,
            #666666 40%,
            #999999 60%,
            #cccccc 100%
        );
    }
    
    .frequency-bar {
        background-color: #000000;
        border: 1px solid #000000;
    }
}

/* Print Styles for Charts */
@media print {
    .chart-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .chart-loading,
    .chart-error {
        display: none;
    }
} 