/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: #0b071e;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    /* التعديل هنا لضمان تمركز المحتوى العام ومنع أي إزاحة جانبية */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    background: rgba(11, 7, 30, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

.logo span {
    color: #8a2be2;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    text-decoration: none;
    color: #b3b3b3;
    font-weight: 500;
    transition: 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(124, 58, 237, 0.6);
}

.hire-btn {
    background: #7928ca;
    color: white;
    padding: 10px 22px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(121, 40, 202, 0.3);
}

.hire-btn:hover {
    background: #8a2be2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
}

/* Home Section */
#home {
    min-height: 100vh;
    width: 100%;
    max-width: 1400px; /* ضبط العرض الأقصى عشان الشاشات الكبيرة */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8%;
    padding-top: 80px;
    margin: 0 auto; /* تثبيت العنصر في المنتصف تماماً */
}

.home-content {
    max-width: 600px;
}

.home-content h1 {
    font-size: 48px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-content h2 {
    font-size: 28px;
    color: #a78bfa;
    margin-bottom: 20px;
}

.home-content p {
    color: #d1d5db;
    margin-bottom: 20px;
    font-size: 16px;
}

.tech-stack-pills {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 30px;
}

.tech-stack-pills span {
    color: #c4b5fd;
    font-weight: 600;
}

.home-buttons {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.btn-primary {
    background: #6d28d9;
    color: white;
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
    border: 2px solid #6d28d9;
    color: white;
}

.btn-secondary:hover {
    background: #6d28d9;
    transform: translateY(-2px);
}

.home-image img {
    width: 400px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(109, 40, 217, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.2);
    animation: floatImage 4s ease-in-out infinite;
}

@keyframes floatImage {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Skills Section */
#skills {
    width: 100%;
    max-width: 1400px;
    padding: 100px 8%;
    text-align: center;
    margin: 0 auto;
}

#skills h2, #projects h2, #comments h2, #contact h2 {
    font-size: 38px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
}

#skills h2::after, #projects h2::after, #comments h2::after, #contact h2::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    bottom: -8px;
    left: 25%;
    background: linear-gradient(90deg, transparent, #7c3aed, transparent);
    border-radius: 2px;
}

.section-subtitle {
    color: #9ca3af;
    margin-bottom: 50px;
    font-size: 15px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    justify-content: center;
}

.skill-card {
    background: #161032;
    padding: 30px;
    border-radius: 15px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: #7c3aed;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.15);
    background: linear-gradient(145deg, #161032, #1c143d);
}

.skill-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.html-bg { background: #e34f26; color: white; }
.css-bg { background: #1572b6; color: white; }
.js-bg { background: #f7df1e; color: black; }
.bootstrap-bg { background: #7952b3; color: white; }
.react-bg { background: #61dafb; color: black; }
.node-bg { background: #339933; color: white; }
.express-bg { background: #000000; color: white; border: 1px solid #444; }
.firebase-bg { background: #ffca28; color: black; }
.git-bg { background: #f05032; color: white; }

.skill-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #ffffff;
}

.skill-card p {
    color: #9ca3af;
    font-size: 14px;
}

/* Projects Section */
#projects {
    width: 100%;
    max-width: 1400px;
    padding: 100px 8%;
    text-align: center;
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center;
}

.project-card {
    background: #161032;
    border-radius: 15px;
    overflow: hidden;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: #7c3aed;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.2);
}

.project-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #000;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    margin-bottom: 10px;
    color: #ffffff;
}

.project-info p {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 20px;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.project-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.project-actions button:first-child {
    background: #6d28d9;
    color: white;
}

.project-actions button:first-child:hover {
    background: #7c3aed;
}

.watch-video-btn {
    background: #2d2650;
    color: white;
}

.watch-video-btn:hover {
    background: #3b3268;
}

/* Comments Section */
#comments {
    width: 100%;
    max-width: 1400px;
    padding: 100px 8%;
    text-align: center;
    margin: 0 auto;
}

#commentForm {
    max-width: 600px;
    margin: 0 auto 40px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#commentForm input, #commentForm textarea, .reply-form input {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    background: #161032;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    transition: 0.3s;
}

#commentForm input:focus, #commentForm textarea:focus, .reply-form input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

#commentForm textarea {
    height: 120px;
    resize: none;
}

#commentForm button, .reply-form button {
    padding: 12px;
    border-radius: 10px;
    background: #6d28d9;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

#commentForm button:hover {
    background: #7c3aed;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

#commentsList {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.comment-card {
    background: #161032;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.comment-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.comment-date {
    font-size: 12px;
    color: #9ca3af;
}

.comment-text {
    margin-bottom: 15px;
    color: #e5e7eb;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-actions button {
    background: none;
    border: none;
    color: #a78bfa;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.comment-actions button:hover {
    color: #c4b5fd;
}

.replies-container {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #7c3aed;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reply-item {
    background: #110c26;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.reply-form {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Contact Section */
#contact {
    width: 100%;
    max-width: 1400px;
    padding: 100px 8%;
    text-align: center;
    margin: 0 auto;
}

.contact-cards-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.contact-card {
    background: #161032;
    padding: 25px 35px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: #7c3aed;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.15);
}

.contact-icon {
    font-size: 24px;
    background: linear-gradient(135deg, #6d28d9, #8a2be2);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.3);
}

.contact-details {
    text-align: left;
}

.contact-title {
    display: block;
    color: #9ca3af;
    font-size: 14px;
}

.contact-details a, .contact-details span {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

/* Footer */
footer {
    width: 100%;
    text-align: center;
    padding: 30px;
    background: #070412;
    color: #9ca3af;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

footer span {
    color: #a78bfa;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 800px;
}

.modal-content video {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 35px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    color: #a78bfa;
}

/* ========================================================
   أنيميشن اللوجو + التوافق مع الشاشات الصغيرة (Responsive)
   ======================================================== */

@keyframes logoPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(138, 43, 226, 0.3);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 15px rgba(138, 43, 226, 0.8), 0 0 25px rgba(124, 58, 237, 0.5);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(138, 43, 226, 0.3);
    }
}

.logo {
    animation: logoPulse 3s ease-in-out infinite;
}

@media (max-width: 992px) {
    nav {
        padding: 15px 5%;
    }
    
    nav ul {
        gap: 15px;
    }

    nav ul li a {
        font-size: 14px;
    }

    .hire-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    #home {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: 120px;
        padding-bottom: 50px;
        gap: 40px;
    }

    .home-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .home-content h1 {
        font-size: 36px;
    }

    .home-content h2 {
        font-size: 22px;
    }

    .home-buttons {
        justify-content: center;
    }

    .home-image img {
        width: 280px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 10px;
        padding: 12px 5%;
    }

    nav ul {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hire-btn {
        display: none;
    }

    #home {
        padding-top: 150px;
    }

    .home-content h1 {
        font-size: 30px;
    }

    .home-content h2 {
        font-size: 18px;
    }

    #skills, #projects, #comments, #contact {
        padding: 60px 5%;
    }

    #skills h2, #projects h2, #comments h2, #contact h2 {
        font-size: 28px;
    }

    .contact-cards-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .contact-card {
        justify-content: flex-start;
    }
}
