/**
 * ZMediaCom - Styles principaux (Bootstrap 5.3 compatible)
 * Minimal overrides and custom components
 */

/* ============================================
   BASE & GLOBAL
   ============================================ */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--bs-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   SEARCH AUTOCOMPLETE
   ============================================ */

.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1060;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}

.search-autocomplete.active {
    display: block;
}

.search-autocomplete .autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
    font-size: 0.85rem;
    border-bottom: 1px solid #f0f0f0;
}

.search-autocomplete .autocomplete-item:last-child {
    border-bottom: none;
}

.search-autocomplete .autocomplete-item:hover,
.search-autocomplete .autocomplete-item.focused {
    background: #f8f9fa;
}

.search-autocomplete .autocomplete-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-autocomplete .autocomplete-title {
    font-weight: 600;
    line-height: 1.3;
}

.search-autocomplete .autocomplete-category {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   LAZY LOADING & IMAGE SKELETON
   ============================================ */

img.img-fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}

img.img-fade.loaded {
    opacity: 1;
}

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

.img-skeleton.loaded {
    background: none;
    animation: none;
}

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

/* ============================================
   FLASH MESSAGES ANIMATIONS
   ============================================ */

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.animate-on-scroll,
.fade-in-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-left-scroll {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-right-scroll {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-up-scroll {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible,
.fade-in-scroll.is-visible,
.slide-left-scroll.is-visible,
.slide-right-scroll.is-visible,
.scale-up-scroll.is-visible {
    opacity: 1;
    transform: none;
}

.stagger-children > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.is-visible > * {
    opacity: 1;
    transform: none;
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.5s; }

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

@media (max-width: 575.98px) {
    .scroll-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

