/* JUCE-Style Animations for Home Wi-Fi Captive Portal */

/* Easing functions inspired by JUCE */
:root {
    --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
    --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0.0, 1, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Fade in animation for portal container */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portal-container {
    animation: fadeInUp 0.6s var(--ease-out);
}

/* Button ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.connect-btn:active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s linear;
}

/* Micro-interactions for checkbox */
.checkbox-label input[type="checkbox"] {
    transition: all 0.2s var(--ease-out);
}

.checkbox-label input[type="checkbox"]:checked {
    transform: scale(1.1);
}

.checkbox-label input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.3);
}

/* Smooth transitions for form elements */
.consent-form input,
.consent-form button {
    transition: all 0.3s var(--ease-out);
}

/* Loading state animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.connect-btn.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Status section fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.status-section {
    animation: fadeIn 0.5s var(--ease-out);
}

/* Timer countdown animation */
@keyframes countdown {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

.time-remaining {
    transition: all 0.3s var(--ease-out);
}

.time-remaining.updating {
    animation: countdown 0.3s var(--bounce);
}

/* Hover effects with smooth transitions */
.connect-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.checkbox-label:hover input[type="checkbox"] {
    transform: scale(1.05);
}

/* Focus states for accessibility */
.connect-btn:focus,
.checkbox-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.3);
}

/* Staggered animation for multiple elements */
.consent-section > * {
    animation: fadeInUp 0.6s var(--ease-out);
}

.consent-section > *:nth-child(1) { animation-delay: 0.1s; }
.consent-section > *:nth-child(2) { animation-delay: 0.2s; }
.consent-section > *:nth-child(3) { animation-delay: 0.3s; }

/* Smooth color transitions for status changes */
.status-indicator {
    transition: all 0.3s var(--ease-out);
}

.status-icon {
    transition: all 0.3s var(--ease-out);
}

/* Loading spinner with smooth rotation */
@keyframes smoothSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.btn-loader {
    animation: smoothSpin 1s linear infinite;
}
