/* Paste your entire original CSS here */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
    --bg-color: #0A0A0A;
    --card-bg-color: #121212;
    --text-color: #EAEAEA;
    --muted-text-color: #888888;
    --accent-color: #14b8a6;
    --border-color: rgba(20, 184, 166, 0.2);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: all .3s ease;
}

/* This new rule will style the container for the mobile icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* Space between the lang button and menu icon */
}

.header.sticky {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 700;
    transition: color 0.3s;
}

.logo:hover {
    color: var(--accent-color);
}

.navbar a {
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--text-color);
    margin-left: 3.5rem;
    transition: color .3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--accent-color);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    cursor: pointer;
    display: none;
}


/* General Section & Container Styles */
section {
    padding: 4rem 0;
    margin-bottom: 1rem;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 4%;
}

.section-heading {
    font-family: 'Courier New', Courier, monospace;
    font-size: 3.2rem;
    color: var(--accent-color);
    margin-bottom: 4rem;
    text-align: center;
    min-height: 3.5rem;
    /* Prevents layout shift during typing */
}

/* Add this to style.css */
.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 1.2rem;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    transition: 0.3s;
}

.btn-small:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Grid Containers */
.grid-container {
    display: grid;
    gap: 2.5rem;
}

.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.three-cols {
    grid-template-columns: repeat(3, 1fr);
}


/* Home Section */
.home {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15rem 9% 5rem;
}

.home-container {
    max-width: 80rem;
}

.profile-pic-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    width: 200px;
    height: 200px;
    margin-left: auto;
    margin-right: auto;
}

/* Animated Border for Profile Picture */
.profile-pic-container::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    bottom: -4px;
    left: -4px;
    background: conic-gradient(from var(--angle), var(--accent-color), #222, #333, var(--accent-color));
    border-radius: 50%;
    z-index: -1;
    animation: spin 4s linear infinite;
    --angle: 0deg;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes spin {
    to {
        --angle: 360deg;
    }
}

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--card-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--muted-text-color);
    font-size: 1.8rem;
    overflow: hidden;
    /* To keep image inside the circle */
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: #1a1a1a;
}

.service-images img {
    width: 100%;
    aspect-ratio: 2/3; 
    object-fit: cover;
    border-radius: 0.6rem;
    transition: transform 0.3s ease;
}

.service-images img:hover {
    transform: scale(1.1);
}

.service-card {
    padding: 0; /* Align with previous project card style */
}

.home-name {
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(20, 184, 166, 0.4);
    white-space: nowrap;
    /* Keeps name on one line */
    font-size: clamp(1.5rem, 5vw, 3rem);
    /* Responsive font size */
}

.home-title {
    font-size: 2.4rem;
    font-weight: 500;
    color: var(--muted-text-color);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 3rem;
    /* Prevents layout shift */
}

.home-bio {
    font-size: 1.6rem;
    line-height: 1.7;
    max-width: 70rem;
    margin: 0 auto 4rem;
}

/* Typing Animation & Cursor */
.cursor {
    display: inline-block;
    background-color: var(--accent-color);
    margin-left: 0.1rem;
    width: 3px;
    animation: blink 1s infinite;
}

.cursor.typing {
    animation: none;
}


/* Fix to allow images to pop out without being clipped */
.service-card, .service-images {
    overflow: visible !important;
}

.service-images img:hover {
    transform: scale(1.15); /* Slightly bigger zoom on hover */
    z-index: 5;
    box-shadow: 0 5px 15px rgba(20, 184, 166, 0.4);
}

@keyframes blink {
    0% {
        background-color: var(--accent-color);
    }

    49% {
        background-color: var(--accent-color);
    }

    50% {
        background-color: transparent;
    }

    99% {
        background-color: transparent;
    }

    100% {
        background-color: var(--accent-color);
    }
}


.btn-box {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1.2rem 3rem;
    background: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: .8rem;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--bg-color);
    transition: all 0.3s ease;
}

.btn:hover {
    background: transparent;
    color: var(--accent-color);
}

.btn.btn-outline {
    background: transparent;
    color: var(--accent-color);
}

.btn.btn-outline:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.social-links a {
    font-size: 3rem;
    color: var(--muted-text-color);
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}


/* General Card Styles */
.card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.card-icon {
    font-size: 2.4rem;
    color: var(--accent-color);
}

.card-header h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-meta {
    font-size: 1.4rem;
    color: var(--muted-text-color);
    margin-left: auto;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 500;
}

.card-info {
    font-size: 1.5rem;
    color: var(--muted-text-color);
    line-height: 1.6;
}

/* Experience Card Specifics */
.experience-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.card-body {
    padding-top: 1rem;
}

.card-subtitle {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.card-body ul {
    list-style-type: '—  ';
    padding-left: 2rem;
    font-size: 1.5rem;
    line-height: 1.7;
    color: var(--muted-text-color);
}

/* Project Card Specifics */
.project-card {
    padding: 0;
    gap: 0;
}

.project-image-placeholder {
    width: 100%;
    aspect-ratio: 9 / 16;
    /* Phone screen aspect ratio */
    background: #2a2a2a;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--muted-text-color);
    font-size: 2rem;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    overflow: hidden;
    /* Ensures GIF fits */
}

.project-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-content h4 {
    font-size: 2rem;
}

.project-content p {
    font-size: 1.4rem;
    color: var(--muted-text-color);
    flex-grow: 1;
}

.tech-tags,
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.tech-tags span,
.skills-tags span {
    background: #252525;
    color: var(--muted-text-color);
    padding: 0.5rem 1.2rem;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: #2a2a2a;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 0.6rem;
    font-size: 1.4rem;
    transition: all .3s ease;
}

.project-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.project-btn i {
    font-size: 1.8rem;
}

/* Skills Card Specifics */
.skills-header {
    justify-content: center;
    margin-bottom: 1.5rem;
}

.skills-tags {
    margin-top: 0;
}

.skills-tags span {
    font-size: 1.4rem;
}

/* Certification Card Specifics */
.credential-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    /* Pushes the link to the bottom */
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 500;
}

.credential-link i {
    font-size: 1.8rem;
}

.credential-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    padding: 4rem 9% 3rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-social-links {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-social-links a {
    font-size: 2.8rem;
    color: var(--muted-text-color);
    transition: color 0.3s ease;
}

.footer-social-links a:hover {
    color: var(--accent-color);
}

.footer-text p {
    font-size: 1.4rem;
    color: var(--muted-text-color);
}

/* Page Transition Overlay */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    z-index: 9999;
    pointer-events: none;
    background-color: transparent;
    /* Change background color to transparent */
    /* Allows clicks to go through when hidden */
}

.transition-panel {
    width: 50%;
    height: 100%;
    background: transparent;
    /* Change background color to transparent */
    transform: scaleY(0);
    transition: transform 0.5s ease-in-out;
}

#transition-overlay.show .transition-panel {
    transform: scaleY(1);
    background-color: transparent;
    /* Change background color to transparent */

}

#transition-overlay.hide .transition-panel {
    transform: scaleY(0);
    transform-origin: bottom;
    background-color: transparent;
    /* Change background color to transparent */

}

/* Language Switcher Button */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-color);
    font-size: 1.6rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: .8rem;
    cursor: pointer;
    margin-left: 2rem;
    transition: all .3s ease;
    height: 3.6rem;
}

.lang-btn i {
    font-size: 1.8rem;
}

.lang-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

/* RTL Language Styles */
.rtl {
    direction: rtl;
    /* You may want to use a specific Arabic font like 'Tajawal' or 'Cairo' from Google Fonts */
    /* font-family: 'Cairo', sans-serif; */
}

/* Flip margins for RTL */
.rtl .navbar a {
    margin-left: 0;
    margin-right: 3.5rem;
}

.rtl .card-meta {
    margin-left: 0;
    margin-right: auto;
}

.rtl .card-body ul {
    padding-left: 0;
    padding-right: 2rem;
}

.rtl .cursor {
    margin-left: 0;
    margin-right: 0.1rem;
}

.rtl .credential-link i {
    transform: scaleX(-1);
    /* Flips the external link icon */
}

/* Keep icon order LTR for better aesthetics */
.rtl .social-links,
.rtl .footer-social-links,
.rtl .project-links {
    direction: ltr;
    justify-content: center;
}

/* ====================================================== */


/* Media Queries for Responsiveness */
@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 4%;
    }


    .two-cols,
    .three-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block;
    }

    /* Keep the lang btn visible, as it's now part of the icons group */
    .header-icons {
        display: flex;
    }

    .navbar {
        position: absolute;
        top: 100%;
        left: -100%;
        width: 100%;
        padding: 1rem 4%;
        background: var(--card-bg-color);
        border-bottom: 1px solid var(--border-color);
        transition: .25s ease;
    }

    /* NEW: Use flex-direction to handle LTR/RTL on mobile */
    .header {
        flex-direction: row;
    }

    .rtl .header {
        flex-direction: row-reverse;
    }

    .navbar.active {
        left: 0;
    }

    .rtl .navbar {
        left: auto;
        right: -100%;
    }

    .rtl .navbar.active {
        right: 0;
    }

    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
        text-align: center;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 50%;
    }
}

/* Contact Section Styles */
.contact-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-form .input-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.contact-form .input-box input,
.contact-form textarea {
    flex: 1 1 48%;
    /* Allows two inputs per row, or full width on smaller screens */
    background: #252525;
    border: 1px solid var(--border-color);
    border-radius: .8rem;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
    flex-basis: 100%;
    /* Full width for textarea */
}

.contact-form .btn {
    width: fit-content;
    margin-top: 1rem;
    align-self: center;
    /* Center the button */
}

/* Adjust input-box for smaller screens */
@media (max-width: 600px) {
    .contact-form .input-box input {
        flex-basis: 100%;
    }
    .service-images {
        grid-template-columns: 1fr; /* Stack images vertically for maximum size */
        gap: 1.5rem;
        padding: 1rem;
    }

    .service-images img {
        aspect-ratio: 16/9; /* Wider view for mobile screenshots */
        height: auto;
    }
    
    .service-card .project-content h4 {
        font-size: 2.2rem; /* Make titles easier to read on mobile */
    }
}

/* Lightbox Animation Styles */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

#lightbox-overlay img {
    transition: transform 0.3s ease;
}