/* Modern Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translate3d(0, 20px, 0); opacity: 0; }
    to { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translate3d(20px, 0, 0); opacity: 0; }
    to { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translate3d(-20px, 0, 0); opacity: 0; }
    to { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Staggered Animations */
[data-aos-delay] {
    animation-delay: calc(var(--aos-delay) * 1ms) !important;
}

/* Scroll Reveal Animations */
[data-scroll] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-scroll="fade-in"] {
    transform: translateY(20px);
}

[data-scroll="fade-in"].is-visible {
    opacity: 1;
    transform: translateY(0);
}

[data-scroll="fade-right"] {
    transform: translateX(-20px);
}

[data-scroll="fade-right"].is-visible {
    opacity: 1;
    transform: translateX(0);
}

[data-scroll="fade-left"] {
    transform: translateX(20px);
}

[data-scroll="fade-left"].is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Hover Effects */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Button Hover Effect */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-hover-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-hover);
    z-index: -1;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.btn-hover-effect:hover::after {
    transform: scaleY(1);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Loading Shimmer */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated Underline */
.underline-animation {
    position: relative;
    display: inline-block;
}

.underline-animation::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.underline-animation:hover::after {
    width: 100%;
}


.brand-logo {
    transition: transform 0.3s ease;
}

.navbar-brand:hover .brand-logo {
    transform: scale(1.05);
}

.brand-text {
    font-family: 'Cairo', sans-serif;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Floating Actions */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.floating-btn.add-adv-btn {
    background: var(--primary-color);
    color: white;
}

/* Live Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 999;
    display: none;
    animation: slideUp 0.3s ease;
}

.chat-widget.active {
    display: block;
}

.chat-header {
    padding: 15px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.message.support {
    margin-right: auto;
}

.message.user {
    margin-left: auto;
}

.message-content {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message-time {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.75rem;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.chat-input .form-control {
    border-radius: 20px;
}

.chat-input .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.toast {
    background: white;
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.toast-header {
    border: none;
    background: transparent;
}

/* Enhanced Card Hover Effects */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Button Hover Effects */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255,255,255,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn:hover::after {
    transform: translateX(0);
}

/* Form Focus Effects */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,0.25);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Image Hover Effects */
.listing-card img {
    transition: transform 0.3s ease;
}

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

/* Section Animations */
.section-header, .category-item, .stat-item {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.listing-card {
    opacity: 0;
    animation: slideUp 0.5s ease forwards;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

/* Accessibility Improvements */
.btn:focus, .form-control:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,0.25);
}
