/* Custom Properties / Variables */
:root {
    --bg-color: #080808;
    --second-bg-color: #121212;
    --text-color: #ffffff;
    --main-color: #00eeff;
    --main-color-hover: #00c3d6;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);

    font-family: 'Inter', sans-serif;
    --font-ar: 'Cairo', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f4f5f9;
    --second-bg-color: #ffffff;
    --text-color: #1a1a1a;
    --main-color: #0077ff;
    --main-color-hover: #005bb5;
    --card-bg: rgba(0, 0, 0, 0.03);
    --border-color: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
}

/* RTL Support via HTML lang attribute */
html[lang="ar"] {
    font-family: var(--font-ar);
    direction: rtl;
}

/* Particles Container */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: rgba(var(--bg-color), 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: 0.3s;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 9rem;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 0.8rem var(--main-color));
}

.navbar a {
    font-size: 1.7rem;
    color: var(--text-color);
    margin-left: 4rem;
    font-weight: 500;
    transition: .3s;
}

html[lang="ar"] .navbar a {
    margin-left: 0;
    margin-right: 4rem;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

/* Controls (Lang, Theme, Mobile toggle) */
.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    background: transparent;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    transition: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.control-btn:hover {
    color: var(--main-color);
    transform: scale(1.1);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    display: none;
    cursor: pointer;
}

/* Media Queries */
@media (max-width: 991px) {
    .header {
        padding: 2rem 3%;
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block;
    }

    .navbar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 3%;
        background: var(--bg-color);
        border-top: .1rem solid rgba(0, 0, 0, .2);
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
        display: none;
    }

    .navbar.active {
        display: block;
    }

    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
    }

    html[lang="ar"] .navbar a {
        margin: 3rem 0;
    }
}

/* Home Section */
.home {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10rem 9% 2rem;
    gap: 5rem;
}

.home-content {
    flex: 1;
}

.home-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
}

.home-content h1 {
    font-size: 5.6rem;
    font-weight: 800;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--main-color), #bc13fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 1rem 0;
}

.home-content h3 span {
    color: var(--main-color);
}

.home-content p {
    font-size: 1.6rem;
    margin: 2rem 0 4rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .home-content p {
    color: rgba(0, 0, 0, 0.8);
}

.social-icons {
    margin-bottom: 4rem;
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--main-color);
    margin-right: 1.5rem;
    transition: .3s ease;
}

html[lang="ar"] .social-icons a {
    margin-right: 0;
    margin-left: 1.5rem;
}

.social-icons a:hover {
    background: var(--main-color);
    color: var(--bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

.btn-group {
    display: flex;
    gap: 2rem;
}

.btn {
    display: inline-block;
    padding: 1.2rem 2.8rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--main-color);
    font-size: 1.6rem;
    color: var(--bg-color);
    letter-spacing: .1rem;
    font-weight: 600;
    transition: .3s ease;
    border: .2rem solid var(--main-color);
}

.btn:hover {
    box-shadow: none;
    background: transparent;
    color: var(--main-color);
}

.btn:nth-child(2) {
    background: transparent;
    color: var(--main-color);
    box-shadow: none;
}

.btn:nth-child(2):hover {
    background: var(--main-color);
    color: var(--bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

.home-img {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-img img {
    width: 80%;
    max-width: 450px;
    border-radius: 50%;
    position: relative;
    z-index: 10;
    animation: floatImage 4s ease-in-out infinite;
    box-shadow: 0 0 4rem rgba(0, 238, 255, 0.2);
    border: .5rem solid var(--card-bg);
}

.glow-circle {
    position: absolute;
    width: 60%;
    height: 60%;
    background: var(--main-color);
    border-radius: 50%;
    filter: blur(100px);
    z-index: 1;
    opacity: 0.3;
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes floatImage {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2.4rem);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        opacity: 0.2;
        transform: scale(1);
    }

    100% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Responsive home */
@media (max-width: 991px) {
    .home {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 12rem;
    }

    .home-content p {
        margin: 2rem auto 4rem;
        max-width: 600px;
    }

    .social-icons {
        justify-content: center;
    }

    .btn-group {
        justify-content: center;
    }

    .home-img img {
        width: 70%;
    }
}

/* Headings */
.heading {
    text-align: center;
    font-size: 4.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
}

.heading span {
    color: var(--main-color);
}

/* Sections Base */
section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
}

/* About Section */
.about {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: var(--second-bg-color);
}

.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-text h3 {
    font-size: 2.6rem;
    margin-bottom: 2rem;
    color: var(--main-color);
}

.about-text p {
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .about-text p {
    color: rgba(0, 0, 0, 0.8);
}

/* Skills Section */
.skills {
    background: var(--bg-color);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.skills-box {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 2rem;
    text-align: center;
    border: .2rem solid var(--border-color);
    transition: .4s ease;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
}

.skills-box:hover {
    border-color: var(--main-color);
    transform: translateY(-1rem);
    box-shadow: 0 0 2rem rgba(0, 238, 255, 0.1);
}

.skills-box i {
    font-size: 5rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}

.skills-box h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.skills-box p {
    font-size: 1.4rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .skills-box p {
    color: rgba(0, 0, 0, 0.7);
}

/* Projects Section */
.projects {
    background: var(--second-bg-color);
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 2rem;
    overflow: hidden;
    border: .2rem solid var(--border-color);
    transition: .4s ease;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    border-color: var(--main-color);
    transform: translateY(-1rem);
    box-shadow: 0 0 2rem rgba(0, 238, 255, 0.2);
}

.project-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .4s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-info {
    padding: 2.5rem;
}

.project-info h3 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

.project-info p {
    font-size: 1.4rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

[data-theme="light"] .project-info p {
    color: rgba(0, 0, 0, 0.7);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tech-stack span {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 238, 255, 0.1);
    color: var(--main-color);
    border-radius: 1rem;
    border: 1px solid var(--main-color);
}

/* Contact Section */
.contact {
    background: var(--bg-color);
}

.contact-info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.info-box {
    text-align: center;
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 2rem;
    border: .2rem solid var(--border-color);
    transition: .3s ease;
}

.info-box:hover {
    border-color: var(--main-color);
    transform: translateY(-0.5rem);
}

.info-box i {
    font-size: 4rem;
    color: var(--main-color);
    margin-bottom: 1rem;
}

.info-box h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.info-box p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .info-box p {
    color: rgba(0, 0, 0, 0.7);
}

.contact form {
    max-width: 70rem;
    margin: 1rem auto;
    text-align: center;
    margin-bottom: 3rem;
}

.contact form .input-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: var(--second-bg-color);
    border-radius: .8rem;
    margin: .7rem 0;
    border: .2rem solid var(--border-color);
    transition: .3s;
}

html[lang="ar"] .contact form .input-box input,
html[lang="ar"] .contact form textarea {
    font-family: var(--font-ar);
}

.contact form .input-box input {
    width: 49%;
}

.contact form .input-box input:focus,
.contact form textarea:focus {
    border-color: var(--main-color);
}

.contact form textarea {
    resize: none;
}

.contact form .btn {
    margin-top: 2rem;
    cursor: pointer;
}

/* ============================
   Premium Footer
   ============================ */
.footer {
    padding: 0;
    background: var(--second-bg-color);
    border-top: 1px solid var(--border-color);
    position: relative;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    padding: 6rem 9% 4rem;
}

.footer-col h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 4rem;
    height: 3px;
    background: linear-gradient(135deg, var(--main-color), #bc13fe);
    border-radius: 2px;
}

html[lang="ar"] .footer-col h4::after {
    left: auto;
    right: 0;
}

/* Footer Brand */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-logo-link {
    display: inline-block;
    width: fit-content;
}

.footer-logo-img {
    height: 10rem;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.footer-logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 1rem var(--main-color));
}

.footer-tagline {
    font-size: 1.5rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.6);
    max-width: 35rem;
}

[data-theme="light"] .footer-tagline {
    color: rgba(0, 0, 0, 0.6);
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 1.2rem;
}

.footer-links a {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="light"] .footer-links a {
    color: rgba(0, 0, 0, 0.6);
}

.footer-links a:hover {
    color: var(--main-color);
    transform: translateX(5px);
}

html[lang="ar"] .footer-links a:hover {
    transform: translateX(-5px);
}

/* Footer Social */
.footer-social {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.footer-social a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4.5rem;
    height: 4.5rem;
    background: var(--card-bg);
    border: .2rem solid var(--border-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--main-color);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--main-color);
    color: var(--bg-color);
    border-color: var(--main-color);
    box-shadow: 0 0 2rem rgba(0, 238, 255, 0.3);
    transform: translateY(-3px);
}

/* Footer Bottom */
.footer-bottom {
    padding: 0 9%;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--main-color), #bc13fe, transparent);
    opacity: 0.4;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
}

.footer-copyright {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .footer-copyright {
    color: rgba(0, 0, 0, 0.5);
}

.footer-copyright a {
    color: var(--main-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-copyright a:hover {
    color: #bc13fe;
}

/* Back to Top Button */
.footer-back-top {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, var(--main-color), #bc13fe);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.footer-back-top i {
    font-size: 2.4rem;
    color: #fff;
}

.footer-back-top:hover {
    box-shadow: 0 0 2rem rgba(0, 238, 255, 0.4);
    transform: translateY(-3px);
}

/* ============================
   Responsive - Final
   ============================ */
@media (max-width: 991px) {
    .contact form .input-box input {
        width: 100%;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 4rem 5% 3rem;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    html[lang="ar"] .footer-col h4::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .footer-brand {
        align-items: center;
    }

    .footer-tagline {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links a:hover {
        transform: none;
    }

    html[lang="ar"] .footer-links a:hover {
        transform: none;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}