/* Internet Speed Test Custom Styles */

/* Speed test progress animations */
.speed-meter {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.speed-meter-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ef4444 0deg 36deg, /* Red: 0-10% */ #f97316 36deg 72deg, /* Orange: 10-20% */ #eab308 72deg 180deg, /* Yellow: 20-50% */ #22c55e 180deg 324deg, /* Green: 50-90% */ #3b82f6 324deg 360deg /* Blue: 90-100% */);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.speed-meter-inner {
    width: 80%;
    height: 80%;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.speed-needle {
    position: absolute;
    width: 4px;
    height: 45%;
    background: #1f2937;
    border-radius: 2px;
    transform-origin: bottom center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    top: 5%;
    left: 50%;
    margin-left: -2px;
}

.speed-needle::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #1f2937;
    border-radius: 50%;
    transform: translateX(-50%);
}

/* Progress bar enhancements */
.progress-bar-animated {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Pulse animation for current speed display */
.speed-pulse {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    to {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
    }
}

/* Test status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    animation: status-blink 1.5s ease-in-out infinite;
}

.status-dot.testing {
    background-color: #3b82f6;
}

.status-dot.complete {
    background-color: #22c55e;
    animation: none;
}

.status-dot.error {
    background-color: #ef4444;
    animation: none;
}

@keyframes status-blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Speed category indicators */
.speed-category-excellent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.speed-category-very-good {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.speed-category-good {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.speed-category-fair {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.speed-category-poor {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.speed-category-very-poor {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Floating elements animation */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Result cards hover effects */
.result-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Network quality visualization */
.signal-strength {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
}

.signal-bar {
    width: 4px;
    background: #d1d5db;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.signal-bar.active {
    background: #10b981;
}

.signal-bar:nth-child(1) {
    height: 25%;
}
.signal-bar:nth-child(2) {
    height: 50%;
}
.signal-bar:nth-child(3) {
    height: 75%;
}
.signal-bar:nth-child(4) {
    height: 100%;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Test history timeline */
.timeline-item {
    position: relative;
    padding-left: 24px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #3b82f6;
}

.timeline-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 18px;
    bottom: -12px;
    width: 2px;
    background: #e5e7eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .speed-meter {
        width: 150px;
        height: 150px;
    }

    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Custom scrollbar for test history */
.test-history-scroll {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.test-history-scroll::-webkit-scrollbar {
    width: 6px;
}

.test-history-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.test-history-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.test-history-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Notification styles */
.notification-enter {
    transform: translateX(100%);
    opacity: 0;
}

.notification-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.notification-exit {
    transform: translateX(0);
    opacity: 1;
}

.notification-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
}

/* Speed comparison chart */
.speed-comparison {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
    padding: 0 12px;
}

.speed-bar {
    flex: 1;
    background: #e5e7eb;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: all 0.5s ease;
    position: relative;
}

.speed-bar.download {
    background: linear-gradient(to top, #10b981, #34d399);
}

.speed-bar.upload {
    background: linear-gradient(to top, #3b82f6, #60a5fa);
}

.speed-bar.ping {
    background: linear-gradient(to top, #8b5cf6, #a78bfa);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 8px;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}
