/**
 * Modern Design Enhancements for Al Zan Building Materials
 * تحسينات التصميم العصرية
 *
 * This file adds modern, contemporary design improvements including:
 * - Enhanced gradients and shadows
 * - Smooth animations
 * - Modern typography
 * - Better visual hierarchy
 * - Contemporary color palette enhancements
 */

/* ============================================
   Modern Color Palette Enhancements
   ============================================ */
:root {
    /* Modern Gradients */
    --modern-gradient-primary: linear-gradient(135deg, #b79462 0%, #d4a574 50%, #b79462 100%);
    --modern-gradient-hero: linear-gradient(165deg, #fdfbf7 0%, #f7f1e8 40%, #ede4d7 100%);
    --modern-gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 241, 232, 0.95) 100%);

    /* Enhanced Shadows */
    --modern-shadow-sm: 0 2px 8px rgba(17, 18, 15, 0.04), 0 4px 16px rgba(17, 18, 15, 0.03);
    --modern-shadow-md: 0 4px 12px rgba(17, 18, 15, 0.06), 0 8px 24px rgba(17, 18, 15, 0.08);
    --modern-shadow-lg: 0 12px 32px rgba(17, 18, 15, 0.1), 0 24px 64px rgba(17, 18, 15, 0.12);
    --modern-shadow-xl: 0 20px 48px rgba(17, 18, 15, 0.14), 0 40px 96px rgba(17, 18, 15, 0.16);
    --modern-shadow-glow: 0 0 24px rgba(183, 148, 98, 0.2), 0 8px 32px rgba(183, 148, 98, 0.15);

    /* Enhanced Gold Tones */
    --modern-gold-light: #e5c789;
    --modern-gold-medium: #d4a574;
    --modern-gold-dark: #9d7846;
    --modern-gold-gradient: linear-gradient(135deg, #e5c789 0%, #b79462 50%, #9d7846 100%);

    /* Modern Neutrals */
    --modern-white: #ffffff;
    --modern-ivory: #fdfbf7;
    --modern-cream: #f9f6f0;
    --modern-warm-gray: #e8e3db;

    /* Accent Colors */
    --modern-accent-blue: #4a90e2;
    --modern-accent-green: #27ae60;
    --modern-accent-red: #e74c3c;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: transparent;
    border: 1px solid rgba(183, 148, 98, 0.2);
    color: var(--archin-charcoal);
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.dark-mode-toggle:hover {
    background: rgba(183, 148, 98, 0.1);
    border-color: var(--archin-gold);
}

.dark-mode-toggle .moon-icon {
    display: block;
}

.dark-mode-toggle .sun-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle .moon-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle .sun-icon {
    display: block;
}

body.dark-mode .dark-mode-toggle {
    color: #f2efe8;
    border-color: rgba(183, 148, 98, 0.4);
}

/* ============================================
   Enhanced Header & Logo
   ============================================ */
.site-header {
    backdrop-filter: blur(24px) saturate(180%);
    background: rgba(253, 251, 247, 0.85);
    border-bottom: 1px solid rgba(183, 148, 98, 0.08);
    box-shadow: var(--modern-shadow-sm);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(183, 148, 98, 0.12);
    box-shadow: var(--modern-shadow-md);
}

.brand-mark {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-mark:hover {
    transform: translateY(-2px);
}

.brand-mark-logo {
    height: 80px;
    max-width: min(280px, 42vw);
    filter: drop-shadow(0 4px 12px rgba(183, 148, 98, 0.15))
            drop-shadow(0 8px 24px rgba(17, 18, 15, 0.08));
    transition: filter 0.35s ease, transform 0.35s ease;
}

.brand-mark:hover .brand-mark-logo {
    filter: drop-shadow(0 6px 16px rgba(183, 148, 98, 0.25))
            drop-shadow(0 12px 32px rgba(17, 18, 15, 0.12));
    transform: scale(1.02);
}

/* Modern Logo Glow Effect */
@media (min-width: 1024px) {
    .brand-mark-logo {
        position: relative;
    }

    .brand-mark:hover .brand-mark-logo::before {
        content: '';
        position: absolute;
        inset: -10px;
        background: radial-gradient(circle, rgba(183, 148, 98, 0.1) 0%, transparent 70%);
        border-radius: 12px;
        opacity: 0;
        animation: logoGlow 2s ease-in-out infinite;
    }
}

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

/* ============================================
   Modern Navigation
   ============================================ */
.site-nav a {
    position: relative;
    color: var(--archin-charcoal);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--modern-gold-gradient);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-nav a:hover {
    color: var(--archin-gold);
    background: rgba(183, 148, 98, 0.06);
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

.site-nav a.is-active {
    color: var(--archin-gold);
    background: rgba(183, 148, 98, 0.1);
}

.site-nav a.is-active::after {
    transform: scaleX(1);
}

/* ============================================
   Modern Buttons & CTAs
   ============================================ */
.cta-btn,
.primary-action,
button[type="submit"],
.btn-primary {
    position: relative;
    background: var(--modern-gold-gradient);
    color: var(--modern-white);
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 14px;
    border: none;
    box-shadow: var(--modern-shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cta-btn::before,
.primary-action::before,
button[type="submit"]::before,
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cta-btn:hover,
.primary-action:hover,
button[type="submit"]:hover,
.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--modern-shadow-lg), var(--modern-shadow-glow);
}

.cta-btn:hover::before,
.primary-action:hover::before,
button[type="submit"]:hover::before,
.btn-primary:hover::before {
    opacity: 1;
}

.cta-btn:active,
.primary-action:active,
button[type="submit"]:active,
.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

/* Secondary Button Style */
.btn-secondary {
    background: var(--modern-cream);
    color: var(--archin-charcoal);
    border: 2px solid rgba(183, 148, 98, 0.2);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 14px;
    box-shadow: var(--modern-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: var(--modern-white);
    border-color: var(--archin-gold);
    color: var(--archin-gold);
    box-shadow: var(--modern-shadow-md);
    transform: translateY(-2px);
}

/* ============================================
   Modern Cards & Sections
   ============================================ */
.category-card,
.service-card,
.brand-card,
.product-card,
.document-card,
.info-card {
    background: var(--modern-gradient-card);
    border-radius: 20px;
    border: 1px solid rgba(183, 148, 98, 0.08);
    box-shadow: var(--modern-shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.category-card:hover,
.service-card:hover,
.brand-card:hover,
.product-card:hover,
.document-card:hover,
.info-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--modern-shadow-xl);
    border-color: rgba(183, 148, 98, 0.2);
}

/* Card Image Enhancement */
.category-card img,
.service-card img,
.brand-card img,
.product-card img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover img,
.service-card:hover img,
.brand-card:hover img,
.product-card:hover img {
    transform: scale(1.08);
}

/* ============================================
   Modern Hero Section
   ============================================ */
.archin-hero-section,
.home-hero {
    position: relative;
    background: var(--modern-gradient-hero);
    overflow: hidden;
}

.archin-hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(183, 148, 98, 0.08) 0%,
        transparent 70%
    );
    animation: heroGlow 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroGlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-10%, 5%) scale(1.1);
        opacity: 0.9;
    }
}

/* ============================================
   Modern Typography Enhancements
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    background: var(--modern-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

h2 {
    color: var(--archin-charcoal);
    position: relative;
}

/* Modern Section Headers */
.home-section-header h2,
.section-title {
    position: relative;
    display: inline-block;
}

.home-section-header h2::after,
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--modern-gold-gradient);
    border-radius: 2px;
}

/* ============================================
   Smooth Scroll Animations
   ============================================ */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.15s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.25s; }
.reveal-on-scroll:nth-child(6) { transition-delay: 0.3s; }

/* ============================================
   Modern Floating Elements
   ============================================ */
.floating-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
    box-shadow: var(--modern-shadow-lg),
                0 0 32px rgba(37, 211, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-whatsapp:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--modern-shadow-xl),
                0 0 40px rgba(37, 211, 102, 0.4);
}

/* ============================================
   Modern Form Elements
   ============================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    background: var(--modern-white);
    border: 2px solid rgba(183, 148, 98, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--archin-gold);
    box-shadow: 0 0 0 4px rgba(183, 148, 98, 0.1),
                var(--modern-shadow-sm);
    transform: translateY(-1px);
}

/* ============================================
   Modern Footer
   ============================================ */
.site-footer {
    background: linear-gradient(180deg,
                var(--archin-charcoal) 0%,
                var(--archin-charcoal-2) 100%);
    border-top: 2px solid rgba(183, 148, 98, 0.2);
    box-shadow: 0 -20px 40px rgba(17, 18, 15, 0.1);
}

/* ============================================
   Modern Loading States
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(183, 148, 98, 0.05) 0%,
        rgba(183, 148, 98, 0.15) 50%,
        rgba(183, 148, 98, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

/* ============================================
   Responsive Enhancements
   ============================================ */
@media (max-width: 767px) {
    .brand-mark-logo {
        height: 56px;
        max-width: min(180px, 45vw);
    }

    .site-nav a {
        font-size: 1rem;
        padding: 12px 20px;
    }

    .cta-btn,
    .primary-action,
    button[type="submit"],
    .btn-primary {
        width: 100%;
        padding: 16px 24px;
        font-size: 1.05rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

/* ============================================
   Dark Mode Implementation
   ============================================ */
body.dark-mode {
    --modern-gradient-hero: linear-gradient(165deg, #0c1118 0%, #1a2230 40%, #0c1118 100%);
    --modern-gradient-card: linear-gradient(145deg, rgba(26, 34, 48, 0.9) 0%, rgba(12, 17, 24, 0.95) 100%);
    --modern-white: #0c1118;
    --modern-ivory: #0c1118;
    --modern-cream: #1a2230;
    --modern-warm-gray: #334155;
    
    background-color: #0c1118;
    color: #f2efe8;
}

body.dark-mode .site-header {
    background: rgba(12, 17, 24, 0.85);
    border-bottom-color: rgba(183, 148, 98, 0.2);
}

body.dark-mode .site-header.is-scrolled {
    background: rgba(12, 17, 24, 0.98);
}

body.dark-mode .site-nav a {
    color: #f2efe8;
}

body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode p {
    color: #f2efe8;
}

body.dark-mode .archin-service-card,
body.dark-mode .category-card,
body.dark-mode .brand-card,
body.dark-mode .product-card {
    background: rgba(26, 34, 48, 0.8);
    border-color: rgba(183, 148, 98, 0.15);
}

body.dark-mode .btn-secondary {
    background: #1a2230;
    color: #f2efe8;
    border-color: rgba(183, 148, 98, 0.3);
}

body.dark-mode .btn-secondary:hover {
    background: #252f3f;
    border-color: var(--archin-gold);
}

body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="tel"],
body.dark-mode textarea,
body.dark-mode select {
    background: #1a2230;
    color: #f2efe8;
    border-color: rgba(183, 148, 98, 0.3);
}

body.dark-mode .brand-mark-logo {
    filter: drop-shadow(0 4px 12px rgba(183, 148, 98, 0.3))
            brightness(1.1) contrast(1.1);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .site-header,
    .floating-whatsapp,
    .assistant-dock,
    .mobile-nav-toggle {
        display: none !important;
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .site-header {
        border-bottom-width: 2px;
    }

    .cta-btn,
    .primary-action,
    button[type="submit"],
    .btn-primary {
        border: 2px solid var(--modern-white);
    }
}

/* ============================================
   Modern Utility Classes
   ============================================ */
.glass-effect {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.8);
}

.gradient-text {
    background: var(--modern-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-shadow {
    box-shadow: var(--modern-shadow-md);
}

.modern-shadow-lg {
    box-shadow: var(--modern-shadow-lg);
}

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

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

/* ============================================
   Music Player Styles
   ============================================ */
.music-toggle-btn {
    background: rgba(183, 148, 98, 0.1);
    border: 1px solid rgba(183, 148, 98, 0.2);
    color: var(--archin-gold);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    margin-right: 15px;
    overflow: hidden;
}

.music-toggle-btn:hover {
    background: rgba(183, 148, 98, 0.2);
    transform: scale(1.05);
}

.music-toggle-btn.is-playing .music-icon {
    animation: pulse 2s infinite;
}

.music-waves {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    position: absolute;
    bottom: 8px;
}

.music-waves span {
    width: 2px;
    background: var(--archin-gold);
    border-radius: 1px;
    transition: height 0.2s ease;
}

.music-toggle-btn.is-playing .music-waves span {
    animation: wave 1s ease-in-out infinite;
}

.music-toggle-btn.is-playing .music-waves span:nth-child(2) { animation-delay: 0.2s; }
.music-toggle-btn.is-playing .music-waves span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 4px; }
    50% { height: 12px; }
}

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

/* ============================================
   Brand Logos Marquee
   ============================================ */
.brands-marquee-section {
    padding: 60px 0;
    background: var(--surface-light);
    overflow: hidden;
    border-top: 1px solid rgba(183, 148, 98, 0.1);
    border-bottom: 1px solid rgba(183, 148, 98, 0.1);
}

.marquee-container {
    display: flex;
    width: 200%;
    animation: marquee 30s linear infinite;
}

.marquee-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 50%;
}

.marquee-item {
    padding: 0 40px;
    flex-shrink: 0;
}

.marquee-item img {
    height: 50px;
    width: auto;
    filter: grayscale(1) opacity(0.5);
    transition: all 0.4s ease;
}

.marquee-item:hover img {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
