/* =========================================
   1. Variables & Reset & Global
   ========================================= */
:root {
    
    --primary-bg: #0f172a;     
    --secondary-bg: #1e293b;     
    
  
    --accent-color: #8b5cf6;     
    --accent-glow: #7c3aed;      
    
    --text-main: #f1f5f9;     
    --text-muted: #94a3b8;       
    
    --nav-bg: rgba(15, 23, 42, 0.85); 
    --card-border: rgba(139, 92, 246, 0.15); 
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body.light-mode {
    
    --primary-bg: #ffffff;
    --secondary-bg: #f8fafc;
    
    --accent-color: #7c3aed;
    --accent-glow: #6d28d9;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    
    --nav-bg: rgba(255, 255, 255, 0.90);
    --card-border: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body { 
    background-color: var(--primary-bg); 
    color: var(--text-main); 
    overflow-x: hidden; 
    transition: background-color 0.3s ease, color 0.3s ease; 
}


::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--primary-bg); }
::-webkit-scrollbar-thumb { background: var(--secondary-bg); border-radius: 5px; border: 1px solid var(--card-border); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 100px 0; }
.hidden-element { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.show-element { opacity: 1; transform: translateY(0); }

/* =========================================
   2. Navbar
   ========================================= */
.navbar { 
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%); 
    width: 90%; max-width: 1000px; padding: 15px 30px; z-index: 1000; 
    transition: 0.4s; 
    background: var(--nav-bg); 
    backdrop-filter: blur(12px); 
    border: 1px solid var(--card-border); 
    border-radius: 50px; 
    box-shadow: 0 10px 30px var(--shadow-color); 
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { font-size: 1.5rem; font-weight: bold; color: var(--text-main); text-decoration: none; letter-spacing: 1px; }
.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: 0.3s; position: relative; }

.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 0;
    background-color: var(--accent-color); transition: 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent-color); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.theme-btn { background: transparent; border: none; color: var(--text-main); cursor: pointer; transition: 0.3s; }
.theme-btn:hover { color: var(--accent-color); transform: rotate(15deg); }

/* مناسب لي الجوال */
.menu-toggle { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 2px; margin: 6px auto; background-color: var(--text-main); transition: 0.3s; }
.mobile-nav { 
    position: absolute; top: 120%; left: 0; width: 100%; 
    background: var(--nav-bg); border-radius: 20px; 
    border: 1px solid var(--card-border); 
    overflow: hidden; max-height: 0; transition: 0.4s; 
    display: flex; flex-direction: column; align-items: center; backdrop-filter: blur(15px);
}
.mobile-link { padding: 15px; width: 100%; text-align: center; color: var(--text-main); text-decoration: none; border-bottom: 1px solid var(--card-border); }
.mobile-nav.active { max-height: 350px; }

/* =========================================
   3. Hero Section & Canvas
   ========================================= */
.hero-section { 
    position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; 
    padding-top: 80px; overflow: hidden; 
    background: var(--primary-bg); 
}

#floating-lines-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
}

.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }

.hero-title { 
    font-size: 4rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; 
    background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-color) 100%); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}
.hero-title span { color: var(--accent-color); }

.hero-subtitle { font-size: 1.8rem; color: var(--text-main); margin-bottom: 1.5rem; font-weight: 600; }
.hero-description { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2.5rem; line-height: 1.7; max-width: 500px; }

.hero-buttons { display: flex; gap: 20px; }

.cta-button { 
    display: inline-flex; align-items: center; padding: 14px 35px; 
    background: linear-gradient(45deg, var(--accent-color), var(--accent-glow)); 
    color: white; text-decoration: none; border-radius: 50px; font-weight: bold; 
    transition: 0.3s; border: none; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.cta-button:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6); }

.outline-btn { 
    background: transparent; border: 2px solid var(--accent-color); color: var(--text-main); box-shadow: none; 
}
.outline-btn:hover { background: rgba(139, 92, 246, 0.1); }

.hero-skills-content { display: flex; flex-direction: column; gap: 1.5rem; }
.skill-card { 
    display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; 
    background: rgba(255,255,255,0.03); backdrop-filter: blur(5px); 
    border: 1px solid var(--card-border); border-radius: 15px; transition: 0.4s; 
}
.skill-card:hover { transform: translateX(10px); border-color: var(--accent-color); background: rgba(255,255,255,0.05); }
.skill-icon svg { width: 40px; height: 40px; color: var(--accent-color); }
.skill-card span { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }

/* =========================================
   4. About Section
   ========================================= */
.section-title { text-align: center; font-size: 2.5rem; color: var(--accent-color); margin-bottom: 10px; font-weight: 800; }
.title-underline { width: 60px; height: 4px; background: var(--accent-color); margin: 0 auto 60px; border-radius: 2px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

.image-container { 
    border-radius: 20px; overflow: hidden; border: 2px solid var(--card-border); 
    position: relative; box-shadow: 0 20px 40px var(--shadow-color);
}
.profile-img { width: 100%; display: block; transition: 0.8s; }
.image-container:hover { border-color: var(--accent-color); }
.image-container:hover .profile-img { transform: scale(1.1); }

.highlight { color: var(--accent-color); font-weight: bold; }

.bio-subtitle { color: var(--text-main); font-size: 1.1rem; font-weight: 700; margin: 25px 0 10px; }
.bio-list { list-style: none; }
.bio-list li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--text-muted); }
.bio-list li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-color); font-weight: bold; }

.cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-top: 30px; }
.card { 
    display: flex; flex-direction: column; align-items: flex-start; padding: 20px; 
    background: var(--secondary-bg); border-radius: 15px; border: 1px solid var(--card-border); 
    transition: 0.4s; gap: 10px;
}
.card:hover { transform: translateY(-5px); border-color: var(--accent-color); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.icon-box { background: rgba(139, 92, 246, 0.1); padding: 10px; border-radius: 10px; color: var(--accent-color); }
.card h3 { font-size: 1rem; color: var(--text-main); }
.card p { font-size: 0.85rem; color: var(--text-muted); }

/* =========================================
   5. Skills Marquee
   ========================================= */
.skills-section { background: var(--primary-bg); padding: 50px 0; overflow: hidden; }
.skills-marquee { position: relative; width: 100%; mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); }
.skills-track { display: flex; gap: 2rem; width: max-content; animation: scroll 35s linear infinite; padding: 20px 0; }
.skills-track:hover { animation-play-state: paused; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-50% - 1rem)); } }

.skill-card-mini { 
    background: var(--secondary-bg); border: 1px solid var(--card-border); 
    border-radius: 12px; padding: 1rem 1.5rem; min-width: 220px; 
    display: flex; align-items: center; gap: 1rem; transition: 0.3s; 
}
.skill-card-mini:hover { border-color: var(--accent-color); transform: translateY(-5px); box-shadow: 0 5px 15px rgba(139, 92, 246, 0.1); }
.skill-info h4 { color: var(--text-main); font-size: 0.95rem; margin-bottom: 5px; }
.skill-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.skill-bar .fill { height: 100%; background: var(--accent-color); }

/* =========================================
   6. Projects (Timeline)
   ========================================= */
.timeline-item { display: flex; gap: 2rem; margin-bottom: 4rem; }
.timeline-marker { display: flex; flex-direction: column; align-items: center; min-width: 50px; }
.timeline-dot { width: 40px; height: 40px; background: var(--secondary-bg); border: 2px solid var(--accent-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2; }
.timeline-dot svg { width: 20px; height: 20px; color: var(--accent-color); }
.timeline-line { width: 2px; flex-grow: 1; background: var(--card-border); margin: 10px 0 -40px; }

.timeline-card { 
    flex: 1; background: var(--secondary-bg); padding: 2rem; 
    border-radius: 20px; border: 1px solid var(--card-border); transition: 0.3s; 
    position: relative; overflow: hidden;
}
.timeline-card:hover { transform: translateY(-5px); border-color: var(--accent-color); }


.timeline-img {
    width: 100%;
    height: 300px; 
    overflow: hidden;
    border-radius: 12px; 
    border: 1px solid var(--card-border); 
    background-color: #000; 
}

.timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center; 
    transition: transform 0.5s ease; 
}


.timeline-card:hover .timeline-img img {
    transform: scale(1.05);
}
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.card-header h3 { font-size: 1.4rem; color: var(--text-main); }
.company-name { color: var(--accent-color); font-weight: 600; font-size: 0.9rem; }
.date-badge { background: rgba(139, 92, 246, 0.1); color: var(--accent-color); padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; }
.card-description { color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.achievements-list { background: var(--primary-bg); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--card-border); }
.achievements-list p { font-weight: bold; color: var(--text-main); margin-bottom: 10px; }
.achievements-list ul { list-style: none; padding-left: 0; }
.achievements-list li { color: var(--text-muted); margin-bottom: 5px; font-size: 0.9rem; }
.achievements-list li::before { content: '•'; color: var(--accent-color); font-weight: bold; margin-right: 8px; }

/* =========================================
   7. Project Modal
   ========================================= */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.modal-box { background: var(--secondary-bg); width: 90%; max-width: 800px; border-radius: 15px; border: 1px solid var(--accent-color); position: relative; overflow: hidden; animation: slideUp 0.4s ease; max-height: 90vh; overflow-y: auto; }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-project { position: absolute; top: 15px; right: 20px; color: white; background: rgba(0,0,0,0.6); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; font-size: 1.2rem; transition: 0.3s; }
.close-project:hover { background: var(--accent-color); }

.modal-img-wrapper {
    width: 100%;
    height: 400px; 
    position: relative;
    background-color: #0f172a; 
    border-radius: 10px 10px 0 0; 
    overflow: hidden; 
    display: flex; 
    align-items: center;
    justify-content: center;
}


.modal-img-wrapper img {
    
    width: auto;
    height: auto;
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    border-radius: 5px;
}
.modal-text-content { padding: 30px; }
.modal-text-content h3 { color: var(--text-main); font-size: 1.8rem; margin-bottom: 15px; }
.p-tech-stack { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.p-tech-stack span { background: rgba(139, 92, 246, 0.1); color: var(--accent-color); padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; }
.modal-text-content p { color: var(--text-muted); line-height: 1.8; white-space: pre-line; }

/* =========================================
   8. Certificates
   ========================================= */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }
.cert-card { 
    background: var(--secondary-bg); border: 1px solid var(--card-border); border-radius: 15px; overflow: hidden; transition: 0.3s; 
}
.cert-card:hover { transform: translateY(-5px); border-color: var(--accent-color); box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15); }
.cert-img { width: 100%; height: 160px; overflow: hidden; border-bottom: 1px solid var(--card-border); position: relative; }
.cert-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; cursor: zoom-in; }
.cert-card:hover .cert-img img { transform: scale(1.1); }
.cert-card .card-content { padding: 15px; }
.cert-card h4 { font-size: 1rem; color: var(--text-main); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.cert-date { font-size: 0.75rem; color: var(--accent-color); background: rgba(139, 92, 246, 0.1); padding: 3px 10px; border-radius: 10px; font-weight: bold; }

/* Image Lightbox */
.modal-content { max-width: 90%; max-height: 90vh; object-fit: contain; animation: zoomIn 0.3s; border-radius: 5px; box-shadow: 0 0 30px rgba(0,0,0,0.8); }
.close-modal { position: absolute; top: 20px; right: 40px; color: white; font-size: 40px; cursor: pointer; z-index: 10001; transition: 0.3s; }
.close-modal:hover { color: var(--accent-color); transform: rotate(90deg); }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =========================================
   9. Contact Section
   ========================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { color: var(--text-main); font-weight: 600; margin-left: 5px; }
.form-group input, .form-group textarea { 
    width: 100%; padding: 15px; background: var(--secondary-bg); 
    border: 1px solid var(--card-border); border-radius: 10px; 
    color: var(--text-main); outline: none; transition: 0.3s; font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }
.submit-btn { 
    padding: 15px; background: var(--accent-color); color: white; border: none; 
    border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.3s; font-size: 1rem;
}
.submit-btn:hover { background: var(--accent-glow); transform: translateY(-2px); }

.info-card h3 { font-size: 1.8rem; color: var(--accent-color); margin-bottom: 15px; }
.info-card p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 25px; line-height: 1.6; }
.info-img { width: 100%; border-radius: 20px; box-shadow: 0 15px 40px var(--shadow-color); border: 1px solid var(--card-border); transition: 0.4s; }
.info-img:hover { transform: scale(1.02); }

.social-links { display: flex; flex-direction: column; gap: 1rem; }
.social-item { 
    display: flex; align-items: center; padding: 15px 20px; 
    background: var(--secondary-bg); border: 1px solid var(--card-border); 
    border-radius: 15px; text-decoration: none; transition: 0.3s; 
}
.social-item:hover { transform: translateX(10px); border-color: var(--accent-color); background: rgba(139, 92, 246, 0.05); }
.social-icon { width: 45px; height: 45px; min-width: 45px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 15px; }
.social-icon svg { width: 24px; height: 24px; color: white; }
.bg-red { background: #ef4444; } .bg-blue { background: #0077b5; } .bg-green { background: #25D366; }
.social-text span { color: var(--text-main); font-weight: 700; display: block; }
.social-text small { color: var(--text-muted); font-size: 0.9rem; }

/* =========================================
   10. Footer
   ========================================= */
.main-footer { background: var(--secondary-bg); padding: 4rem 0 2rem; margin-top: auto; border-top: 1px solid var(--card-border); text-align: center; }
.footer-message { font-size: 1.5rem; color: var(--text-main); margin-bottom: 3rem; font-weight: 700; }
.footer-bottom-row { display: flex; justify-content: space-between; border-top: 1px solid var(--card-border); padding-top: 2rem; flex-wrap: wrap; gap: 15px; }
.copyright, .made-with { color: var(--text-muted); font-size: 0.9rem; }
.heart-icon { fill: #ef4444; vertical-align: middle; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* =========================================
   11. Responsive Design
   ========================================= */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-buttons { justify-content: center; }
    .hero-description { margin: 0 auto 2.5rem; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .timeline-marker { display: none; } 
    .timeline-item { gap: 0; }
    .timeline-img { height: 200px; }
}

@media (max-width: 768px) {
    .navbar { width: 95%; top: 10px; padding: 10px 20px; }
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .hero-title { font-size: 2.8rem; }
    .section-title { font-size: 2rem; }
    .footer-bottom-row { flex-direction: column; gap: 10px; }
    .modal-box { margin: 10% auto; width: 95%; }
}
/* تنسيق أزرار التقليب */
.modal-img-wrapper {
    position: relative;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 50%;
    transition: 0.3s;
    z-index: 10;
    user-select: none;
}

.slider-btn:hover {
    background-color: var(--accent-color);
}

.prev { left: 10px; }
.next { right: 10px; }

.modal-img-wrapper {
    position: relative; 
    background-color: #000; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6); 
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: 0.3s;
    display: flex; 
    align-items: center;
    justify-content: center;
    user-select: none;
}

.slider-btn:hover {
    background-color: var(--accent-color); 
    transform: translateY(-50%) scale(1.1);
}

.prev { left: 15px; }
.next { right: 15px; }


.slider-btn.hidden {
    display: none !important;
}
