/**
 * Animations for carwash24
 * Adds subtle animations to enhance the user experience
 */

/* Card animations */
.carwash-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.carwash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Staggered animation for cards */
.carwash-card:nth-child(1) { animation-delay: 0.05s; }
.carwash-card:nth-child(2) { animation-delay: 0.1s; }
.carwash-card:nth-child(3) { animation-delay: 0.15s; }
.carwash-card:nth-child(4) { animation-delay: 0.2s; }
.carwash-card:nth-child(5) { animation-delay: 0.25s; }
.carwash-card:nth-child(6) { animation-delay: 0.3s; }
.carwash-card:nth-child(7) { animation-delay: 0.35s; }
.carwash-card:nth-child(8) { animation-delay: 0.4s; }
.carwash-card:nth-child(9) { animation-delay: 0.45s; }
.carwash-card:nth-child(10) { animation-delay: 0.5s; }
.carwash-card:nth-child(11) { animation-delay: 0.55s; }
.carwash-card:nth-child(12) { animation-delay: 0.6s; }

/* Image hover effect */
.carwash-card img {
    transition: transform 0.5s ease;
}

.carwash-card:hover img {
    transform: scale(1.05);
}

/* Button animations */
.btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:active {
    transform: scale(0.95);
}

/* Theme toggle button animation */
#theme-toggle-btn {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#theme-toggle-btn:hover {
    transform: rotate(30deg);
}

/* Filter tag animations */
.filter-tag {
    transition: all 0.3s ease;
}

.filter-tag:hover {
    transform: translateY(-2px);
}

.filter-tag.active {
    animation: pulse 1.5s infinite;
}

/* Modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: scale(0.9);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Search filter card animation */
.search-filter-card {
    transition: box-shadow 0.3s ease;
}

.search-filter-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 197, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(0, 212, 197, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 197, 0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading animation */
#loading {
    position: relative;
    padding-left: 30px;
    transition: opacity 0.3s ease;
}

#loading:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 197, 0.3);
    border-top-color: var(--primary-color);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Comparison feature styles */
.comparison-container {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--gray-100);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    animation: fadeInUp 0.5s ease-out;
}

.comparison-card {
    flex: 0 0 300px;
    background-color: white;
    border-radius: var(--card-border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comparison-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .comparison-container {
    background-color: var(--gray-800);
}

[data-bs-theme="dark"] .comparison-card {
    background-color: var(--gray-700);
}

/* Offline mode styles */
#offline-indicator {
    animation: slideDown 0.3s ease-out forwards;
}

.offline-card {
    position: relative;
}

.offline-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.03) 25%, transparent 25%, transparent 50%, rgba(0,0,0,0.03) 50%, rgba(0,0,0,0.03) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
    border-radius: var(--card-border-radius);
}

.save-offline-btn {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.save-offline-btn:hover {
    transform: translateY(-2px);
}

.save-offline-btn i.bxs-download {
    color: var(--primary-color);
}

#toast-container .toast {
    animation: fadeInUp 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}
