/**
 * Banomala - Smooth Animations & Interactions
 * Makes the website feel modern, smooth and interactive
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Fade In Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@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 fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-15px);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-3px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(125, 60, 255, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(125, 60, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(125, 60, 255, 0); }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Shimmer Loading Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Rotate Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Slide In */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Heartbeat */
@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.2); }
    28% { transform: scale(1); }
    42% { transform: scale(1.2); }
    70% { transform: scale(1); }
}

/* ============================================
   ANIMATION UTILITY CLASSES
   ============================================ */

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.6s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.6s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.6s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease forwards; }
.animate-popIn { animation: popIn 0.4s ease forwards; }
.animate-bounce { animation: bounce 1s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-shake { animation: shake 0.5s ease; }

/* Delay Classes */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   ENHANCED BUTTON INTERACTIONS
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    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 ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(125, 60, 255, 0.4);
}

.btn-accent:hover {
    box-shadow: 0 8px 25px rgba(255, 127, 50, 0.4);
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */

.product-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-card .product-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-card .product-actions {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Category Card Animations */
.category-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.category-card img {
    transition: transform 0.5s ease;
}

.category-card:hover img {
    transform: scale(1.1);
}

/* Blog Card Animations */
.blog-card-home {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card-home:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.blog-card-home .blog-image img {
    transition: transform 0.6s ease;
}

.blog-card-home:hover .blog-image img {
    transform: scale(1.08);
}

/* Review Card Animations */
.review-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* ============================================
   HEADER ANIMATIONS
   ============================================ */

.header {
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Icons Animation */
.header-actions a,
.header-actions button {
    transition: all 0.3s ease;
}

.header-actions a:hover,
.header-actions button:hover {
    transform: translateY(-2px);
    color: var(--primary);
}

/* Cart Badge Pulse */
.cart-count {
    animation: pulseGlow 2s infinite;
}

/* ============================================
   SEARCH BAR ANIMATIONS
   ============================================ */

.search-bar form {
    transition: all 0.3s ease;
}

.search-bar form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(125, 60, 255, 0.1);
    transform: scale(1.01);
}

.search-bar input {
    transition: all 0.3s ease;
}

.search-bar button {
    transition: all 0.3s ease;
}

.search-bar button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ============================================
   DROPDOWN ANIMATIONS
   ============================================ */

.dropdown-menu,
.mega-menu,
.cart-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown:hover .dropdown-menu,
.mega-menu-trigger:hover .mega-menu,
.cart-action:hover .cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li,
.mega-menu-column li {
    opacity: 0;
    transform: translateX(-10px);
    animation: fadeInLeft 0.3s ease forwards;
}

.dropdown:hover .dropdown-menu li:nth-child(1) { animation-delay: 0.05s; }
.dropdown:hover .dropdown-menu li:nth-child(2) { animation-delay: 0.1s; }
.dropdown:hover .dropdown-menu li:nth-child(3) { animation-delay: 0.15s; }
.dropdown:hover .dropdown-menu li:nth-child(4) { animation-delay: 0.2s; }
.dropdown:hover .dropdown-menu li:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   FORM INPUT ANIMATIONS
   ============================================ */

input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(125, 60, 255, 0.1);
    transform: scale(1.01);
}

/* Floating Label Effect */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.3s ease;
}

/* Checkbox & Radio Animations */
input[type="checkbox"], input[type="radio"] {
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked, input[type="radio"]:checked {
    animation: popIn 0.3s ease;
}

/* ============================================
   IMAGE HOVER EFFECTS
   ============================================ */

.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Image Overlay Effect */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.image-overlay:hover::after {
    opacity: 1;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: rotate 0.6s linear infinite;
    margin-left: 8px;
}

/* ============================================
   NOTIFICATION ANIMATIONS
   ============================================ */

.notification, .alert, .toast {
    animation: slideInFromBottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.success {
    animation: slideInFromBottom 0.4s ease, pulseGlow 0.5s ease 0.4s;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */

.modal-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ============================================
   QUANTITY SELECTOR ANIMATIONS
   ============================================ */

.quantity-selector button {
    transition: all 0.2s ease;
}

.quantity-selector button:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.quantity-selector button:active {
    transform: scale(0.95);
}

.quantity-selector input {
    transition: all 0.2s ease;
}

/* ============================================
   WISHLIST HEART ANIMATION
   ============================================ */

.wishlist-btn {
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    transform: scale(1.2);
}

.wishlist-btn.active {
    animation: heartbeat 1s ease;
}

.wishlist-btn.active i {
    color: #e53935;
}

/* ============================================
   STAR RATING ANIMATIONS
   ============================================ */

.star-rating-input label {
    transition: all 0.2s ease;
}

.star-rating-input label:hover {
    transform: scale(1.2);
}

.star-rating-input input:checked ~ label {
    animation: popIn 0.3s ease;
}

/* ============================================
   TAB ANIMATIONS
   ============================================ */

.tab-btn {
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(125, 60, 255, 0.05);
}

.tab-btn.active {
    animation: fadeIn 0.3s ease;
}

.tab-pane {
    animation: fadeInUp 0.4s ease;
}

/* ============================================
   ACCORDION ANIMATIONS
   ============================================ */

.accordion-header {
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: var(--gray-100);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

/* ============================================
   FOOTER ANIMATIONS
   ============================================ */

.footer-column {
    opacity: 0;
    transform: translateY(20px);
}

.footer-column:nth-child(1) { animation: fadeInUp 0.5s ease 0.1s forwards; }
.footer-column:nth-child(2) { animation: fadeInUp 0.5s ease 0.2s forwards; }
.footer-column:nth-child(3) { animation: fadeInUp 0.5s ease 0.3s forwards; }
.footer-column:nth-child(4) { animation: fadeInUp 0.5s ease 0.4s forwards; }

.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-5px) scale(1.1);
}

/* ============================================
   BREADCRUMB ANIMATIONS
   ============================================ */

.breadcrumb li {
    opacity: 0;
    animation: fadeInLeft 0.4s ease forwards;
}

.breadcrumb li:nth-child(1) { animation-delay: 0.1s; }
.breadcrumb li:nth-child(2) { animation-delay: 0.15s; }
.breadcrumb li:nth-child(3) { animation-delay: 0.2s; }
.breadcrumb li:nth-child(4) { animation-delay: 0.25s; }

/* ============================================
   BADGE ANIMATIONS
   ============================================ */

.badge, .product-badge {
    animation: popIn 0.4s ease;
}

.badge-sale {
    animation: pulse 2s infinite;
}

/* ============================================
   PRICE ANIMATIONS
   ============================================ */

.price-current {
    transition: all 0.3s ease;
}

.product-card:hover .price-current {
    transform: scale(1.05);
    color: var(--primary);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 95px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(125, 60, 255, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

/* ============================================
   PAGE TRANSITION
   ============================================ */

.page-content {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   SMOOTH SCROLLBAR (WebKit)
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   SELECTION STYLE
   ============================================ */

::selection {
    background: var(--primary);
    color: white;
}

/* ============================================
   REDUCED MOTION PREFERENCE
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    .product-card:hover {
        transform: translateY(-5px);
    }
    
    .category-card:hover {
        transform: translateY(-4px);
    }
    
    .scroll-to-top {
        bottom: 85px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}
