/* assets/css/styles.css */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.3s ease-in-out;
}

/* Waterfall chart styles */
.waterfall-bar {
    height: 20px;
    position: relative;
    background: #f1f1f1;
    border-radius: 4px;
    overflow: hidden;
}

.waterfall-segment {
    position: absolute;
    height: 100%;
    transition: width 0.3s ease;
}

.waterfall-dns { background: #FF9800; }
.waterfall-connect { background: #2196F3; }
.waterfall-ttfb { background: #4CAF50; }
.waterfall-download { background: #9C27B0; }

/* Grade badges */
.grade-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    color: white;
}

.grade-a { background: #4CAF50; }
.grade-b { background: #8BC34A; }
.grade-c { background: #FFC107; }
.grade-d { background: #FF9800; }
.grade-f { background: #F44336; }

/* Card hover effects */
.metric-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 200px;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #2196F3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976D2;
}

.btn-secondary {
    background-color: #9E9E9E;
    color: white;
}

.btn-secondary:hover {
    background-color: #757575;
}

/* Chart container styles */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-container {
        height: 200px;
    }
    
    .waterfall-bar {
        height: 15px;
    }
    
    .grade-badge {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}