/* ==================== Global Styles ==================== */
* {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F5ECD7;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #C5A55A, #8B4513);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #DAA520, #A0522D);
}

/* ==================== Animations ==================== */
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes rotate-badge {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideHero {
    0%, 30% { opacity: 1; }
    33%, 97% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes musical-note {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0.5);
    }
    20% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-400px) rotate(360deg) scale(1.2);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

/* ==================== Hero Section ==================== */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

/* Made in Iraq Badge */
.made-in-iraq-badge .rotate-badge {
    animation: rotate-badge 20s linear infinite;
}

.made-in-iraq-badge:hover .rotate-badge {
    animation-play-state: paused;
}

/* Musical Note Particles */
.musical-note {
    position: absolute;
    color: rgba(218, 165, 32, 0.4);
    font-size: 1.2rem;
    animation: musical-note linear forwards;
    pointer-events: none;
}

/* ==================== Navigation ==================== */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to left, #DAA520, #8B4513);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #DAA520;
}

/* Header scroll effect */
#header.scrolled {
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.15);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* ==================== Gallery ==================== */
.gallery-item {
    transition: all 0.4s ease;
}

.gallery-item.hidden-item {
    display: none;
}

.gallery-filter.active {
    background-color: #DAA520;
    color: #2D1605;
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
}

/* ==================== Lightbox ==================== */
#lightbox {
    display: none;
    backdrop-filter: blur(5px);
}

#lightbox.active {
    display: flex;
}

#lightboxImg {
    animation: fadeInUp 0.3s ease;
}

/* ==================== Contact Form ==================== */
#contactForm input:focus,
#contactForm textarea:focus {
    border-color: #DAA520;
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.15);
}

/* ==================== Section Dividers ==================== */
.section-divider {
    height: 4px;
    background: linear-gradient(to left, transparent, #DAA520, #8B4513, #DAA520, transparent);
}

/* ==================== Responsive Adjustments ==================== */
@media (max-width: 768px) {
    .hero-slide {
        background-position: center center;
    }
    
    .made-in-iraq-badge {
        top: 1rem !important;
        left: 1rem !important;
    }
    
    .made-in-iraq-badge .rotate-badge {
        width: 5rem !important;
        height: 5rem !important;
    }

    /* Timeline mobile adjustments */
    .timeline-line {
        right: 1.5rem;
    }
}

/* ==================== Loading Animation ==================== */
.page-loader {
    position: fixed;
    inset: 0;
    background: #FAF3E6;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E8D5B0;
    border-top-color: #DAA520;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Product Cards ==================== */
.product-card:hover .product-overlay {
    opacity: 1;
}

/* ==================== Selection Color ==================== */
::selection {
    background-color: #DAA520;
    color: #2D1605;
}

::-moz-selection {
    background-color: #DAA520;
    color: #2D1605;
}

/* ==================== Smooth Scroll for RTL ==================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* ==================== Print Styles ==================== */
@media print {
    .fixed, header, footer, #lightbox {
        display: none !important;
    }
}