/* ========================================
   ASHKER STUDIO - ANIMATIONS & MICRO-INTERACTIONS
   ======================================== */

/* ========================================
   ENTRANCE ANIMATIONS
   ======================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

/* Slide Down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out forwards;
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

/* Stagger animation for multiple elements */
.animate-stagger > * {
    animation: slideUp 0.6s ease-out forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   HOVER EFFECTS & INTERACTIONS
   ======================================== */

/* Button Hover Lift */
.btn-primary:not(:disabled):hover,
.btn-secondary:not(:disabled):hover {
    transform: translateY(-2px);
}

/* Card Lift on Hover */
.card-hover:hover {
    transform: translateY(-8px);
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(14, 165, 233, 0.5);
    }
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Fade In On Scroll */
.scroll-fade {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

/* Slide Up On Scroll */
.scroll-slide-up {
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 0.8s ease-out forwards;
}

/* Fade & Scale On Scroll */
.scroll-scale {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.8s ease-out forwards;
}

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */

/* Form Input Focus Glow */
input:focus,
textarea:focus,
select:focus {
    animation: focusGlow 0.3s ease-out;
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.1);
    }
}

/* Toggle Switch Animation */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #0EA5E9;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Accordion Animation */
.accordion-item .accordion-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.accordion-item .accordion-header:hover {
    color: #0EA5E9;
}

.accordion-item .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    opacity: 1;
}

.accordion-item.active .accordion-header {
    color: #0EA5E9;
    font-weight: 600;
}

/* Accordion Icon Rotation */
.accordion-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

/* Skeleton Pulse */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton {
    animation: skeleton-pulse 2s ease-in-out infinite;
}

/* Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Pulsing Dot */
@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */

/* Fade In Page */
@keyframes pageEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: pageEnter 0.3s ease-out;
}

/* Fade Out Page */
@keyframes pageExit {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========================================
   ATTENTION SEEKER ANIMATIONS
   ======================================== */

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
}

.animate-heartbeat {
    animation: heartbeat 1.3s ease-in-out infinite;
}

/* ========================================
   TEXT ANIMATIONS
   ======================================== */

/* Text Blur In */
@keyframes blur-in {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.animate-blur-in {
    animation: blur-in 0.6s ease-out forwards;
}

/* Gradient Text Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* ========================================
   MODAL ANIMATIONS
   ======================================== */

/* Modal Fade In & Scale */
.modal {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-overlay {
    animation: fadeIn 0.2s ease-out;
}

/* ========================================
   NOTIFICATION ANIMATIONS
   ======================================== */

/* Toast Notification Slide In */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification {
    animation: toastSlideIn 0.4s ease-out;
}

/* Toast Notification Slide Out */
@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.toast-notification.exit {
    animation: toastSlideOut 0.4s ease-out forwards;
}

/* ========================================
   RESPONSIVE ANIMATION ADJUSTMENTS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Disable animations on mobile for better performance */
@media (max-width: 768px) {
    .animate-stagger > * {
        animation: none;
        opacity: 1;
    }

    .scroll-fade,
    .scroll-slide-up,
    .scroll-scale {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
