/* =========================================
   1. Premium Colors & Variables (Dark Matter)
   ========================================= */
:root {
    --bg-color: #07040f; 
    --second-bg-color: #120b1f; 
    --text-color: #e2e8f0;
    --heading-color: #ffffff; 
    --text-muted: #94a3b8; 
    --main-color: #a855f7; 
    --main-gradient: linear-gradient(135deg, #a855f7, #6366f1); 
    --bg-gradient: radial-gradient(circle at top left, #120b1f, #07040f); 
    --card-border: rgba(168, 85, 247, 0.15); 
    --glow-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
    --nav-bg: rgba(7, 4, 15, 0.75); 
    --modal-overlay: rgba(7, 4, 15, 0.85);
    
    --font-en: 'Poppins', sans-serif;
    --font-ar: 'Cairo', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --second-bg-color: #ffffff;
    --text-color: #334155;
    --heading-color: #0f172a; 
    --text-muted: #64748b;
    --main-color: #8b5cf6;
    --main-gradient: linear-gradient(135deg, #8b5cf6, #3b82f6);
    --bg-gradient: radial-gradient(circle at top left, #ffffff, #f1f5f9); 
    --card-border: rgba(139, 92, 246, 0.2);
    --glow-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
    --nav-bg: rgba(255, 255, 255, 0.85); 
    --modal-overlay: rgba(255, 255, 255, 0.85);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    text-decoration: none; border: none; outline: none; scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient); 
    color: var(--text-color);
    font-family: var(--font-en);
    transition: background-color 0.4s, color 0.4s, background-image 0.4s;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--main-gradient); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--main-color); }
::selection { background: var(--main-color); color: #fff; }

body[lang="en"] .lang-ar { display: none !important; }
body[lang="ar"] .lang-en { display: none !important; }
body[lang="ar"] { font-family: var(--font-ar); direction: rtl; }

/* =========================================
   Navbar & Globals
   ========================================= */
.navbar {
    position: fixed; width: 100%; top: 0; display: flex;
    justify-content: space-between; align-items: center;
    padding: 20px 8%; background-color: var(--nav-bg); 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--card-border); 
    z-index: 1000; transition: background-color 0.4s;
}
.logo { font-size: 25px; font-weight: 700; color: var(--heading-color); }
.logo span { background: var(--main-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; list-style: none; }
.nav-links li a { 
    color: var(--text-color); margin: 0 15px; font-weight: 600; 
    transition: color 0.3s, transform 0.3s; position: relative;
}
.nav-links li a::after {
    content: ''; position: absolute; left: 0; bottom: -5px;
    width: 0%; height: 2px; background: var(--main-gradient); transition: 0.3s ease;
}
.nav-links li a:hover { color: var(--main-color); transform: translateY(-2px); }
.nav-links li a:hover::after { width: 100%; }

.nav-controls { display: flex; gap: 15px; align-items: center; }
.nav-controls button {
    background: transparent; color: var(--text-color); font-size: 16px; cursor: pointer; font-family: inherit;
    font-weight: 600; border: 1px solid var(--card-border); padding: 5px 12px; border-radius: 8px; transition: 0.3s;
}
.nav-controls button:hover { border-color: var(--main-color); box-shadow: var(--glow-shadow); color: var(--main-color); }
.menu-btn { display: none; font-size: 24px; cursor: pointer; color: var(--text-color); }

section { padding: 120px 8% 60px; position: relative; z-index: 1;}
.heading { text-align: center; font-size: 45px; margin-bottom: 60px; font-weight: 700; color: var(--heading-color);}
.heading span { background: var(--main-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* =========================================
   Home Section
   ========================================= */
.home { 
    display: flex; align-items: center; justify-content: space-between; 
    height: 100vh; padding: 120px 8% 60px; gap: 50px;
}
.home-text { flex: 1; }
.home-img { flex: 1; display: flex; justify-content: center; align-items: center; }

.home-text h3 { color: var(--heading-color); font-size: 28px; font-weight: 600;}
.home-text h1 { font-size: 55px; margin: 10px 0; font-weight: 700; letter-spacing: 1px; color: var(--heading-color);}
.home-text p { font-size: 18px; margin-bottom: 25px; color: var(--text-muted); line-height: 1.6; max-width: 600px;}
body[lang="ar"] .home-text p { max-width: 100%; }

.social-links a {
    display: inline-flex; justify-content: center; align-items: center;
    width: 45px; height: 45px; border: 1px solid var(--card-border); background: var(--second-bg-color);
    border-radius: 50%; font-size: 20px; color: var(--main-color); margin-right: 15px; margin-bottom: 25px; transition: all 0.4s ease;
}
body[lang="ar"] .social-links a { margin-right: 0; margin-left: 15px; }
.social-links a:hover { 
    background: var(--main-gradient); color: #fff; transform: translateY(-5px) rotate(360deg);
    box-shadow: var(--glow-shadow); border-color: transparent;
}

.btn {
    padding: 12px 35px; background: var(--main-gradient); color: #fff; border-radius: 30px; 
    font-weight: 600; display: inline-block; transition: all 0.4s ease; box-shadow: var(--glow-shadow); cursor: pointer;
}
.btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 35px rgba(168, 85, 247, 0.6); color: #fff; }

.img-box {
    position: relative; width: 380px; height: 380px; border-radius: 50%; padding: 8px;
    background: var(--main-gradient); box-shadow: var(--glow-shadow); display: flex;
    justify-content: center; align-items: center; animation: floatImage 4s ease-in-out infinite;
}
.img-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 6px solid var(--bg-color); }

@keyframes floatImage {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

/* =========================================
   About Section
   ========================================= */
.about-container { max-width: 1100px; margin: 0 auto; }
.about-headline { text-align: center; margin-bottom: 50px; padding: 0 20px; }
.about-headline h3 {
    font-size: 26px; line-height: 1.6; font-weight: 600; font-style: italic;
    background: var(--main-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.about-bio { display: flex; gap: 30px; margin-bottom: 50px; }
.bio-block {
    flex: 1; background: var(--second-bg-color); padding: 35px; border-radius: 20px;
    border: 1px solid var(--card-border); transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.bio-block:hover { transform: translateY(-5px); box-shadow: var(--glow-shadow); border-color: var(--main-color); }
.bio-block h4 { font-size: 22px; color: var(--heading-color); margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.bio-block h4 i { color: var(--main-color); font-size: 24px; }
.bio-block p { font-size: 16px; line-height: 1.8; color: var(--text-muted); }
span.highlight { color: var(--main-color); font-weight: 600; }

.about-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; }
.metric-card {
    background: var(--bg-color); border: 1px solid var(--card-border); border-radius: 20px;
    padding: 30px 20px; text-align: center; transition: all 0.4s ease;
}
.metric-card:hover {
    background: var(--second-bg-color); border-color: var(--main-color);
    transform: translateY(-10px); box-shadow: var(--glow-shadow);
}
.metric-card i { font-size: 35px; color: var(--main-color); margin-bottom: 15px; }
.metric-card h3 { font-size: 32px; font-weight: 700; color: var(--heading-color); margin-bottom: 5px; }
.metric-card p { font-size: 15px; color: var(--text-muted); font-weight: 500; }

/* =========================================
   Services Section
   ========================================= */
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; max-width: 1100px; margin: 0 auto;
}
.service-card {
    background: var(--second-bg-color); border: 1px solid var(--card-border); border-radius: 20px;
    padding: 40px 25px; text-align: center; transition: all 0.4s ease;
}
.service-card:hover {
    transform: translateY(-10px); box-shadow: var(--glow-shadow); border-color: var(--main-color);
}
.service-card i { font-size: 40px; color: var(--main-color); margin-bottom: 20px; }
.service-card h3 { color: var(--heading-color); font-size: 20px; margin-bottom: 15px; }
.service-card p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.clickable-service { cursor: pointer; }
.clickable-service p { color: var(--main-color); font-weight: 600; font-size: 14px; margin-top: 15px; }

/* =========================================
   Skills Section
   ========================================= */
.skills-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; max-width: 1100px; margin: 0 auto;
}
.skill-card {
    position: relative; display: flex; align-items: center; gap: 20px; padding: 25px;
    background: var(--second-bg-color); border: 1px solid var(--card-border);
    border-radius: 20px; transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}
.skill-card::before {
    content: ""; position: absolute; width: 90px; height: 90px; top: -45px; right: -45px;
    background: rgba(168, 85, 247, 0.12); filter: blur(25px); border-radius: 50%; transition: 0.4s ease;
}
.skill-card:hover { transform: translateY(-5px); border-color: var(--main-color); box-shadow: var(--glow-shadow); }
.skill-card:hover::before { transform: scale(1.5); background: rgba(168, 85, 247, 0.25); }

.skill-icon {
    flex-shrink: 0; width: 65px; height: 65px; display: flex; align-items: center; justify-content: center;
    border-radius: 15px; background: rgba(168, 85, 247, 0.1); border: 1px solid var(--card-border);
    color: var(--main-color); font-size: 30px; transition: 0.3s ease;
}
.skill-card:hover .skill-icon { background: var(--main-gradient); color: #fff; transform: scale(1.05); }

.skill-info { position: relative; z-index: 1; }
.skill-info h4 { margin: 0 0 5px; font-size: 22px; font-weight: 700; color: var(--heading-color); }
.skill-info p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); }

body[lang="ar"] .skill-card { text-align: right; }
body[lang="ar"] .skill-card::before { left: -45px; right: auto; }

/* =========================================
   Projects Grid
   ========================================= */
.filter-buttons { text-align: center; margin-bottom: 40px; }
.filter-btn {
    padding: 10px 25px; margin: 5px; border-radius: 30px; background: var(--second-bg-color); color: var(--text-color);
    cursor: pointer; transition: all 0.3s; font-weight: 600; border: 1px solid var(--card-border);
}
.filter-btn.active, .filter-btn:hover { background: var(--main-gradient); color: #fff; border-color: transparent; box-shadow: var(--glow-shadow); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; max-width: 1100px; margin: auto;}
.project-card {
    background: var(--second-bg-color); border-radius: 20px; overflow: hidden;
    border: 1px solid var(--card-border); transition: all 0.4s ease; display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-10px); box-shadow: var(--glow-shadow); border-color: var(--main-color); }

.card-img { position: relative; width: 100%; height: 230px; overflow: hidden; background: var(--bg-color); border-bottom: 1px solid var(--card-border); }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.project-card:hover .card-img img { transform: scale(1.1); }

.open-dashboard-btn, .github-link-btn {
    position: absolute; bottom: 15px; right: 15px; background: var(--main-gradient); color: #fff; border: none;
    padding: 10px 20px; border-radius: 30px; cursor: pointer; font-weight: 600; font-size: 14px; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 8px; z-index: 2;
}
body[lang="ar"] .open-dashboard-btn, body[lang="ar"] .github-link-btn { right: auto; left: 15px; flex-direction: row-reverse; }
.open-dashboard-btn:hover, .github-link-btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: var(--glow-shadow); }

.project-info { padding: 25px; flex-grow: 1; }
.project-info h3 { color: var(--heading-color); margin-bottom: 12px; font-size: 22px;} 
.project-info p { color: var(--text-muted); line-height: 1.6;} 
.tag {
    display: inline-block; padding: 5px 12px; background: rgba(168, 85, 247, 0.1); border-radius: 20px; font-size: 12px; margin-top: 15px; margin-right: 8px; color: var(--main-color); border: 1px solid var(--card-border); font-weight: 600;
}
body[lang="ar"] .tag { margin-right: 0; margin-left: 8px; }

/* =========================================
   Certificates Section Styles
   ========================================= */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.cert-card {
    background: var(--second-bg-color);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cert-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--glow-shadow);
    border-color: var(--main-color);
}

.cert-img {
    width: 100%;
    height: 180px;
    background: var(--bg-color);
    overflow: hidden;
    border-bottom: 1px solid var(--card-border);
}

.cert-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cert-card:hover .cert-img img {
    transform: scale(1.08);
}

.cert-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cert-issuer {
    font-size: 13px;
    font-weight: 600;
    color: var(--main-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.cert-info h3 {
    color: var(--heading-color);
    font-size: 19px;
    margin-bottom: 12px;
    font-weight: 700;
}

.cert-info p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.cert-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(168, 85, 247, 0.1);
    color: var(--main-color);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: fit-content;
}

.cert-btn:hover {
    background: var(--main-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--glow-shadow);
    transform: translateY(-2px);
}

body[lang="ar"] .cert-card { text-align: right; }

/* =========================================
   Timeline (Experience)
   ========================================= */
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::after {
    content: ''; position: absolute; width: 3px; background: var(--main-gradient);
    top: 0; bottom: 0; left: 50%; margin-left: -1.5px; border-radius: 5px;
}
body[lang="ar"] .timeline::after { right: 50%; left: auto; margin-right: -1.5px; margin-left: 0; }

.timeline-item { padding: 20px 40px; position: relative; width: 50%; box-sizing: border-box; }
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }
body[lang="ar"] .timeline-item:nth-child(odd) { right: 0; left: auto; }
body[lang="ar"] .timeline-item:nth-child(even) { right: 50%; left: auto; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(168, 85, 247, 0); }
    100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}
.timeline-dot {
    position: absolute; width: 20px; height: 20px; background: var(--main-color); border-radius: 50%; top: 25px; right: -9px; z-index: 1;
    border: 4px solid var(--second-bg-color); animation: pulse 2s infinite;
}
body[lang="en"] .timeline-item:nth-child(even) .timeline-dot { left: -10px; }
body[lang="ar"] .timeline-dot { left: -9px; right: auto; }
body[lang="ar"] .timeline-item:nth-child(even) .timeline-dot { right: -10px; left: auto; }

.timeline-content { 
    background: var(--second-bg-color); padding: 25px; border-radius: 15px; border: 1px solid var(--card-border); transition: 0.3s;
}
.timeline-content:hover { border-color: var(--main-color); transform: translateY(-5px); box-shadow: var(--glow-shadow);}
.timeline-content h3 { color: var(--heading-color); margin-bottom: 5px;}
.timeline-content span { font-size: 14px; color: var(--main-color); display: block; margin-bottom: 15px; font-weight: 600;}

.timeline-list { margin-top: 15px; padding-left: 20px; list-style-type: none; }
body[lang="ar"] .timeline-list { padding-left: 0; padding-right: 20px; }
.timeline-list li { color: var(--text-muted); margin-bottom: 10px; font-size: 14px; line-height: 1.6; position: relative; }
.timeline-list li::before { content: '▹'; position: absolute; left: -20px; color: var(--main-color); font-weight: bold; font-size: 18px; }
body[lang="ar"] .timeline-list li::before { left: auto; right: -20px; content: '◃'; }

/* =========================================
   Testimonials & Feedback Slider
   ========================================= */
.testimonials-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; max-width: 1100px; margin: 0 auto; margin-bottom: 60px;
}
.testi-card {
    background: var(--second-bg-color); border: 1px solid var(--card-border); border-radius: 20px;
    padding: 40px 30px; position: relative; transition: all 0.4s ease;
    /* التعديل الجديد لجعل الأسماء في الأسفل دائماً */
    display: flex;
    flex-direction: column;
}
.testi-card:hover { transform: translateY(-10px); box-shadow: var(--glow-shadow); border-color: var(--main-color); }
.testi-card .quote-icon { font-size: 30px; color: var(--main-color); opacity: 0.5; margin-bottom: 20px; }
body[lang="ar"] .testi-card .quote-icon { transform: scaleX(-1); }

.testi-card p { 
    font-style: italic; color: var(--heading-color); line-height: 1.8; margin-bottom: 25px; font-size: 15px; 
    /* هذا السطر يدفع منطقة الاسم للأسفل مهما كان طول النص */
    flex-grow: 1; 
}
.testi-author h4 { color: var(--main-color); font-size: 18px; margin-bottom: 5px; }
.testi-author span { color: var(--text-muted); font-size: 14px; }

/* تصميم معرض صور التقييمات (Feedback Slider) */
.feedback-gallery {
    max-width: 800px; margin: 0 auto; text-align: center;
}
.feedback-gallery h3 {
    color: var(--heading-color); font-size: 24px; margin-bottom: 30px;
}
.feedback-slider-container {
    position: relative; width: 100%; height: 450px; 
    background: var(--second-bg-color); border: 1px solid var(--card-border);
    border-radius: 20px; box-shadow: var(--glow-shadow); overflow: hidden;
}
.f-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; padding: 15px; opacity: 0; transition: opacity 0.5s ease-in-out; z-index: 1;
}
.f-slide.active { opacity: 1; z-index: 2; }

.f-slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: var(--main-gradient); color: #fff; border: none;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    font-size: 18px; z-index: 10; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: 0.3s;
}
.f-slider-btn:hover { transform: translateY(-50%) scale(1.1); }
.f-prev { left: 15px; }
.f-next { right: 15px; }

.f-dots {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 10;
}
.f-dot {
    width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.3);
    cursor: pointer; transition: 0.3s; border: 1px solid var(--card-border);
}
.f-dot.active, .f-dot:hover { background: var(--main-color); transform: scale(1.2); }

@media (max-width: 768px) {
    .feedback-slider-container { height: 300px; }
}

/* =========================================
   Community & Video Feed
   ========================================= */
.community-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 1100px; margin: 0 auto; align-items: center;
}
.brand-box {
    background: var(--second-bg-color); padding: 50px; border-radius: 20px; border: 1px solid var(--card-border); box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: left;
}
body[lang="ar"] .brand-box { text-align: right; }
.brand-box h3 { background: var(--main-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 20px; font-size: 28px; font-weight: 700; }
.brand-box p { color: var(--text-muted); line-height: 1.8; }

.video-grid { display: flex; flex-direction: column; gap: 20px; }
.video-wrapper {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 15px; border: 1px solid var(--card-border); box-shadow: var(--glow-shadow);
}
.video-link { display: block; width: 100%; height: 100%; position: absolute; top: 0; left: 0; text-decoration: none; }
.video-thumbnail { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.play-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 70px; color: #ff0000;
    background-color: #fff; border-radius: 20px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); z-index: 2; transition: all 0.3s ease; line-height: 1;
}
.video-link:hover .video-thumbnail { transform: scale(1.08); }
.video-link:hover .play-icon { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 8px 30px rgba(255, 0, 0, 0.4); }

/* =========================================
   Contact & Form & Floating Socials
   ========================================= */
.floating-socials {
    position: fixed; top: 50%; left: 15px; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 15px; z-index: 9999;
}
body[lang="ar"] .floating-socials { left: auto; right: 15px; }

.social-icon {
    width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    color: #fff; font-size: 20px; text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: all 0.3s ease;
    animation: floatIcon 3s ease-in-out infinite;
}
.social-icon:nth-child(1) { animation-delay: 0s; background-color: #0077b5; }
.social-icon:nth-child(2) { animation-delay: 0.5s; background-color: #333; }
.social-icon:nth-child(3) { animation-delay: 1s; background-color: #25d366; }
.social-icon:nth-child(4) { animation-delay: 1.5s; background-color: #ff0000; }

.social-icon:hover { transform: scale(1.2) translateX(5px); }
body[lang="ar"] .social-icon:hover { transform: scale(1.2) translateX(-5px); }

@keyframes floatIcon {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.contact-container {
    display: flex; flex-wrap: wrap; gap: 40px; max-width: 1000px; margin: 0 auto; background: var(--second-bg-color); border: 1px solid var(--card-border); border-radius: 20px; padding: 50px; box-shadow: var(--glow-shadow);
}
.contact-info-panel { flex: 1; min-width: 300px; }
.contact-info-panel h3 { font-size: 30px; color: var(--heading-color); margin-bottom: 20px; }
.contact-info-panel p { color: var(--text-muted); line-height: 1.8; margin-bottom: 30px; }
.contact-info-panel ul { list-style: none; }
.contact-info-panel li { margin-bottom: 20px; color: var(--text-color); font-size: 16px; display: flex; align-items: center; gap: 15px; }
.contact-info-panel li i { color: var(--main-color); font-size: 20px; }

.contact-form { flex: 1.5; min-width: 300px; display: flex; flex-direction: column; gap: 20px; }
.input-field {
    width: 100%; padding: 15px; background: var(--bg-color); border: 1px solid var(--card-border); border-radius: 10px; color: var(--text-color); font-family: inherit; font-size: 15px; transition: 0.3s; resize: none;
}
.input-field:focus { border-color: var(--main-color); box-shadow: 0 0 10px rgba(168,85,247,0.2); }
.contact-form .btn { width: 100%; text-align: center; }

/* Star Rating Styles */
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;
}

footer { text-align: center; padding: 25px; background: var(--second-bg-color); border-top: 1px solid var(--card-border); position: relative; z-index: 1;}

/* =========================================
   Modals & Quotes Widget
   ========================================= */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: var(--modal-overlay); backdrop-filter: blur(10px);
}
.modal-content {
    position: relative; margin: 2% auto; width: 95%; max-width: 1400px; height: 92vh; background-color: var(--second-bg-color); border-radius: 20px; box-shadow: var(--glow-shadow); animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 1px solid var(--card-border); padding: 20px;
}
.close-btn {
    position: absolute; top: -15px; right: -15px; background: var(--main-gradient); color: #fff; width: 40px; height: 40px; border-radius: 50%; text-align: center; line-height: 40px; font-size: 20px; cursor: pointer; z-index: 2001; box-shadow: 0 4px 15px rgba(0,0,0,0.3); border: 2px solid var(--bg-color); transition: 0.3s;
}
body[lang="ar"] .close-btn { right: auto; left: -15px; }
.close-btn:hover { transform: scale(1.1) rotate(90deg); }

.modal-layout { display: flex; gap: 25px; height: 100%; }
.modal-iframe-container { flex: 2.5; border-radius: 15px; overflow: hidden; border: 1px solid var(--card-border); }
.modal-iframe-container iframe { width: 100%; height: 100%; border: none; }

.modal-info-container {
    flex: 1; background: var(--bg-color); border-radius: 15px; padding: 25px; border: 1px solid var(--card-border); overflow-y: auto;
}
.modal-info-container h3 { color: var(--main-color); font-size: 22px; margin-bottom: 25px; border-bottom: 1px solid var(--card-border); padding-bottom: 15px; }
.case-study-block { margin-bottom: 25px; }
.case-study-block h4 { color: var(--heading-color); margin-bottom: 10px; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.case-study-block h4 i { color: var(--main-color); }
.case-study-block p { color: var(--text-muted); line-height: 1.7; font-size: 14.5px; }

@keyframes scaleIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.quote-widget-container {
    position: fixed; bottom: 30px; right: 30px; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end;
}
body[lang="ar"] .quote-widget-container { right: auto; left: 30px; align-items: flex-start; }

.toggle-quote-btn {
    background: var(--main-gradient); color: #fff; width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 20px; cursor: pointer; box-shadow: var(--glow-shadow); transition: all 0.3s ease; display: flex; justify-content: center; align-items: center; position: relative; z-index: 2;
}
.toggle-quote-btn:hover { transform: scale(1.1); }
.toggle-quote-btn.muted { background: var(--second-bg-color); color: var(--text-muted); border: 1px solid var(--card-border); }

.quote-popup {
    background: var(--second-bg-color); border: 1px solid var(--card-border); border-radius: 20px; padding: 25px 25px 20px; width: 350px; box-shadow: var(--glow-shadow); position: absolute; bottom: 70px; right: 0; opacity: 0; visibility: hidden; transform: translateX(120%) scale(0.9); transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
body[lang="ar"] .quote-popup { right: auto; left: 0; transform: translateX(-120%) scale(0.9); }
.quote-popup.show { opacity: 1; visibility: visible; transform: translateX(0) scale(1); }
body[lang="ar"] .quote-popup.show { transform: translateX(0) scale(1) !important; }



.close-quote-btn { position: absolute; top: 10px; right: 15px; background: transparent; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; transition: 0.3s; }
body[lang="ar"] .close-quote-btn { right: auto; left: 15px; }
.close-quote-btn:hover { color: var(--main-color); transform: rotate(90deg); }

.quote-icon-popup { font-size: 25px; color: var(--main-color); opacity: 0.4; margin-bottom: 10px; }
body[lang="ar"] .quote-icon-popup { transform: scaleX(-1); }
.popup-text { font-size: 15px; font-style: italic; color: var(--heading-color); line-height: 1.6; margin-bottom: 10px; }
.popup-author { color: var(--main-color); font-size: 14px; font-weight: 700; margin-bottom: 15px; }
.popup-example { padding-top: 15px; border-top: 1px solid var(--card-border); font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.popup-example strong { color: var(--heading-color); display: block; margin-bottom: 3px; font-size: 13.5px; }

#particles-js { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 0; pointer-events: none; }
nav { position: relative; z-index: 1000; }

@media (max-width: 991px) {
    .home { flex-direction: column-reverse; text-align: center; justify-content: center; gap: 30px; height: auto; margin-top: 50px;}
    .home-text p { margin: 15px auto; }
    .img-box { width: 300px; height: 300px; }
    .home-text h1 { font-size: 45px; }
    .community-layout { grid-template-columns: 1fr; }
    .modal-layout { flex-direction: column; }
    .modal-iframe-container { flex: 1; height: 400px; }
}
@media (max-width: 768px) {
    .about-bio { flex-direction: column; }
    .about-headline h3 { font-size: 20px; }
    .menu-btn { display: block; }
    .nav-links {
        position: absolute; top: 100%; left: -100%; width: 100%; background: var(--nav-bg); backdrop-filter: blur(15px);
        flex-direction: column; text-align: center; transition: 0.4s ease; border-bottom: 1px solid var(--card-border); padding: 20px 0;
    }
    .nav-links.active { left: 0; }
    body[lang="ar"] .nav-links { right: -100%; left: auto; }
    body[lang="ar"] .nav-links.active { right: 0; left: auto; }
    .nav-links li { margin: 15px 0; }
    .timeline::after { left: 20px; }
    body[lang="ar"] .timeline::after { right: 20px; left: auto; margin-right: 0;}
    .timeline-item { width: 100%; padding-left: 60px; padding-right: 0; left: 0 !important; }
    body[lang="ar"] .timeline-item { padding-right: 60px; padding-left: 0; right: 0 !important; }
    .timeline-dot { left: 10px !important; }
    body[lang="ar"] .timeline-dot { right: 10px !important; left: auto !important; }
    
    .skills-grid, .services-grid, .testimonials-grid, .certs-grid { grid-template-columns: 1fr; gap: 15px; }
    .contact-container { padding: 30px 20px; }
    
    /* زر العودة للأعلى */
    #back-to-top { bottom: 90px; left: 20px; }
    body[lang="ar"] #back-to-top { right: 20px; left: auto; }
    
    /* صندوق الاقتباسات (تم التعديل لإجباره على الظهور) */
    .quote-widget-container { 
        bottom: 90px !important; 
        right: 20px !important; 
        display: flex !important; 
        z-index: 99999 !important;
    }
    body[lang="ar"] .quote-widget-container { 
        left: 20px !important; 
        right: auto !important; 
    }
    .quote-popup { 
        width: 280px; 
        bottom: 60px; 
    }
    body[lang="ar"] .quote-popup { 
        left: 0; 
        right: auto; 
        transform: translateX(-110%) scale(0.9);
    }
    body[lang="ar"] .quote-popup.show {
        transform: translateX(0) scale(1);
    }

    /* السوشيال ميديا في الموبايل */
    .floating-socials { 
        display: flex; flex-direction: row; top: auto; 
        bottom: 20px; left: 50%; transform: translateX(-50%); 
    }
    body[lang="ar"] .floating-socials { 
        left: 50%; right: auto; transform: translateX(-50%); 
    }
    .social-icon:hover { transform: scale(1.2) translateY(-5px); }

    /* سلايدر التقييمات */
    .feedback-slider-container { height: 300px; }
}

/* =========================================
   Scroll Progress Bar
   ========================================= */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--main-gradient);
    z-index: 99999;
    transition: width 0.1s ease;
}

/* =========================================
   Back to Top Button
   ========================================= */
#back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px; /* في اليسار لتجنب التعارض مع الاقتباسات التي في اليمين */
    background: var(--main-gradient);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--glow-shadow);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}
body[lang="ar"] #back-to-top {
    left: auto;
    right: 30px;
}
#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
}

@media (max-width: 768px) {
    #back-to-top { bottom: 90px; left: 20px; }
    body[lang="ar"] #back-to-top { right: 20px; left: auto; }
}
/* =========================================
   Image Slider in Modal (Case Study)
   ========================================= */
.slider-container {
    position: relative; width: 100%; height: 100%; 
    background: var(--bg-color); display: flex; 
    align-items: center; justify-content: center; 
    overflow: hidden; border-radius: 15px;
}
.slider-img {
    max-width: 100%; max-height: 100%; 
    object-fit: contain; position: absolute; 
    opacity: 0; transition: opacity 0.4s ease; z-index: 1;
}
.slider-img.active {
    opacity: 1; position: relative; z-index: 2;
}
.slider-nav {
    position: absolute; top: 50%; transform: translateY(-50%); 
    background: var(--main-gradient); color: #fff; 
    width: 45px; height: 45px; border-radius: 50%; 
    border: none; cursor: pointer; z-index: 10; 
    font-size: 18px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    transition: 0.3s ease; display: flex; justify-content: center; align-items: center;
}
.slider-nav:hover { transform: translateY(-50%) scale(1.1); }
.slider-prev { left: 15px; }
.slider-next { right: 15px; }

/* =========================================
   النسخة النهائية والمحسنة لصندوق الاقتباسات (بدون إزاحة أو مشاكل في الشاشة)
   ========================================= */
/* إخفاء التمرير الأفقي بشكل قاطع من المتصفح لمنع تمدد الشاشة */
html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

.quote-widget-container {
    position: fixed !important; 
    bottom: 30px !important; 
    right: 30px !important; 
    z-index: 99999 !important; 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: flex-end !important;
}
body[lang="ar"] .quote-widget-container { 
    right: auto !important; 
    left: 30px !important; 
    align-items: flex-start !important; 
}

/* زرار اللمبة */
.toggle-quote-btn {
    background: var(--main-gradient) !important; 
    color: #fff !important; 
    width: 55px !important; 
    height: 55px !important; 
    border-radius: 50% !important; 
    border: none !important; 
    cursor: pointer !important; 
    box-shadow: var(--glow-shadow) !important; 
    transition: all 0.3s ease !important; 
    display: flex !important; 
    justify-content: center !important; 
    align-items: center !important; 
    position: relative !important; 
    z-index: 2 !important;
}
.toggle-quote-btn i { 
    color: #fff !important; 
    font-size: 22px !important; 
    display: block !important;
}
.toggle-quote-btn:hover { transform: scale(1.1) !important; }

.toggle-quote-btn.muted { 
    background: var(--second-bg-color) !important; 
    border: 2px solid var(--card-border) !important; 
}
.toggle-quote-btn.muted i { color: var(--text-muted) !important; }

/* صندوق الاقتباسات نفسه */
.quote-popup {
    background: var(--second-bg-color) !important; 
    border: 1px solid var(--card-border) !important; 
    border-radius: 20px !important; 
    padding: 25px !important; 
    width: 350px !important; 
    box-shadow: var(--glow-shadow) !important; 
    position: absolute !important; 
    bottom: 75px !important; 
    right: 0 !important; 
    opacity: 0 !important; 
    visibility: hidden !important; 
    /* التعديل الجذري: منعنا الإزاحة الأفقية واستخدمنا الزوم للداخل فقط لمنع تمدد الشاشة */
    transform: translateY(20px) scale(0.9) !important; 
    transition: all 0.4s ease !important;
    z-index: 1 !important;
}
body[lang="ar"] .quote-popup { 
    right: auto !important; 
    left: 0 !important; 
    /* التعديل الجذري للغة العربية */
    transform: translateY(20px) scale(0.9) !important; 
}

/* حركة الدخول للشاشة (الظهور) */
.quote-widget-container .quote-popup.show,
body[lang="ar"] .quote-widget-container .quote-popup.show { 
    opacity: 1 !important; 
    visibility: visible !important; 
    transform: translateY(0) scale(1) !important; 
}

/* زر إغلاق الصندوق X */
.close-quote-btn { 
    position: absolute !important; 
    top: 15px !important; 
    right: 15px !important; 
    background: transparent !important; 
    border: none !important; 
    color: var(--text-muted) !important; 
    font-size: 24px !important; 
    cursor: pointer !important; 
    transition: 0.3s !important; 
}
body[lang="ar"] .close-quote-btn { right: auto !important; left: 15px !important; }
.close-quote-btn:hover { color: var(--main-color) !important; }

/* النصوص والأيقونات الداخلية */
.quote-icon-popup { font-size: 25px !important; color: var(--main-color) !important; opacity: 0.5 !important; margin-bottom: 15px !important; display: block !important; }
body[lang="ar"] .quote-icon-popup { transform: scaleX(-1) !important; }

.popup-text { font-size: 15px !important; font-style: italic !important; color: var(--heading-color) !important; line-height: 1.6 !important; margin-bottom: 15px !important; }
.popup-author { color: var(--main-color) !important; font-size: 14px !important; font-weight: 700 !important; margin-bottom: 15px !important; }
.popup-example { padding-top: 15px !important; border-top: 1px solid var(--card-border) !important; font-size: 13.5px !important; color: var(--text-muted) !important; line-height: 1.6 !important; }
.popup-example strong { color: var(--heading-color) !important; display: block !important; margin-bottom: 5px !important; }

/* =========================================
   تعديلات الموبايل لضبط المقاس والمكان
   ========================================= */
@media (max-width: 768px) {
    .quote-widget-container { 
        bottom: 90px !important; 
        right: 20px !important; 
    }
    body[lang="ar"] .quote-widget-container { 
        left: 20px !important; 
        right: auto !important; 
    }
    .quote-popup { 
        width: 290px !important; 
        padding: 20px !important;
        bottom: 70px !important;
    }
}
