/*==================== GOOGLE FONTS ====================*/
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Montserrat:wght@400;500;600;700&display=swap");

/*==================== VARIABLES CSS ====================*/
:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /* Scientific Blue Palette (Deep & Professional) */
  --hue: 210;
  --first-color: hsl(var(--hue), 90%, 55%);
  --first-color-alt: hsl(var(--hue), 85%, 45%);
  --title-color: hsl(var(--hue), 15%, 95%);
  --text-color: hsl(var(--hue), 10%, 75%);
  --body-color: hsl(var(--hue), 25%, 8%); /* Dark Background */
  --container-color: hsla(var(--hue), 25%, 14%, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);

  /*========== Font and Typography ==========*/
  --body-font: 'Montserrat', sans-serif;
  --big-font-size: 2.5rem;
  --h1-font-size: 1.75rem;
  --h2-font-size: 1.5rem;
  --h3-font-size: 1.25rem;
  --normal-font-size: 1rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  /*========== Font Weight ==========*/
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /*========== Margins ==========*/
  --mb-0-5: .5rem;
  --mb-0-75: .75rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /*========== Z Index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;
  
  /*========== Border Radius ==========*/
  --radius: 1rem;
}

/*========== Light Theme Variables ==========*/
body.light-theme {
  --title-color: hsl(var(--hue), 15%, 15%);
  --text-color: hsl(var(--hue), 8%, 45%);
  --body-color: hsl(var(--hue), 20%, 96%); /* Light Background */
  --container-color: hsla(0, 0%, 100%, 0.6);
  --glass-border: 1px solid rgba(0, 0, 0, 0.05);
}

/*==================== BASE ====================*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  transition: .4s; /* Smooth Theme Transition */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*==================== REUSABLE CSS CLASSES ====================*/
.container {
  max-width: 1024px;
  margin-inline: 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.section {
  padding-block: 5rem 2rem;
}

.section__title {
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-2);
  text-align: center;
  position: relative;
}
.section__title::after {
    content: ''; 
    display: block; 
    width: 50px; 
    height: 3px; 
    background: var(--first-color); 
    margin: 0.5rem auto 0; 
    border-radius: 2px;
}

/* Glass Card Utility */
.glass-card {
    background: var(--container-color);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    transition: transform .3s, box-shadow .3s;
}
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(var(--hue), 50%, 50%, 0.15);
    border-color: var(--first-color);
}

/* Main Button Style */
.button {
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    background-color: var(--first-color); 
    color: #fff; 
    padding: 1rem 1.8rem; 
    border-radius: 0.5rem; 
    font-weight: var(--font-semi-bold); 
    transition: .3s; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.button:hover {
    background-color: var(--first-color-alt); 
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(var(--hue), 80%, 60%, 0.3); 
}

/*==================== HEADER ====================*/
.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background: transparent;
  transition: .4s;
}

/* Blur Header on Scroll */
.header.scroll-header {
    background: rgba(var(--hue), 25%, 8%, 0.8); /* Dark semi-transparent */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
body.light-theme .header.scroll-header {
    background: rgba(255, 255, 255, 0.8);
}

/*==================== NAV ====================*/
.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  color: var(--first-color);
  font-weight: var(--font-bold);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.logo-dot {
    color: var(--title-color);
}

.nav__toggle, .nav__close {
  color: var(--title-color);
  font-size: 1.25rem;
  cursor: pointer;
  display: none; /* Hidden on Desktop */
}

.nav__list {
  display: flex;
  flex-direction: row;
  column-gap: 2rem;
}

.nav__link {
  color: var(--title-color);
  font-weight: var(--font-medium);
  transition: .3s;
  position: relative;
}

.nav__link:hover {
  color: var(--first-color);
}

.active-link {
  color: var(--first-color);
}
.active-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--first-color);
}

/* Nav Buttons (Theme & Lang) */
.nav__btns {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.change-theme {
    font-size: 1.25rem;
    color: var(--title-color);
    cursor: pointer;
    transition: .3s;
}
.change-theme:hover {
    color: var(--first-color);
}

/* Language Dropdown */
.lang__dropdown {
    position: relative;
    cursor: pointer;
}

.lang__current {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--small-font-size);
    font-weight: var(--font-semi-bold);
    color: var(--title-color);
}
.lang__current:hover {
    color: var(--first-color);
}

.lang__menu {
    position: absolute;
    top: 150%;
    right: 0;
    background-color: var(--container-color);
    backdrop-filter: blur(15px);
    border: var(--glass-border);
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    
    /* Hidden State */
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 120px;
    opacity: 0;
    transform: translateY(-10px);
    transition: .3s;
    z-index: var(--z-modal);
}

/* Show State */
.lang__menu.show-lang {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.lang__item {
    font-size: var(--small-font-size);
    padding: 0.5rem;
    color: var(--text-color);
    border-radius: 0.25rem;
    transition: .3s;
}

.lang__item:hover {
    background-color: var(--first-color);
    color: #fff;
}

/*==================== HOME ====================*/
.home__container {
    padding-top: 7rem; /* Space for fixed header */
    row-gap: 2.5rem;
}

.home__content {
    text-align: center;
}

.home__subtitle {
    font-size: var(--normal-font-size);
    color: var(--first-color);
    margin-bottom: var(--mb-0-5);
}

.home__title {
    font-size: var(--big-font-size);
    margin-bottom: var(--mb-0-5);
    line-height: 1.1;
}

.home__education {
    font-size: var(--h3-font-size);
    color: var(--text-color);
    margin-bottom: var(--mb-1-5);
    opacity: 0.9;
}

.home__description {
    margin-bottom: var(--mb-2);
    line-height: 1.6;
}

.home__social {
    display: flex;
    justify-content: center;
    column-gap: 1.25rem;
    margin-bottom: var(--mb-2);
}

.home__social-link {
    font-size: 1.5rem;
    color: var(--first-color);
    transition: .3s;
}
.home__social-link:hover {
    transform: translateY(-3px);
    color: var(--first-color-alt);
}

/* Home Image */
.home__image-wrapper {
    position: relative;
    justify-self: center;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home__img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--container-color);
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(0,0,0,0.2);
}

.glass-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 10px;
    left: -10px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    z-index: 1;
}

/*==================== ABOUT ====================*/
.about__container {
    gap: 2.5rem;
}

.about__img-wrapper {
    position: relative;
    justify-self: center;
}

.about__img {
    width: 250px;
    border-radius: 1.5rem;
    border: 4px solid var(--container-color);
}

/* Badge Style */
.about__experience-badge {
    position: absolute;
    bottom: -1.5rem;
    right: -1rem;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 120px;
}

.badge-icon {
    font-size: 1.5rem;
    color: var(--first-color);
}
.badge-text {
    font-size: var(--smaller-font-size);
    color: var(--title-color);
    font-weight: var(--font-medium);
    line-height: 1.2;
}

/* About Data */
.about__info {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: var(--mb-2);
}

.about__box {
    text-align: center;
    padding: 1rem 0.5rem;
}

.about__icon {
    font-size: 1.5rem;
    color: var(--first-color);
    margin-bottom: var(--mb-0-5);
}

.about__title {
    font-size: var(--small-font-size);
    margin-bottom: var(--mb-0-5);
}

.about__subtitle {
    font-size: var(--smaller-font-size);
    color: var(--text-color);
}

.about__text-content {
    margin-bottom: var(--mb-2);
}

.about__description {
    margin-bottom: var(--mb-1);
    text-align: justify;
    line-height: 1.6;
}

/*==================== SKILLS (New Grid Layout) ====================*/
.skills__grid-wrapper {
    grid-template-columns: 1fr; /* Mobile: Stacked */
    gap: 2.5rem;
}

.skills__group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skills__category-title {
    font-size: var(--normal-font-size);
    color: var(--first-color);
    text-align: center;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.skills__box {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill__data {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.skill__data i {
    font-size: 1.5rem;
    color: var(--first-color);
    background: rgba(255,255,255,0.05);
    padding: 0.5rem;
    border-radius: 50%;
}

.skill__data h3 {
    font-size: var(--normal-font-size);
    font-weight: var(--font-medium);
    margin-bottom: 0.2rem;
    color: var(--title-color);
}

.skill__data span {
    font-size: var(--smaller-font-size);
    color: var(--text-color);
    opacity: 0.8;
}

/*==================== EXPERIENCE ====================*/
.experience__container {
    gap: 1.5rem;
}

.experience__card {
    padding: 1.5rem;
    border-left: 4px solid var(--first-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.experience__date {
    font-size: var(--small-font-size);
    color: var(--first-color);
    margin-bottom: var(--mb-0-5);
    font-weight: var(--font-semi-bold);
}

.experience__title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.experience__company {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: var(--mb-1);
    opacity: 0.8;
}

/*==================== RESEARCH (SWIPER) ====================*/
.research__container {
    padding: 1rem;
}

.research__card {
    padding: 2rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.research__icon-box {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(var(--hue), 90%, 60%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--mb-1);
    font-size: 1.5rem;
    color: var(--first-color);
}

.research__title {
    font-size: var(--h3-font-size);
    margin-bottom: var(--mb-0-5);
}

.research__desc {
    font-size: var(--small-font-size);
    margin-bottom: var(--mb-1-5);
    flex-grow: 1; /* Pushes button down */
}

.research__button {
    color: var(--first-color);
    font-size: var(--small-font-size);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: var(--font-semi-bold);
    transition: .3s;
}

.research__button:hover {
    gap: 0.5rem;
}

.swiper-pagination-bullet {
    background: var(--text-color);
}
.swiper-pagination-bullet-active {
    background: var(--first-color);
}

/*==================== CONTACT ====================*/
.contact__container {
    gap: 2rem;
}

.contact__content {
    display: grid;
    gap: 1.5rem;
}

.contact__card {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact__icon {
    font-size: 2rem;
    color: var(--first-color);
    margin-bottom: var(--mb-0-5);
}

.contact__card-title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.25rem;
}

.contact__card-data {
    font-size: var(--small-font-size);
    color: var(--text-color);
    margin-bottom: var(--mb-1);
    display: block;
}

.contact__button {
    font-size: var(--small-font-size);
    color: var(--first-color);
    display: inline-flex;
    align-items: center;
    column-gap: 0.25rem;
    font-weight: var(--font-semi-bold);
    transition: .3s;
}

.contact__button:hover {
    column-gap: 0.5rem;
}

/*==================== FOOTER ====================*/
.footer {
    background-color: var(--container-color);
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer__bg {
    padding: 3rem 0 2rem;
}

.footer__container {
    row-gap: 2rem;
}

.footer__title {
    font-size: var(--h2-font-size);
    margin-bottom: var(--mb-0-5);
}

.footer__subtitle {
    font-size: var(--small-font-size);
    color: var(--text-color);
    margin-bottom: var(--mb-1);
}

.footer__desc {
    font-size: var(--smaller-font-size);
    max-width: 300px;
}

.footer__heading {
    font-size: var(--h3-font-size);
    margin-bottom: var(--mb-1);
    color: var(--first-color);
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__link {
    color: var(--text-color);
    font-size: var(--small-font-size);
    transition: .3s;
}
.footer__link:hover {
    color: var(--first-color);
    transform: translateX(5px);
    display: inline-block;
}

.footer__social {
    display: flex;
    gap: 1rem;
}

.footer__social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--body-color);
    color: var(--first-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s;
    border: var(--glass-border);
}
.footer__social-link:hover {
    background: var(--first-color);
    color: #fff;
    transform: translateY(-5px);
}

.footer__copy {
    display: block;
    margin-top: 3rem;
    text-align: center;
    font-size: var(--smaller-font-size);
    color: var(--text-color);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
}

/*==================== SCROLL BAR ====================*/
::-webkit-scrollbar {
    width: .6rem;
    background-color: hsl(var(--hue), 8%, 15%);
}
::-webkit-scrollbar-thumb {
    background-color: hsl(var(--hue), 8%, 25%);
    border-radius: .5rem;
}
::-webkit-scrollbar-thumb:hover {
    background-color: hsl(var(--hue), 8%, 35%);
}

/*==================== BACKGROUND PARTICLES ====================*/
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/*==================== MEDIA QUERIES (RESPONSIVE) ====================*/

/* For Mobile Devices (Small) */
@media screen and (max-width: 350px) {
  .container {
    margin-inline: 1rem;
  }
  .nav__menu {
    padding: 2rem 0.25rem 4rem;
  }
  .nav__list {
    column-gap: 0;
  }
}

/* For Mobile Devices (Standard) */
@media screen and (max-width: 768px) {
    .nav__menu {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        background-color: var(--container-color);
        padding: 2rem 1.5rem 4rem;
        backdrop-filter: blur(16px);
        box-shadow: 0 -1px 4px rgba(0,0,0,.15);
        border-radius: 1.5rem 1.5rem 0 0;
        transition: .4s;
        z-index: var(--z-fixed);
    }
    .show-menu {
        bottom: 0;
    }
    .nav__list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    .nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: var(--small-font-size);
    }
    .nav__close, .nav__toggle {
        display: block;
    }

    .home__container {
        grid-template-columns: 1fr;
    }
    .home__content {
        order: 1;
    }
    .home__image-wrapper {
        order: 0;
        margin-bottom: 2rem;
    }

    .footer__container {
        grid-template-columns: 1fr;
    }
}

/* For Tablets and Desktops */
@media screen and (min-width: 768px) {
    .container {
        margin-inline: auto;
    }

    .section {
        padding-block: 7rem 2rem;
    }
    
    .nav {
        height: calc(var(--header-height) + 1.5rem);
    }
    .nav__list {
        display: flex;
        column-gap: 2.5rem;
    }
    .nav__menu {
        display: flex;
    }
    .nav__toggle, .nav__close {
        display: none;
    }

    .home__container {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
        text-align: left;
    }
    .home__content {
        text-align: left;
    }
    .home__social {
        justify-content: flex-start;
    }

    .about__container {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
    }

    .skills__grid-wrapper {
        grid-template-columns: repeat(2, 1fr); /* 2 Cols of Categories */
    }

    .experience__container {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* For Large Desktops */
@media screen and (min-width: 1024px) {
    .skills__grid-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

/*==================== RTL SUPPORT (ARABIC) ====================*/
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .home__content, 
[dir="rtl"] .home__container, 
[dir="rtl"] .section__title,
[dir="rtl"] .skills__category-title,
[dir="rtl"] .about__description {
    text-align: right;
}

[dir="rtl"] .home__social {
    justify-content: flex-start;
}
/* Flip home social back to center on mobile in RTL */
@media screen and (max-width: 768px) {
    [dir="rtl"] .home__content,
    [dir="rtl"] .section__title,
    [dir="rtl"] .skills__category-title {
        text-align: center;
    }
    [dir="rtl"] .home__social {
        justify-content: center;
    }
}

[dir="rtl"] .experience__card {
    border-left: none;
    border-right: 4px solid var(--first-color);
}

[dir="rtl"] .research__button i,
[dir="rtl"] .contact__button i,
[dir="rtl"] .button i {
    transform: rotate(180deg);
}

[dir="rtl"] .lang__menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .about__experience-badge {
    right: auto;
    left: -1rem;
}

[dir="rtl"] .nav__btns {
    margin-right: auto;
    margin-left: 0;
}
[dir="rtl"] .nav__logo {
    margin-left: auto;
    margin-right: 0;
}

/* RTL Footer Hover Flip */
[dir="rtl"] .footer__link:hover {
    transform: translateX(-5px);
}