/* ===================================
   ANIMATIONS & TRANSITIONS
   =================================== */

/* Keyframe Animations */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.8);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Apply Animations */

.animate-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade {
    animation: fadeIn 0.8s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-scale {
    animation: scaleIn 0.4s ease-out;
}

/* Element-Specific Animations */

.hero-title {
    animation: fadeInDown 0.8s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: backwards;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.4s;
    animation-fill-mode: backwards;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 0.6s;
    animation-fill-mode: backwards;
}

.scroll-indicator {
    animation: bounce 2s infinite;
}

.stat-number.counted {
    animation: countUp 0.6s ease-out;
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::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%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

/* Tech Cards */
.tech-card {
    transition: all 0.3s ease;
}

.tech-card:hover {
    animation: glowPulse 1.5s infinite;
}

.tech-icon {
    transition: transform 0.3s ease;
}

.tech-card:hover .tech-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Form Errors */
.form-input.error,
.form-select.error,
.option-card.error {
    animation: shake 0.5s;
    border-color: var(--bssf-red-accent);
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 107, 53, 0.3);
    border-top-color: var(--bssf-orange-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Notification Animations */
.notification {
    position: fixed;
    top: -100px;
    right: 20px;
    max-width: 400px;
    background: var(--bssf-white);
    border-left: 4px solid var(--bssf-orange-primary);
    border-radius: 8px;
    padding: var(--space-3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: top 0.3s ease;
}

.notification.show {
    top: 80px;
}

.notification-success {
    border-left-color: var(--bssf-tech-green);
}

.notification-error {
    border-left-color: var(--bssf-red-accent);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.notification-icon {
    font-size: var(--text-xl);
    font-weight: bold;
}

.notification-success .notification-icon {
    color: var(--bssf-tech-green);
}

.notification-error .notification-icon {
    color: var(--bssf-red-accent);
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--bssf-gray-medium);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.notification-close:hover {
    color: var(--bssf-gray-darkest);
}

/* Modal Animations */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 10001;
    background: var(--bssf-white);
    border-radius: 16px;
    padding: var(--space-6);
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: var(--bssf-gray-darkest);
    color: var(--bssf-white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bssf-orange-primary);
    transform: rotate(90deg);
}

.video-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--bssf-gray-dark) 0%, var(--bssf-gray-darkest) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-4);
}

.play-icon {
    font-size: 64px;
    color: var(--bssf-orange-primary);
    animation: glowPulse 2s infinite;
}

/* Progress Bar */
@keyframes progress {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--bssf-orange-primary);
    z-index: 9999;
    animation: progress 2s ease-out;
}

/* Skeleton Loading */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

/* Text Reveal Animation */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 0.8s ease-out;
}

/* Gradient Text Animation */
@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-text {
    background: linear-gradient(90deg, var(--bssf-orange-primary), var(--bssf-red-accent), var(--bssf-yellow-accent), var(--bssf-orange-primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

/* Parallax Scroll Effect */
.parallax {
    transition: transform 0.5s ease-out;
}

/* Stagger Animation */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Field Error Animation */
.field-error {
    color: var(--bssf-red-accent);
    font-size: var(--text-sm);
    margin-top: 4px;
    animation: fadeInUp 0.3s ease-out;
}

/* Performance Optimizations */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}
