/* Tool Pages Animations CSS */

/* General animations for tool pages */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.8s ease forwards;
}

.slide-in-down {
    animation: slideInDown 0.8s ease forwards;
}

.scale-in {
    animation: scaleIn 0.8s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

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

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

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

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

@keyframes slideInDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

/* Tool-specific animations */
.tool-header {
    animation: fadeIn 1s ease forwards;
}

.tool-description {
    animation: slideInLeft 1s ease forwards;
}

.tool-container {
    animation: slideInUp 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.data-visualization {
    animation: fadeIn 1.2s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.result-interpretation {
    animation: slideInUp 1s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Button animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::after {
    width: 300%;
    height: 300%;
}

.btn-primary {
    animation: pulse 2s infinite;
}

/* Test area animations */
.test-area {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.test-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: 1;
    pointer-events: none;
}

.test-area:hover::before {
    left: 100%;
    transition: 0.5s;
}

/* Result item animations */
.result-item {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: calc(0.1s * var(--item-index, 0));
    opacity: 0;
    animation-fill-mode: forwards;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 5px;
}

/* Chart animations */
.chart-container {
    transition: all 0.3s ease;
    animation: scaleIn 0.8s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.chart-container:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Interpretation grid animations */
.interpretation-grid {
    display: grid;
}

.interpretation-item {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: calc(0.2s * var(--item-index, 0));
    opacity: 0;
    animation-fill-mode: forwards;
}

.interpretation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Loading spinner animation */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Progress bar animation */
.progress-fill {
    transition: width 0.3s ease;
}

/* Floating icons */
.floating-icon {
    animation: float 3s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tool-description, .tool-container {
        animation: fadeIn 1s ease forwards;
    }
}
