:root {
    --primary: #0056b3; 
    --secondary: #00d2ff; 
    --accent: #ffb703; 
    --bg-main: #f4f7f6; 
    --bg-white: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #1a202c;
    --text-muted: #4a5568;
    --border-color: #e2e8f0;
    --shadow: rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Mode Variables */
body.dark-mode {
    --primary: #58a6ff; 
    --secondary: #00ffcc;
    --bg-main: #0d1117; 
    --bg-white: #161b22;
    --card-bg: #21262d;
    --text-dark: #c9d1d9;
    --text-muted: #8b949e;
    --border-color: #30363d;
    --shadow: rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; width: 100%; }

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Floating Contact Plugin */
.floating-contact-plugin {
    position: fixed;
    bottom: 30px;
    right: 30px; 
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 10px 25px var(--shadow);
    transition: var(--transition);
    position: relative;
}

.float-btn::before {
    content: '';
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    z-index: -1;
    animation: ripple 2s infinite;
}

.call-btn { background: #0056b3; }
.call-btn::before { border: 2px solid #0056b3; }

.whatsapp-btn { background: #25d366; }
.whatsapp-btn::before { border: 2px solid #25d366; animation-delay: 1s; }

.float-btn:hover { transform: scale(1.1) translateY(-5px); }

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0; width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: var(--bg-white);
    padding: 15px 0;
    box-shadow: 0 5px 20px var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1010;
}
.logo span { color: var(--text-dark); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1010;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition: var(--transition);
}

.nav-links a:hover { color: var(--primary); }

.menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

/* Dark Mode Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}
.theme-switch input { display: none; }

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.slider.round { border-radius: 34px; }

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(26px); }

.icon-sun { color: #f39c12; font-size: 14px; z-index: 1;}
.icon-moon { color: #f1c40f; font-size: 14px; z-index: 1;}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
    background: var(--bg-white);
    overflow: hidden;
}

.cyber-grid {
    position: absolute;
    top: 0; right: 0; width: 100%; height: 100%;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.experience-badge {
    display: inline-block;
    background: var(--card-bg);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 800;
    margin-bottom: 25px;
    border: 1px solid var(--primary);
}

.title { font-size: 50px; font-weight: 900; line-height: 1.2; margin-bottom: 10px; }
.title span { color: var(--primary); }
.subtitle { font-size: 22px; color: var(--text-dark); font-weight: 700; margin-bottom: 20px; }
.desc { font-size: 18px; color: var(--text-muted); margin-bottom: 40px; line-height: 1.8; }

.hero-buttons { display: flex; gap: 20px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 30px; border-radius: 8px; font-weight: 800;
    text-decoration: none; transition: var(--transition); border: none; cursor: pointer; font-size: 16px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { transform: translateY(-5px); box-shadow: 0 10px 20px var(--shadow); }

.btn-secondary { background: var(--card-bg); color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary); color: white; }

/* Hero Image */
.hero-image-box { position: relative; display: flex; justify-content: center; width: 100%; }
.image-frame {
    width: 100%; max-width: 380px; height: 450px; border-radius: 20px; position: relative; overflow: hidden;
    background: var(--bg-main); border: 2px solid var(--border-color);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; }

.tech-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0,210,255,0.05), transparent); z-index: 2; pointer-events: none;
}
.scanner-line {
    width: 100%; height: 3px; background: var(--secondary);
    box-shadow: 0 0 15px var(--secondary), 0 0 30px var(--secondary);
    position: absolute; top: 0; animation: scan 4s linear infinite;
}
@keyframes scan { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.floating-stats { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.stat-box {
    position: absolute; background: var(--card-bg); padding: 10px 20px; border-radius: 10px;
    box-shadow: 0 10px 20px var(--shadow); display: flex; align-items: center; gap: 10px;
    font-weight: 800; color: var(--text-dark); border: 1px solid var(--border-color);
}
.stat-box i { color: var(--primary); font-size: 20px; }
.top-left { top: 50px; right: -30px; animation: float 3s ease-in-out infinite; }
.bottom-right { bottom: 50px; left: -30px; animation: float 3s ease-in-out infinite reverse; }

/* General Sections */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 60px; max-width: 800px; margin-left: auto; margin-right: auto; }
.section-header h2 { font-size: 35px; margin-bottom: 15px; color: var(--text-dark); }
.section-header h2 span { color: var(--primary); }
.section-header p { color: var(--text-muted); font-size: 18px; }

/* About Section */
.about { background: var(--bg-main); border-top: 1px solid var(--border-color); }
.about-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-text h2 { font-size: 35px; margin-bottom: 20px; }
.about-text h2 span { color: var(--primary); }
.about-text .lead { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 15px; }
.about-text p { color: var(--text-muted); margin-bottom: 15px; }

.stats-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px; }
.stat-item { background: var(--card-bg); padding: 20px; border-radius: 10px; border: 1px solid var(--border-color); text-align: center; flex: 1; min-width: 120px;}
.stat-item h3 { font-size: 30px; color: var(--primary); margin-bottom: 5px; }
.stat-item p { font-size: 14px; color: var(--text-muted); font-weight: 700;}

.about-visual { display: flex; justify-content: center; }
.experience-circle { width: 300px; height: 300px; position: relative; display: flex; justify-content: center; align-items: center; }
.experience-circle svg { width: 100%; height: 100%; animation: rotate 20s linear infinite; }
.circle-text { position: absolute; text-align: center; color: var(--text-dark); font-weight: 800; font-size: 20px; }
.circle-text i { font-size: 40px; color: var(--primary); display: block; margin-bottom: 10px; }
@keyframes rotate { 100% { transform: rotate(360deg); } }

/* Expertise Cards */
.expertise { background: var(--bg-white); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
.expert-card {
    background: var(--card-bg); border: 1px solid var(--border-color); padding: 40px 30px;
    border-radius: 15px; transition: var(--transition); position: relative; overflow: hidden;
}
.expert-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary); transform: scaleX(0); transform-origin: right; transition: transform 0.4s ease;
}
.expert-card:hover { box-shadow: 0 20px 40px var(--shadow); transform: translateY(-10px); }
.expert-card:hover::before { transform: scaleX(1); }

.icon-wrap {
    width: 60px; height: 60px; background: rgba(88, 166, 255, 0.1); color: var(--primary);
    display: flex; justify-content: center; align-items: center; font-size: 28px; border-radius: 12px; margin-bottom: 20px;
}
.expert-card h3 { font-size: 22px; margin-bottom: 15px; color: var(--text-dark); }
.expert-card p { color: var(--text-muted); }

/* Timeline (Projects) */
.projects { background: var(--bg-main); border-top: 1px solid var(--border-color); overflow-x: hidden; }
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::before { content: ''; position: absolute; top: 0; right: 50%; width: 2px; height: 100%; background: var(--border-color); transform: translateX(50%); }

.timeline-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 50px; position: relative; width: 100%;}
.timeline-item:nth-child(even) { flex-direction: row-reverse; }

.timeline-icon {
    width: 60px; height: 60px; background: var(--primary); color: white; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; font-size: 24px; position: absolute; right: 50%; transform: translateX(50%);
    box-shadow: 0 0 0 8px var(--bg-main); z-index: 2;
}

.timeline-content {
    width: 45%; background: var(--card-bg); padding: 30px; border-radius: 15px; border: 1px solid var(--border-color);
}
.timeline-item:nth-child(odd) .timeline-content { text-align: left; direction: ltr; }
.timeline-item:nth-child(odd) .timeline-content h3, 
.timeline-item:nth-child(odd) .timeline-content p,
.timeline-item:nth-child(odd) .timeline-content ul { direction: rtl; text-align: right; }

.timeline-content h3 { font-size: 20px; margin-bottom: 10px; color: var(--primary); }
.timeline-content p { color: var(--text-muted); margin-bottom: 15px; }
.timeline-content ul { color: var(--text-muted); padding-right: 20px; margin-right: 15px; }
.timeline-content ul li { margin-bottom: 10px; }

/* Brands */
.brands { background: var(--bg-white); border-top: 1px solid var(--border-color); }
.brands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.brand-item {
    background: var(--card-bg); border: 1px solid var(--border-color); padding: 30px 15px;
    border-radius: 10px; text-align: center; transition: var(--transition);
}
.brand-item:hover { border-color: var(--primary); box-shadow: 0 10px 20px var(--shadow); transform: translateY(-5px); }
.brand-item i { font-size: 40px; color: var(--text-muted); margin-bottom: 15px; transition: var(--transition); }
.brand-item:hover i { color: var(--primary); }
.brand-item h3 { font-size: 18px; color: var(--text-dark); margin-bottom: 5px; }
.brand-item span { font-size: 13px; color: var(--text-muted); }

/* Skills & Hobbies */
.skills-hobbies { background: var(--bg-main); border-top: 1px solid var(--border-color); }
.dual-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.side-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 40px; }
.panel-header { display: flex; align-items: center; gap: 15px; margin-bottom: 30px; }
.panel-header i { font-size: 30px; color: var(--primary); }
.panel-header h2 { font-size: 24px; color: var(--text-dark); }
.panel-header h2 span { color: var(--primary); }

.skills-list { list-style: none; }
.skills-list li {
    display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px;
    background: var(--bg-main); padding: 20px; border-radius: 10px; border: 1px solid var(--border-color);
}
.skills-list i { font-size: 22px; color: var(--secondary); margin-top: 5px; }
.skills-list h4 { font-size: 17px; margin-bottom: 5px; color: var(--text-dark); }
.skills-list p { color: var(--text-muted); font-size: 14px; }

.hobbies-cards { display: grid; gap: 20px; }
.hobby-card { height: 180px; border-radius: 15px; position: relative; overflow: hidden; border: 1px solid var(--border-color); }
.hobby-card img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.hobby-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
.hobby-card:hover img { transform: scale(1.1); }
.hobby-info { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; z-index: 2; color: white; display: flex; align-items: center; gap: 15px; }
.hobby-info i { font-size: 24px; color: var(--accent); }

/* Contact Section */
.contact { background: var(--bg-white); border-top: 1px solid var(--border-color); }
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.contact-form { background: var(--card-bg); padding: 40px; border-radius: 15px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px var(--shadow); }
.form-group { margin-bottom: 20px; }
.dual-group { display: flex; gap: 20px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 15px; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-main); color: var(--text-dark); font-size: 16px; outline: none; transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1); }
.contact-form button { width: 100%; justify-content: center; }

.contact-info-map { display: flex; flex-direction: column; gap: 30px; }
.info-cards { display: flex; flex-wrap: wrap; gap: 20px; }
.info-card { flex: 1; min-width: 200px; background: var(--card-bg); padding: 25px; border-radius: 15px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 15px; }
.info-card i { font-size: 30px; color: var(--primary); }
.info-card h4 { font-size: 18px; color: var(--text-dark); }
.info-card p { color: var(--text-muted); font-size: 14px; }

.map-container { width: 100%; height: 250px; border-radius: 15px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 10px 30px var(--shadow); }

@media (max-width: 991px) {
    .contact-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dual-group { flex-direction: column; gap: 20px; }
    .contact-form { padding: 25px; }
}

/* Footer */
footer { background: #000; color: white; padding: 60px 0 20px; border-top: 3px solid var(--primary); }
.footer-wrapper { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; margin-bottom: 40px; }
.footer-info h2 { font-size: 28px; margin-bottom: 15px; color: var(--primary); display: flex; align-items: center; gap: 10px;}
.footer-info p { color: #a0aec0; max-width: 400px; }
.footer-contact h3 { font-size: 20px; margin-bottom: 20px; }
.footer-contact p { font-size: 18px; margin-bottom: 10px; }
.footer-contact i { color: var(--primary); margin-left: 10px;}
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; color: #a0aec0; }

/* Responsive Media Queries */
@media (max-width: 991px) {
    .menu-toggle { display: block; }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 20px var(--shadow);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: var(--transition);
        visibility: hidden;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        visibility: visible;
    }

    .nav-links li { width: 100%; text-align: center; }
    .nav-links a { display: block; padding: 15px; border-bottom: 1px solid var(--border-color); }
    .navbar:not(.scrolled) .nav-links a { color: var(--text-dark); }

    .hero-container { grid-template-columns: 1fr; text-align: center; padding-top: 40px;}
    .hero-content { order: 2; }
    .hero-image-box { order: 1; margin-bottom: 20px; }
    .hero-buttons { justify-content: center; }
    
    .about-wrapper { grid-template-columns: 1fr; text-align: center; }
    
    .timeline { padding-right: 40px; }
    .timeline::before { right: 15px; transform: none; }
    .timeline-icon { right: -5px; transform: none; width: 45px; height: 45px; font-size: 20px; }
    .timeline-item { flex-direction: row-reverse !important; padding-right: 0px; margin-bottom: 30px;}
    .timeline-content { width: 100%; }
    .timeline-item:nth-child(odd) .timeline-content { text-align: right; direction: rtl; }
    
    .dual-layout { grid-template-columns: 1fr; }
    .footer-wrapper { flex-direction: column; text-align: center; }
    .footer-info p { margin: 0 auto; }
}

@media (max-width: 768px) {
    .section-header h2 { font-size: 30px; }
    .title { font-size: 35px; }
    .image-frame { max-width: 300px; height: 350px; }
    .stat-box { display: none; }
    .floating-contact-plugin { right: 20px; bottom: 20px; transform: scale(0.9); transform-origin: bottom right;}
    .experience-circle { width: 250px; height: 250px; }
    .side-panel { padding: 25px; }
}

@media (max-width: 480px) {
    .title { font-size: 28px; }
    .subtitle { font-size: 18px; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn { justify-content: center; width: 100%; }
    .stats-row { flex-direction: column; }
    .timeline { padding-right: 35px; }
    .timeline-item { padding-right: 0px; }
    .timeline::before { right: 10px; transform: none; }
    .timeline-icon { width: 35px; height: 35px; font-size: 14px; right: -5px; box-shadow: 0 0 0 5px var(--bg-main); }
    .timeline-content h3 { font-size: 18px; }
}
