/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.3);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes numberCount {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* Page Header */
.page-header {
    animation: fadeIn 1s ease-out;
}

.page-header h1 {
    animation: slideInUp 0.8s ease-out;
}

.page-header p {
    animation: slideInUp 0.8s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Speed Test Container */
.speedtest-container {
    animation: scaleIn 0.8s ease-out;
}

.speedtest-logo {
    animation: rotateIn 1.2s ease-out;
}

.speedtest-intro h2 {
    animation: slideInUp 0.8s ease-out;
}

.speedtest-intro p {
    animation: slideInUp 0.8s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Test Interface */
.start-test-btn {
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
}

.start-test-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(221, 38, 41, 0.2);
}

.speed-value {
    transition: all 0.3s ease;
}

.speed-value.updating {
    animation: numberCount 0.5s infinite alternate;
}

.speed-icon {
    transition: all 0.3s ease;
}

.speed-icon.updating {
    animation: spin 2s linear infinite;
}

/* Results Cards */
.result-card {
    animation: scaleIn 0.6s ease-out;
    animation-fill-mode: forwards;
    opacity: 0;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Speed Tips */
.tip-card {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: forwards;
    opacity: 0;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.tip-card:nth-child(1) { animation-delay: 0.1s; }
.tip-card:nth-child(2) { animation-delay: 0.2s; }
.tip-card:nth-child(3) { animation-delay: 0.3s; }

.tip-icon {
    transition: all 0.3s ease;
}

.tip-card:hover .tip-icon {
    animation: rotateIn 1s ease-out;
    color: var(--fenix-red);
}

/* Contact Section */
.contact-heading h2 {
    animation: slideInUp 0.8s ease-out;
}

.contact-heading p {
    animation: slideInUp 0.8s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.contact-card {
    animation: scaleIn 0.6s ease-out;
    animation-fill-mode: forwards;
    opacity: 0;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.contact-icon {
    transition: all 0.3s ease;
}

.contact-card:hover .contact-icon {
    animation: pulse 1s infinite;
    background-color: var(--fenix-red);
    color: white;
}

/* Speed Recommendations */
.recommendations-table {
    animation: fadeIn 1s ease-out;
}

.recommendations-table tr {
    transition: all 0.3s ease;
}

.recommendations-table tr:hover {
    background-color: rgba(221, 38, 41, 0.05);
}

.indicator {
    transition: all 0.3s ease;
}

.indicator:hover {
    transform: scale(1.2);
}

/* Progress Bar */
.progress {
    overflow: visible;
}

.progress-bar {
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
