/* General */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}


body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: #121212;
    color: #fff;
    text-align: center;
}

/* Header */
header {
    background: rgba(34, 34, 34, 0.9);
    color: white;
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background 0.3s;
}

/* استایل کلی منو */
nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

/* آیتم‌های منو */
nav ul li {
    margin: 0 10px;
}

/* لینک‌های منو */
nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

/* هاور لینک‌های منو */
nav ul li a:hover {
    color: #f4a261;
}

/* نسخه دسکتاپ - افزایش فاصله بین آیتم‌ها */
@media (min-width: 769px) {
    nav ul li {
        margin: 0 20px; /* فاصله‌ی بیشتر بین آیتم‌های منو */
    }
    nav ul li a {
        letter-spacing: 2px; /* افزایش فاصله بین حروف */
        word-spacing: 15px; /* افزایش فاصله بین کلمات */
    }
}

/* نسخه موبایل - کاهش بیشتر فاصله بین آیتم‌ها */
@media (max-width: 768px) {
    nav ul {
        flex-wrap: nowrap; /* جلوگیری از رفتن به خط بعد */
        gap: 0; /* کاملاً فشرده */
        padding: 6px 0;
    }

    nav ul li {
        margin: 0 1px; /* کمترین فاصله ممکن */
    }

    nav ul li a {
        font-size: 14px; /* کوچک‌تر برای جای‌گیری بهتر */
        padding: 3px 1px; /* کاهش بیشتر پدینگ */
        letter-spacing: 0px; /* حذف فاصله‌ی بین حروف */
        word-spacing: 1px; /* کاهش فاصله‌ی بین کلمات */
    }

    header {
        text-align: center;
        padding: 6px 0;
    }

    header h1 {
        font-size: 18px;
        text-align: center;
        width: 100%;
    }
}





/* Social Icons */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    text-decoration: none;
    transition: transform 0.3s, background 0.3s;
}

/* لینکدین */
.social-icon.linkedin {
    background: #0077b5; /* رنگ برند لینکدین */
}

.social-icon.linkedin:hover {
    background: #005582;
    transform: scale(1.1);
}

/* گیت‌هاب */
.social-icon.github {
    background: #333;
}

.social-icon.github:hover {
    background: #222;
    transform: scale(1.1);
}




nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
    justify-content: center;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #f4a261;
}

/* Hero */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    background: url('background.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed; /* این باعث میشه بک‌گراند ثابت بمونه (پارالاکس) */
}

.hero-content {
    text-align: center;
}


.profile-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}


.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 6px solid white;
    object-fit: cover;
}

/* Sections */
.container {
    padding: 80px 0;
    width: 80%;
    margin: auto;
}







/* استایل عنوان About Me */
.about-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #fff;
}

/* استایل کلی بخش About Me */
#about {
    background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
    padding: 50px 20px;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    margin: auto;
}

/* استایل متن درباره من */
.about-text {
    font-size: 18px;
    line-height: 1.6;
    text-align: left;
}

/* هایلایت متن‌های مهم */
.highlight {
    color: #ff6b00;
    font-weight: bold;
}

/* انیمیشن نرم برای نمایش متن */
.about-text p {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.about-text p:nth-child(1) { animation-delay: 0.2s; }
.about-text p:nth-child(2) { animation-delay: 0.4s; }
.about-text p:nth-child(3) { animation-delay: 0.6s; }
.about-text p:nth-child(4) { animation-delay: 0.8s; }
.about-text p:nth-child(5) { animation-delay: 1s; }
.about-text p:nth-child(6) { animation-delay: 1.2s; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    #about {
        max-width: 90%;
        padding: 20px 15px; /* کاهش پدینگ */
    }

    .about-text {
        font-size: 14px; /* کاهش سایز فونت */
        text-align: center;
        line-height: 1.4; /* فشرده‌تر کردن متن */
    }
}








/* تنظیمات Work Experience */
#experience {
    position: relative;
    padding: 70px 0;
    text-align: center;
}

/* آیتم‌های تایم‌لاین */
.timeline-item {
    position: relative;
    width: 60%; /* برای دسکتاپ */
    margin: 60px auto;
    opacity: 0;
    transform: translateY(40px); /* حرکت نرم از پایین به بالا */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    text-align: center; /* محتوای داخل کارت‌ها وسط‌چین شود */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* وقتی کارت نمایش داده شد */
.timeline-item.show {
    opacity: 1;
    transform: translateY(0);
}

/* استایل کارت تایم‌لاین */
.timeline-box {
    background: linear-gradient(135deg, rgba(44, 44, 44, 0.9), rgba(58, 58, 58, 0.9));
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.1);
    min-height: 220px;
    width: 100%;
    max-width: 600px; /* کنترل حداکثر عرض */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    text-align: center;
    margin: auto; /* وسط‌چین کردن کارت */
}

/* افکت هاور کارت‌ها */
.timeline-box:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(255, 94, 0, 0.7);
}

/* عنوان کارت */
.timeline-box h3 {
    font-size: 24px;
    color: #ff6b00;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
}

/* تاریخ */
.timeline-box span {
    font-size: 16px;
    color: #ddd;
    margin-bottom: 15px;
    font-style: italic;
    display: block;
    text-align: center;
}

/* لیست آیتم‌ها */
.timeline-box ul {
    padding-left: 0;
    list-style: none;
    text-align: center;
    width: 100%;
}

/* آیتم‌های لیست */
.timeline-box ul li {
    font-size: 16px;
    color: white;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    position: relative;
    padding-left: 25px;
    text-align: center;
}

/* افکت نمایش خط به خط */
.timeline-box ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #ff6b00;
    font-size: 20px;
    font-weight: bold;
}


/* لینک‌های داخل timeline-box */
.timeline-box ul li a {
    color: #FF6B00 !important; /* رنگ نارنجی برای لینک‌ها */
    text-decoration: none; /* حذف خط زیر لینک */
    transition: color 0.3s ease-in-out; /* انیمیشن نرم برای تغییر رنگ */
}

/* افکت هاور برای لینک‌ها */
.timeline-box ul li a:hover {
    color: #e65c00 !important; /* رنگ کمی تیره‌تر هنگام هاور */
    text-decoration: underline; /* افزودن خط زیر هنگام هاور */
}



/* وقتی اسکرول شد، لیست خط به خط باز شود */
.timeline-box ul li.show-line {
    opacity: 1;
    transform: translateY(0);
}

/* تنظیمات نمایش Work Experience در موبایل */
@media (max-width: 768px) {
    .timeline-item {
        width: 100%;
        max-width: 100%;
        margin: 15px auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .timeline-box {
        max-width: 850px; /* قبلاً 100% بود، حالا مثل تحصیلات 850px شد */
        width: 90%; /* جلوگیری از کشیدگی زیاد */
        padding: 30px;
        font-size: 16px; /* برای خوانایی بهتر */
        margin: auto;
    }

    .timeline-box h3 {
        font-size: 22px; /* کمی بزرگ‌تر کردن عنوان */
        white-space: nowrap; /* جلوگیری از شکستن متن به چند خط */
    }

    .timeline-box ul li {
        padding-left: 30px;
    }
       .timeline-box ul li::before {
        left: 5px; /* حرکت دایره کمی به چپ */
    }
}





/* بخش Education */
/* عنوان خارج از باکس */
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px; /* فاصله مناسب از باکس Education */
}

/* کاهش ارتفاع کلی باکس */
#education {
    background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
    padding: 40px 20px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.5);
    max-width: 850px;
    margin: auto;
}

/* جعبه Education */
.education-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: left;
    min-height: 60px; /* کاهش ارتفاع */
    padding: 5px 0; /* کاهش padding */
}

/* آیکون دانشگاه */
.education-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
    padding: 10px;
    transition: transform 0.3s ease-in-out;
}

.education-icon:hover {
    transform: scale(1.1);
}

/* اطلاعات تحصیلی */
.education-text {
    text-align: left;
}

.education-text h3 {
    font-size: 24px;
    color: #ff6b00;
    margin-bottom: 8px;
}

.education-year {
    font-size: 16px;
    color: #ddd;
    font-style: italic;
    margin-bottom: 12px;
}

.education-desc {
    font-size: 18px;
    line-height: 1.6;
    color: #e0e0e0;
}

/* هایلایت متن‌های کلیدی */
.highlight {
    color: #ff6b00;
    font-weight: bold;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    #education {
        max-width: 95%; /* افزایش عرض باکس تحصیلات */
        padding: 25px 15px; /* کاهش فضای داخلی */
        text-align: center; /* وسط چین کردن محتوا */
    }

    .education-box {
        flex-direction: column; /* چیدن آیتم‌ها به‌صورت ستونی در موبایل */
        align-items: center;
        text-align: center;
    }

    .education-icon {
        width: 80px; /* کاهش اندازه آیکون دانشگاه */
        height: 80px;
        margin-bottom: 10px; /* فاصله پایین‌تر از متن */
    }

    .education-text {
        text-align: center; /* وسط چین کردن کل متن */
    }

    .education-text h3 {
        font-size: 20px; /* کمی کوچک‌تر برای هماهنگی */
        text-align: center;
        white-space: normal; /* اجازه به شکست متن در موبایل */
    }

    .education-year {
        font-size: 16px;
        color: #ddd;
        font-style: italic;
        display: block; /* نمایش خط جداگانه */
        margin-bottom: 8px;
    }

    .education-desc {
        font-size: 14px; /* کاهش سایز فونت توضیحات */
        line-height: 1.5;
        text-align: center; /* وسط چین کردن متن */
    }
}












/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* دو ستون در هر ردیف */
    gap: 40px 160px; 
    justify-content: center;  
    align-items: center;
    width: 70%; /* تنظیم عرض کلی */
    margin: 40px auto; /* فاصله متناسب از بالا */
    transform: translateX(-20px); 
}

/* عنوان بخش */
.skills-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px; /* ایجاد فاصله بین عنوان و کارت‌ها */
}

/* کارت‌های مهارت */
.skill-category {
    background: linear-gradient(135deg, #ff9800, #ff3d00); /* گرادیان نارنجی براق */
    padding: 20px;
    border-radius: 12px;
    height: 220px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.7); /* درخشش کارت */
    overflow: hidden;
}

/* افکت هاور */
.skill-category:hover {
    background: linear-gradient(135deg, #ff6b00, #ff2400);
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(255, 69, 0, 0.7);
}


/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr; /* در موبایل هر کارت تک‌ستونه بشه */
        justify-content: center;  
        align-items: center;
        width: 100%;
        gap: 20px;
        transform: none; /* حذف جابجایی در موبایل */
    }
    .skill-category {
        width: 80%;
        height: auto;
        margin: auto; /* وسط چین کردن در موبایل */
    }
}








.certifications-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.certification-card {
    background: linear-gradient(135deg, #2c2c2c, #444);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    width: 220px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255, 140, 0, 0.5);
    transition: transform 0.3s ease;
}

.certification-card:hover {
    transform: scale(1.05);
}

.certification-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 10px;
}





/* عنوان Projects خارج از مستطیل */
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
}

/* استایل کلی پروژه‌ها */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

/* کارت پروژه */
.project-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* محتوای داخل کارت از بالا شروع شود */
    align-items: center;
    padding: 20px;
    border-radius: 10px;
    width: 300px; /* عرض یکسان */
    height: 390px; /* ارتفاع یکسان */
    background: #2c2c2c;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* افکت هاور کارت پروژه */
.project-card:hover {
    transform: translateY(-5px); /* به آرامی کمی به بالا بیاید */
    box-shadow: 0 8px 20px rgba(255, 94, 0, 0.7);
}

/* عنوان پروژه */
.project-card h3 {
    font-size: 20px;
    font-weight: bold;
    color: #ff6b00;
    min-height: 40px; /* کم کردن ارتفاع عنوان */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px; /* کاهش فاصله بین عنوان و توضیحات */
}


.project-card img {
    width: 100%;
    height: 180px; /* ارتفاع ثابت برای تصاویر */
    object-fit: cover; /* جلوگیری از تغییر شکل */
    border-radius: 10px;
}

/* دکمه‌های پروژه */
.project-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: auto; /* چسباندن دکمه‌ها به انتهای کارت */
}


/* توضیحات پروژه */

.project-card p {
    flex-grow: 1; /* باعث می‌شود توضیحات فضای خالی را پر کند */
    text-align: center;
    padding: 5px 0; /* کاهش فاصله بالا و پایین */
    margin: 0; /* حذف فاصله اضافی */
}



.btn {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s, transform 0.2s;
}

/* دکمه GitHub */
.btn.github {
    background: #333;
    color: white;
}

.btn.github:hover {
    background: #222;
    transform: scale(1.05);
}

/* دکمه Live Demo */
.btn.demo {
    background: #ff6b00;
    color: white;
}

.btn.demo:hover {
    background: #e65c00;
    transform: scale(1.05);
}

.project-card img {
    width: 100%;  /* عرض تصاویر به اندازه کارت */
    height: 200px; /* ارتفاع یکسان برای همه تصاویر */
    object-fit: cover; /* حفظ تناسب تصویر و برش اضافی */
    border-radius: 10px; /* گرد کردن گوشه‌ها */
}
.project-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(255, 94, 0, 0.7);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}


@media (max-width: 768px) {


.project-card {
        width: 90%; /* افزایش عرض کارت‌های پروژه */
        max-width: 600px; /* جلوگیری از بیش از حد بزرگ شدن */
        padding: 20px;
    }

    .project-card img {
        height: 220px; /* افزایش ارتفاع تصاویر */
    }
    .project-card h3 {
        font-size: 18px; /* کاهش سایز عنوان */
        text-align: center; /* وسط چین کردن عنوان */
        white-space: nowrap; /* جلوگیری از شکستگی متن */
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .project-card p {
        font-size: 14px; /* کوچک‌تر کردن متن توضیحات */
        text-align: center; /* وسط چین کردن متن */
        padding: 5px 10px;
    }
}







/* Contact Section */
#contact {
    background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
    padding: 40px 20px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.5);
    max-width: 850px;
    margin: auto;
    margin-bottom: 50px; /* فاصله مناسب از فوتر */
}
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
}
.contact-info {
    font-size: 18px;
}

.contact-info p {
    margin: 10px 0;
}

.contact-info i {
    color: #ff6b00;
    margin-right: 8px;
}


.email-link, 
.email-link:visited, 
.email-link:active {
    color: white !important; /* تنظیم رنگ سفید در همه حالت‌ها */
    text-decoration: none !important; /* حذف خط زیر لینک */
    font-weight: bold;
    transition: color 0.3s ease-in-out;
}

/* تغییر رنگ هنگام هاور */
.email-link:hover {
    color: #f4a261 !important; /* رنگ نارنجی هنگام هاور */
    text-decoration: underline !important;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .contact-info {
        text-align: center;
    }
}











/* Footer */
footer {
    background: #222;
    color: white;
    padding: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    footer {
        padding: 15px;
        font-size: 14px;
    }
}






/* From Uiverse.io - Terminal Loader */
@keyframes blinkCursor {
  50% {
    border-right-color: transparent;
  }
}

@keyframes typeAndDelete {
  0%,
  10% {
    width: 0;
  }
  45%,
  55% {
    width: 6.2em;
  } 
  90%,
  100% {
    width: 0;
  }
}

/* انیمیشن محو شدن کل صفحه لودینگ */
@keyframes fullScreenFadeOut {
  0% {
    opacity: 1;
    filter: blur(0px);
  }
  50% {
    opacity: 0.6;
    filter: blur(3px);
  }
  100% {
    opacity: 0;
    filter: blur(10px);
  }
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 1s ease-in-out;
}

/* افکت باران کد هکری */
#matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
}

/* استایل باکس لودینگ */
.terminal-loader {
  border: 0.1em solid #333;
  background-color: #1a1a1a;
  color: #0f0;
  font-family: "Courier New", Courier, monospace;
  font-size: 1em;
  padding: 1.5em 1em;
  width: 12em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 9999;
}

.terminal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background-color: #333;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  padding: 0 0.4em;
  box-sizing: border-box;
}

.terminal-controls {
  float: right;
}

.control {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.4em;
  border-radius: 50%;
  background-color: #777;
}

.control.close {
  background-color: #e33;
}

.control.minimize {
  background-color: #ee0;
}

.control.maximize {
  background-color: #0b0;
}

.terminal-title {
  float: left;
  line-height: 1.5em;
  color: #eee;
}

.text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 0.2em solid green;
  animation:
    typeAndDelete 4s steps(11) infinite,
    blinkCursor 0.5s step-end infinite alternate;
  margin-top: 1.5em;
}

/* اجرای انیمیشن محو شدن برای کل صفحه */
.hidden {
  animation: fullScreenFadeOut 1s ease-in-out forwards;
}












/* Improved pop-up styling */
#popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.95);
    padding: 25px;
    width: 370px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.3);
    text-align: center;
    color: white;
    z-index: 10000;
    display: none; /* Initially hidden */
    animation: fadeIn 0.3s ease-in-out;
    border: 1px solid cyan;
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Pop-up content */
.popup-content {
    padding: 20px;
}

/* Headline */
#popup h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: cyan;
}

/* Privacy assurance text */
#popup p {
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;
}

/* Hand scroll activation button */
#activateHandScrollBtn {
    background: cyan;
    color: black;
    font-size: 16px;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    display: inline-block; /* Ensure visibility */
    margin-top: 15px;
}

#activateHandScrollBtn:hover {
    background: #00bcd4;
    transform: scale(1.1);
}

/* Close button */
#closePopupBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.3s;
}

#closePopupBtn:hover {
    color: red;
}


/* Floating Hand Scroll Button with Animated Gradient */
#handScrollBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #00c3ff, #0082ff, #00c3ff);
    background-size: 200% 200%;
    color: white;
    font-size: 16px;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0px 4px 10px rgba(0, 132, 255, 0.5);
    transition: all 0.3s ease-in-out;
    z-index: 9999;
    animation: moveGradient 3s infinite alternate;
}

/* Hover effect */
#handScrollBtn:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 15px rgba(0, 195, 255, 0.8);
}
@media (max-width: 768px) {
    #handScrollBtn {
        font-size: 14px;  /* کاهش سایز فونت */
        padding: 8px 14px; /* کاهش پدینگ */
        bottom: 15px;
        right: 15px;
    }
}
/* Moving gradient animation */
@keyframes moveGradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Responsive Popup for Mobile */
@media (max-width: 480px) {
    #popup {
        width: 80%;
        padding: 18px;
        max-width: 280px; /* Reduced width */
        border-radius: 10px;
    }

    #popup h2 {
        font-size: 16px;
    }

    #popup p {
        font-size: 13px;
    }

    #activateHandScrollBtn {
        font-size: 13px;
        padding: 8px 12px;
    }
}




/* Adjust webcam preview position */
#webcamCanvas {
    position: fixed;
    top: 70px; /* Adjust for header */
    right: 20px; /* Stick to right side */
    width: 250px;
    height: 180px;
    border: 2px solid cyan;
    z-index: 9999;
}




/* Floating Language Switcher - Improved */
.floating-language-switcher {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 9999;
    transition: all 0.3s ease;
}

.floating-language-switcher a {
    display: block;
    background: none;
    padding: 0;
}

.floating-language-switcher img {
    width: 40px;  /* اندازه بزرگتر */
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;  /* حاشیه سفید نازک */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    object-fit: cover;
}

.floating-language-switcher:hover img {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}