/* =================================================================
   RS PROD AND EVENTS - UX Enhancements
   تحسينات تجربة المستخدم
   ================================================================= */

/* ===============================
   STICKY HEADER
   =============================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(212, 175, 55, 0.1);
    padding: 15px 0;
}

.header.scrolled .logo-img {
    height: 50px;
}

/* ===============================
   SMOOTH SCROLL
   =============================== */
html {
    scroll-behavior: smooth;
}

/* Alternative for browsers that don't support scroll-behavior */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ===============================
   SCROLL TO TOP BUTTON
   =============================== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-gold), var(--light-gold));
    border: none;
    border-radius: 50%;
    color: var(--rich-black);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

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

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

/* RTL Adjustments */
[dir="rtl"] .scroll-to-top {
    right: auto;
    left: 30px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    [dir="rtl"] .scroll-to-top {
        right: auto;
        left: 20px;
    }
}

/* ===============================
   ENHANCED PRELOADER
   =============================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--rich-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    width: 120px;
    height: auto;
    margin-bottom: 30px;
    animation: logoFloat 2s ease-in-out infinite;
}

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

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.preloader-text {
    margin-top: 20px;
    color: var(--primary-gold);
    font-size: 1.1rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ===============================
   LOADING ANIMATIONS
   =============================== */
.section-loading {
    position: relative;
}

.section-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 11;
}

/* ===============================
   LAZY LOADING
   =============================== */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* ===============================
   PAGE TRANSITIONS
   =============================== */
.page-transition {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================
   MOBILE MENU ENHANCEMENTS
   =============================== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 80px 30px 30px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

[dir="rtl"] .mobile-menu {
    right: auto;
    left: -100%;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    right: 0;
}

[dir="rtl"] .mobile-menu.active {
    left: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 998;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===============================
   HOVER EFFECTS
   =============================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ===============================
   FOCUS STATES (Accessibility)
   =============================== */
a:focus,
button:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 4px;
}

/* ===============================
   LOADING SKELETON
   =============================== */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(212, 175, 55, 0.05) 0%,
        rgba(212, 175, 55, 0.1) 50%,
        rgba(212, 175, 55, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* ===============================
   TOOLTIP
   =============================== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(212, 175, 55, 0.95);
    color: var(--rich-black);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* ===============================
   RESPONSIVE UTILITIES
   =============================== */
@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* ===============================
   PRINT STYLES
   =============================== */
@media print {
    .header,
    .preloader,
    .scroll-to-top,
    .mobile-menu,
    .lang-switcher {
        display: none !important;
    }
}
