/* 
 * SMP Website - Critical Styles
 * الأنماط الحرجة - يتم تحميلها أولاً لسرعة عرض الصفحة
 * Version: 3.0 - Performance Optimized
 * Size: ~18KB (optimized)
 */

/* ============================================
   1. BASE RESET & VARIABLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --accent-primary: #C9A961;
    --accent-secondary: #B8860B;
    --accent-tertiary: #DAA520;
    --accent-dark: #85754E;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;
    --border-color: rgba(201, 169, 97, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
    --gradient-primary: linear-gradient(135deg, #85754E 0%, #C9A961 50%, #B8860B 100%);
    --gradient-secondary: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    --gradient-dark: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Luxury Background Pattern - مبسط */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(201, 169, 97, 0.03) 35px, rgba(201, 169, 97, 0.03) 70px);
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   2. LANGUAGE SUPPORT (Critical)
   ============================================ */
.lang-en {
    display: none;
}

.lang-ar {
    display: inline;
}

body.lang-en .lang-en {
    display: inline;
}

body.lang-en .lang-ar {
    display: none;
}

body.lang-en {
    direction: ltr;
    text-align: left;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.lang-ar {
    direction: rtl;
    text-align: right;
}

/* Block-level language elements */
.hero-main-title .lang-ar,
.hero-main-title .lang-en,
.hero-main-subtitle .lang-ar,
.hero-main-subtitle .lang-en,
.hero-description .lang-ar,
.hero-description .lang-en {
    display: block;
}

body.lang-en .hero-main-title .lang-ar,
body.lang-en .hero-main-subtitle .lang-ar,
body.lang-en .hero-description .lang-ar {
    display: none;
}

body.lang-en .hero-main-title .lang-en,
body.lang-en .hero-main-subtitle .lang-en,
body.lang-en .hero-description .lang-en {
    display: block;
}

/* ============================================
   3. NAVBAR (Critical for First Paint)
   ============================================ */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.menu-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-list {
    display: flex;
    list-style: none;
    gap: 5px;
}

.menu-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.menu-link:hover,
.menu-link.active {
    background: rgba(201, 169, 97, 0.15);
    color: var(--accent-primary);
}

.menu-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-toggle-btn {
    background: rgba(201, 169, 97, 0.1);
    border: 2px solid var(--border-color);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-toggle-btn:hover {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   4. HERO SECTION (Above the Fold)
   ============================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    transform: scale(1.1);
    background-image: url('/images/hero01.png');
    background-size: cover;
    background-position: center;
}

/* ============================================
   8. PRELOADER (Added)
   ============================================ */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-content {
    position: relative;
    width: 80px;
    height: 80px;
}

.loader-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(201, 169, 97, 0.2);
    border-top-color: #C9A961;
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(10, 10, 10, 0.85) 0%,
            rgba(26, 26, 26, 0.75) 50%,
            rgba(10, 10, 10, 0.85) 100%);
}

.hero-container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    width: 100%;
}

.hero-text-layer {
    flex: 1;
    max-width: 600px;
}

.hero-main-title {
    font-size: 5.04rem;
    font-weight: 900;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-main-subtitle {
    font-size: 1.872rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.6;
}

.hero-cta-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.hero-btn {
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Cairo', sans-serif;
}

.hero-btn.primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: 0 8px 25px rgba(201, 169, 97, 0.4);
}

.hero-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(201, 169, 97, 0.6);
}

/* ============================================
   5. PAGE SECTIONS (Base Structure)
   ============================================ */
.page-section {
    padding: 80px 0;
    position: relative;
    z-index: 10;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clients-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 50px;
}

/* ============================================
   6. SKELETON LOADERS (Critical)
   ============================================ */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
    grid-column: 1 / -1;
}

.skeleton-service-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   7. RESPONSIVE (Critical Breakpoints Only)
   ============================================ */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .menu-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(26, 26, 26, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
    }

    .menu-list.active {
        display: flex;
    }

    .hero-main-title {
        font-size: 3.6rem;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .menu-container {
        padding: 15px 20px;
    }

    .hero-main-title {
        font-size: 2.88rem;
    }

    .hero-main-subtitle {
        font-size: 1.584rem;
    }

    .content-container {
        padding: 0 20px;
    }
}