/* ============================================================================
   CHIB.STUDIO — Animations & Effects
   ============================================================================ */

/* ============================================================================
   Slide & Fade Animations
   ============================================================================ */

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

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

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

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

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

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

/* ============================================================================
   Counter Animation
   ============================================================================ */

@keyframes countUp {
    from {
        content: '0';
    }
    to {
        content: 'final';
    }
}

/* ============================================================================
   Glow Effects
   ============================================================================ */

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(196, 163, 90, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(196, 163, 90, 0.8), 0 0 30px rgba(196, 163, 90, 0.5);
    }
}

@keyframes glowBorder {
    0%, 100% {
        border-color: rgba(196, 163, 90, 0.5);
        box-shadow: 0 0 10px rgba(196, 163, 90, 0.2);
    }
    50% {
        border-color: rgba(196, 163, 90, 0.8);
        box-shadow: 0 0 20px rgba(196, 163, 90, 0.4);
    }
}

/* ============================================================================
   Pulse & Breathe Effects
   ============================================================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* ============================================================================
   Shimmer & Wave Effects
   ============================================================================ */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(4px);
    }
    100% {
        transform: translateX(0);
    }
}

/* ============================================================================
   Light Leak Effect
   ============================================================================ */

@keyframes lightLeak {
    0% {
        opacity: 0;
        left: -100%;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        left: 100%;
    }
}

/* ============================================================================
   Film Grain Animation
   ============================================================================ */

@keyframes grain {
    0% {
        transform: translate(0, 0);
    }
    10% {
        transform: translate(-5%, -10%);
    }
    20% {
        transform: translate(-15%, 5%);
    }
    30% {
        transform: translate(7%, -25%);
    }
    40% {
        transform: translate(-5%, 25%);
    }
    50% {
        transform: translate(-20%, -5%);
    }
    60% {
        transform: translate(15%, 5%);
    }
    70% {
        transform: translate(0%, 10%);
    }
    80% {
        transform: translate(3%, 0%);
    }
    90% {
        transform: translate(-10%, -5%);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* ============================================================================
   Hover Effects for Interactive Elements
   ============================================================================ */

@keyframes popIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes popOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* ============================================================================
   Applied Animations
   ============================================================================ */

/* Hero Section */
.hero-content {
    animation: slideDown 0.8s ease;
}

/* Login Form */
.login-box {
    animation: slideDown 0.6s ease;
}

/* Service Cards */
.service-card,
.portfolio-card {
    animation: fadeInUp 0.6s ease backwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* Stat Items */
.stat-item {
    animation: scaleIn 0.6s ease backwards;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

/* Step Items */
.step {
    animation: fadeInUp 0.6s ease backwards;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }
.step:nth-child(4) { animation-delay: 0.4s; }
.step:nth-child(5) { animation-delay: 0.5s; }

/* FAQ Items */
.faq-item {
    animation: fadeInUp 0.5s ease backwards;
}

.faq-item:nth-child(1) { animation-delay: 0.05s; }
.faq-item:nth-child(2) { animation-delay: 0.1s; }
.faq-item:nth-child(3) { animation-delay: 0.15s; }
.faq-item:nth-child(4) { animation-delay: 0.2s; }
.faq-item:nth-child(5) { animation-delay: 0.25s; }
.faq-item:nth-child(6) { animation-delay: 0.3s; }
.faq-item:nth-child(7) { animation-delay: 0.35s; }
.faq-item:nth-child(8) { animation-delay: 0.4s; }

/* ============================================================================
   Interactive Hover Effects
   ============================================================================ */

/* Links with underline animation */
a {
    position: relative;
}

a:not(.btn):not(.nav-link):not(.filter-btn) {
    text-decoration: none;
}

/* Smooth transitions */
button,
a,
input,
select,
textarea {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================================
   Film Grain Overlay Animation
   ============================================================================ */

.grain-overlay {
    animation: grain 8s steps(10) infinite;
}

/* ============================================================================
   Cinematic Loading Effect
   ============================================================================ */

@keyframes cinemaLoad {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* ============================================================================
   Text Selection Style
   ============================================================================ */

::selection {
    background-color: rgba(196, 163, 90, 0.3);
    color: var(--color-text-primary);
}

::-moz-selection {
    background-color: rgba(196, 163, 90, 0.3);
    color: var(--color-text-primary);
}

/* ============================================================================
   Scroll Animation Trigger
   ============================================================================ */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ============================================================================
   Reduced Motion Media Query
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   Performance Optimizations
   ============================================================================ */

.will-animate {
    will-change: transform, opacity;
}

/* ============================================================================
   Custom Scrollbar
   ============================================================================ */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-gold);
}

/* ============================================================================
   Input Focus Ring Animation
   ============================================================================ */

input:focus,
select:focus,
textarea:focus {
    animation: glowBorder 1s ease infinite;
}

/* ============================================================================
   Button Ripple Effect on Click
   ============================================================================ */

button,
.btn {
    position: relative;
    overflow: hidden;
}

button::before,
.btn::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%);
    opacity: 0;
}

button:active::before,
.btn:active::before {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ============================================================================
   Smooth Color Transitions
   ============================================================================ */

.service-card,
.portfolio-card,
.equipment-item,
.step,
.faq-item {
    background-color: transition;
    border-color: transition;
}

/* ============================================================================
   Loading Skeleton Pulse
   ============================================================================ */

@keyframes skeletonPulse {
    0%, 100% {
        background-color: rgba(255, 255, 255, 0.05);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.skeleton {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}
