/* --- المتغيرات - Light Theme ناصع وفخم --- */
:root {
    --bg-main: #ffffff;       
    --bg-darker: #f9f9f9;     
    --accent: #C5835D;        
    --accent-glow: rgba(197, 131, 93, 0.3);
    --text-main: #1a1a1a;     
    --text-muted: #555555;    
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.05); 
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 5px; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Preloader --- */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff;
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; transition: opacity 0.5s ease;
}
.loader { text-align: center; color: var(--accent); }
.loader i { font-size: 3rem; animation: hammer 1s infinite alternate; margin-bottom: 15px;}
@keyframes hammer { 0% { transform: rotate(0deg); } 100% { transform: rotate(-45deg); } }

/* --- Navbar --- */
#main-header {
    position: fixed; width: 100%; top: 0; z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}
#main-header.scrolled { box-shadow: 0 5px 20px rgba(0,0,0,0.05); }

/* الـ Container الخاص بالناف بار */
.nav-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 90px; 
}

/* الحاوية الجديدة اللي بتضم الروابط والزرار */
.main-nav {
    display: flex;
    align-items: center;
}

/* تنسيق اللوجو البرمجي */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
}
.brand-logo-svg {
    height: 85px; 
    width: auto;
    transition: var(--transition);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
}
.brand-logo-svg:hover { transform: scale(1.05); }

.nav-links { display: flex; gap: 30px; list-style: none; align-items: center;}
.nav-links a { color: var(--text-main); text-decoration: none; font-weight: 700; font-size: 1.1rem; transition: var(--transition); }
.nav-links a:hover { color: var(--accent); }

/* Buttons */
.btn-solid {
    background: var(--accent); color: #fff; padding: 12px 30px; border-radius: 8px;
    font-weight: 800; text-decoration: none; display: inline-block;
    box-shadow: 0 5px 15px var(--accent-glow); transition: var(--transition);
    border: none; cursor: pointer;
}
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 8px 25px var(--accent-glow); background: #b0704b; }
.btn-outline {
    background: transparent; color: #ffffff; padding: 12px 30px; border-radius: 8px;
    font-weight: 700; text-decoration: none; display: inline-block;
    border: 2px solid rgba(255,255,255,0.4); transition: var(--transition);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: #fff;}
.btn-glow {
    border: 2px solid var(--accent); color: var(--accent) !important;
    padding: 8px 25px; border-radius: 30px; background: transparent;
}
.btn-glow:hover { background: var(--accent); color: #fff !important; box-shadow: 0 5px 15px var(--accent-glow); }

/* --- Hero Section --- */
.hero {
    height: 100vh; position: relative; display: flex; align-items: center;
    overflow: hidden; padding-top: 90px;
}
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1540574163026-643ea20ade25?q=80&w=2070&auto=format&fit=crop') center/cover;
    filter: brightness(0.5) contrast(1.1); 
    z-index: -1;
    transform: scale(1.05); animation: zoomBg 20s infinite alternate;
}
@keyframes zoomBg { 100% { transform: scale(1.15); } }
.hero-content { position: relative; z-index: 1; text-align: right; max-width: 800px; }
.hero-content h1 { color: #ffffff; font-size: 5rem; font-weight: 900; line-height: 1.1; margin-bottom: 20px; text-shadow: 0 5px 15px rgba(0,0,0,0.6); }
.hero-content h1 span { color: var(--accent); }
.hero-content p { color: #f0f0f0; font-size: 1.3rem; margin-bottom: 40px; max-width: 600px; }
.hero-buttons { display: flex; gap: 20px; }

/* --- Sections Common --- */
.section-padding { padding: 120px 0; }
.section-header { text-align: center; margin-bottom: 70px; }
.section-header h2 { font-size: 3rem; font-weight: 900; margin-bottom: 10px; color: var(--text-main); }
.section-header h2 span { color: var(--accent); }
.section-header p { color: var(--text-muted); font-size: 1.2rem; }

/* --- Services Section --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.service-card {
    background: #ffffff; border: 1px solid #eeeeee;
    padding: 40px 30px; border-radius: 16px; text-align: center;
    transition: var(--transition); box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}
.service-card:hover { transform: translateY(-15px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(197,131,93,0.15); }
.icon-wrapper { width: 80px; height: 80px; background: rgba(197, 131, 93, 0.1); border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px; transition: var(--transition);}
.service-card:hover .icon-wrapper { background: var(--accent); }
.icon-wrapper i { font-size: 2rem; color: var(--accent); }
.service-card:hover .icon-wrapper i { color: #ffffff; }
.service-card h3 { font-size: 1.5rem; margin-bottom: 15px; color: var(--text-main); font-weight: 800; }
.service-card p { color: var(--text-muted); line-height: 1.6; }

/* --- Portfolio Gallery --- */
.alt-bg { background: var(--bg-darker); } 
.premium-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 300px;
    gap: 20px;
}
.gallery-item {
    position: relative; border-radius: 16px; overflow: hidden;
    cursor: pointer; border: 1px solid var(--glass-border);
}
.gallery-item:nth-child(1), .gallery-item:nth-child(4) { grid-column: span 2; grid-row: span 2; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.gallery-item:hover img { transform: scale(1.1) rotate(-1deg); filter: brightness(0.7); }
.gallery-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 30px; opacity: 0; transition: var(--transition); transform: translateY(20px);
}
.gallery-item:hover .gallery-overlay { opacity: 1; transform: translateY(0); }
.gallery-overlay h3 { color: #ffffff; font-size: 1.5rem; margin-bottom: 5px; }
.gallery-overlay p { color: var(--accent); font-weight: 600; }

/* --- Location Section --- */
.location-section {
    padding-top: 120px;
    background-color: #ffffff;
}
.map-wrapper {
    position: relative;
    width: 100%; 
    height: 550px;
    line-height: 0;
    margin-top: 40px;
}
.map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: grayscale(20%) contrast(1.1) opacity(0.9); 
    transition: var(--transition);
}
.map-wrapper:hover iframe {
    filter: grayscale(0%) contrast(1) opacity(1);
}

.map-overlay-top, .map-overlay-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    pointer-events: none;
    z-index: 2;
}
.map-overlay-top {
    top: 0;
    background: linear-gradient(to bottom, #ffffff, transparent);
}
.map-overlay-bottom {
    bottom: 0;
    background: linear-gradient(to top, #ffffff, transparent);
}

.map-floating-card {
    position: absolute;
    top: 50%;
    right: 8%; 
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 3;
    max-width: 380px;
    border: 1px solid rgba(197, 131, 93, 0.3);
    line-height: 1.8;
}
.map-floating-card h3 {
    color: var(--text-main);
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 800;
}
.map-floating-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- Footer --- */
.premium-footer { background: #ffffff; border-top: none; padding-top: 80px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 50px; margin-bottom: 60px; }

.footer-logo-svg {
    height: 160px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.footer-about p { color: var(--text-muted); margin-bottom: 20px; line-height: 1.8; }
.social-icons a { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; border-radius: 50%; background: #f0f0f0; color: #333; margin-left: 10px; transition: var(--transition); }
.social-icons a:hover { background: var(--accent); color: #fff; transform: translateY(-5px); box-shadow: 0 5px 15px var(--accent-glow); }
.footer-contact ul { list-style: none; margin-bottom: 20px; }
.footer-contact ul li { color: var(--text-muted); margin-bottom: 15px; display: flex; align-items: center; gap: 15px; font-weight: 600; }
.footer-contact ul li i { color: var(--accent); font-size: 1.2rem; }

.footer-action-btns {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}
.footer-action-btns a {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: var(--transition);
    font-size: 1.1rem;
}
.btn-call {
    background-color: #2c3e50;
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.2);
}
.btn-call:hover {
    background-color: #1a252f;
    transform: translateY(-3px);
}
.btn-whatsapp {
    background-color: #25d366;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.2);
}
.btn-whatsapp:hover {
    background-color: #1ebe57;
    transform: translateY(-3px);
}

.footer-form input { width: 100%; background: #f9f9f9; border: 1px solid #e0e0e0; padding: 15px; border-radius: 8px; color: #333; margin-bottom: 15px; outline: none; transition: var(--transition); }
.footer-form input:focus { border-color: var(--accent); background: #ffffff; box-shadow: 0 0 10px rgba(197,131,93,0.1); }
.footer-form h3 { color: var(--text-main); margin-bottom: 20px; }

.footer-bottom { background: #f9f9f9; text-align: center; padding: 25px; color: var(--text-muted); border-top: 1px solid #eeeeee; }

/* تنسيق رابط المطور (المهندس حسام حسن) */
a.dev-name { 
    color: var(--accent); 
    font-weight: 700; 
    text-decoration: none;
    transition: var(--transition);
}
a.dev-name:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* ========================================= */
/* --- Responsive Design & Mobile Menu --- */
/* ========================================= */

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001; 
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: var(--transition);
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
    background-color: var(--accent);
}
.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
    background-color: var(--accent);
}

@media (max-width: 992px) {
    .mobile-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: -100vh; /* القائمة بتنزل من فوق */
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: top 0.4s ease-in-out; /* حركة سلسة */
        z-index: 1000;
    }

    .nav-links.active {
        top: 0;
    }

    /* تكبير حجم الروابط زي الصورة المرفقة */
    .nav-links a {
        font-size: 2rem;
        font-weight: 700;
        color: var(--text-main);
    }
    
    .nav-links a:hover {
        color: var(--accent);
    }

    /* تصميم زر التواصل في الموبايل */
    .nav-links a.btn-glow {
        font-size: 1.5rem;
        padding: 10px 40px;
        border: 2px solid var(--accent);
        border-radius: 50px;
        color: var(--accent) !important;
        background: transparent;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .hero-buttons {
        flex-direction: column;
    }
    .section-header h2 {
        font-size: 2.2rem;
    }
    .map-wrapper {
        height: 400px;
    }
    .map-floating-card {
        right: 5%;
        left: 5%;
        max-width: 90%;
        padding: 25px;
    }
}
/* ========================================= */
/* --- شريط البحث السريع للجدول --- */
/* ========================================= */
.search-bar-container {
    position: relative;
    max-width: 400px;
    margin-bottom: 20px;
}

.search-bar-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-bar-container input {
    width: 100%;
    padding: 12px 15px 12px 15px;
    padding-right: 45px; /* عشان نسيب مساحة لأيقونة البحث يمين */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.search-bar-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(197, 131, 93, 0.1);
}

@media (max-width: 768px) {
    .search-bar-container {
        max-width: 100%;
    }
}

/* ========================================= */
/* --- رسائل المعرض + عرض الصورة (Lightbox) --- */
/* ========================================= */
.gallery-message {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 600;
    padding: 60px 20px;
}
.gallery-message i { color: var(--accent); margin-left: 8px; }

.lightbox {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(10, 10, 14, 0.93);
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 20px;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lb-figure { max-width: min(1000px, 86vw); max-height: 100%; display: flex; flex-direction: column; align-items: center; margin: 0; }
.lb-img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); background: #111; }
.lb-caption { text-align: center; color: #fff; padding-top: 18px; max-width: 700px; max-height: 24vh; overflow-y: auto; }
.lb-cat { color: var(--accent); font-weight: 700; font-size: 0.95rem; }
.lb-title { font-size: 1.6rem; font-weight: 800; margin: 4px 0 8px; }
.lb-desc { color: #d8d8d8; line-height: 1.8; white-space: pre-line; }

.lb-close, .lb-nav {
    border: none; cursor: pointer; color: #fff; background: rgba(255,255,255,0.12);
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.lb-close:hover, .lb-nav:hover { background: var(--accent); }
.lb-close { position: absolute; top: 18px; left: 18px; z-index: 2; }

@media (max-width: 768px) {
    .lightbox { padding: 12px; gap: 6px; }
    .lb-nav { width: 38px; height: 38px; font-size: 1rem; }
    .lb-title { font-size: 1.25rem; }
    .lb-img { max-height: 60vh; }
}