/* فونت اصلی - مطمئن شو که فایل فونت در مسیر درست قرار دارد */
@font-face {
    font-family:'iransans-web';
    src: url('fonts/iran-sans-web.eot'); /* IE9 */
    src: url('fonts/iran-sans-web.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('fonts/iran-sans-web.woff2') format('woff2'), /* Super Modern Browsers */
         url('fonts/iran-sans-web.woff') format('woff'), /* Pretty Modern Browsers */
         url('fonts/iran-sans-web.ttf') format('truetype'), /* Safari, Android, iOS */
         url('fonts/iran-sans-web.svg#svgFontName') format('svg'); /* Legacy iOS */
    font-weight: normal;
    font-style: normal;
    direction: rtl;
}

.marquee-bar {
    width: 100%;
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    color: #222;
    overflow: hidden;
    white-space: nowrap;
    padding: 12px 0;
    font-size: 17px;
    font-weight: bold;
    border-bottom: 2px solid #d35400;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.marquee-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 14s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}


body {
    margin: 0;
    padding: 0;
    font-family: 'iransans-web', sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #6dd5ed, #2193b0); /* گرادیان آبی */
    background-image: url('background.jpg'); /* تصویر پس‌زمینه */
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #fff;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* هدر سایت */
.site-header {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px); /* افکت بوکه */
    position: sticky; /* برای ثابت ماندن هدر */
    top: 0;
    z-index: 1000;
}

.site-header img {
    height: 50px;
}

.site-header h5 {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
}

/* استایل‌های منوی موبایل */
.mobile-menu-icon {
    display: none; /* به صورت پیش‌فرض مخفی است */
    cursor: pointer;
    padding: 10px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 2em; /* اندازه آیکون */
    cursor: pointer;
    line-height: 1; /* برای تنظیم بهتر ارتفاع */
}

.main-menu.mobile {
    display: none; /* منوی موبایل به صورت پیش‌فرض مخفی است */
    position: absolute;
    top: 100%; /* زیر هدر */
    left: 0;
    width: 100%;
    background: rgba(40, 40, 40, 0.95); /* پس‌زمینه تیره‌تر برای منو */
    padding: 20px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: slideDown 0.3s ease-out forwards; /* انیمیشن باز شدن */
}

.main-menu.mobile.active {
    display: block; /* نمایش داده می‌شود وقتی فعال است */
}

.main-menu.mobile ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.main-menu.mobile ul li {
    margin-bottom: 15px;
}

.main-menu.mobile ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    display: block; /* برای پوشش کل عرض */
    padding: 10px 15px;
    transition: background-color 0.3s ease;
}

.main-menu.mobile ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* استایل منوی دسکتاپ */
.main-menu.desktop {
    display: block; /* منوی دسکتاپ همیشه نمایش داده می‌شود */
}

.main-menu.desktop ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-menu.desktop ul li {
    margin-left: 25px; /* فاصله بین آیتم‌های منو */
}

.main-menu.desktop ul li:last-child {
    margin-left: 0;
}

.main-menu.desktop ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.main-menu.desktop ul li a:hover {
    color: #e0e0e0; /* رنگ کمی روشن‌تر در هاور */
}

/* انیمیشن باز شدن منو */
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* تنظیمات ریسپانسیو برای منو */
@media (max-width: 768px) {
    .mobile-menu-icon {
        display: block; /* آیکون منو در موبایل نمایش داده می‌شود */
    }
    .main-menu.desktop {
        display: none; /* منوی دسکتاپ در موبایل مخفی می‌شود */
    }
    .site-header .container {
        flex-wrap: nowrap; /* جلوگیری از چسبیدن عناصر */
        justify-content: space-between; /* برای اینکه آیکون منو سمت چپ و عنوان راست باشه */
    }
    .site-header h5 {
        order: 2; /* عنوان بعد از آیکون منو قرار می‌گیرد */
        flex-grow: 1; /* فضای بیشتری به عنوان می‌دهد */
        text-align: center; /* وسط چین کردن عنوان */
        margin-left: 40px; /* فاصله از آیکون منو */
    }
    .mobile-menu-icon {
        order: 1; /* آیکون منو در اولویت اول قرار می‌گیرد */
    }
    .site-header .container.menu-open {
        position: relative; /* برای اینکه منوی موبایل زیرش قرار بگیره */
        z-index: 1001; /* بالای منوی موبایل */
    }
}

/* اورلی (لایه روی پس‌زمینه) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* کمی تیره‌تر */
    z-index: 1;
}

/* باکس اصلی شیشه‌ای */
.glass-box {
    position: relative; /* برای قرارگیری عناصر درون آن */
    z-index: 2;
    width: 90%;
    max-width: 600px;
    margin: 50px auto; /* فاصله از بالا و پایین */
    padding: 30px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: fadeIn 1s ease-in-out;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-box h2 { /* عنوان اصلی که در HTML هست */
    font-size: 2em;
    color: #fff;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.glass-box p.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-bottom: 25px;
}

/* ورودی سفارشی */
.custom-input {
    width: calc(100% - 24px); /* با در نظر گرفتن padding */
    padding: 12px 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.custom-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.custom-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* دکمه سفارشی */
.custom-btn {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #00a2ff); /* گرادیان دکمه */
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.custom-btn:hover {
    background: linear-gradient(135deg, #00a2ff, #007bff); /* تغییر گرادیان در هاور */
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

/* استایل بهبود یافته جدول */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    overflow: hidden; /* برای گوشه‌های گرد */
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.result-table th {
    background: rgba(0,0,0,0.3);
    color: #fff;
    padding: 15px 10px;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid rgba(255,255,255,0.3); /* خط پایین هدر */
}

.result-table td {
    padding: 15px 10px;
    text-align: center;
    color: #111; /* رنگ متن تیره برای خوانایی بیشتر روی پس‌زمینه روشن */
    background: rgba(255,255,255,0.2); /* پس‌زمینه شفاف */
    border-bottom: 1px solid rgba(255,255,255,0.15); /* خط جدا کننده سطرها */
}

.result-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.35); /* رنگ کمی روشن‌تر برای سطر زوج */
}

.result-table tr:last-child td {
    border-bottom: none; /* حذف خط پایین آخرین سطر */
}

.result-table tr:hover td {
    background: rgba(0,123,255,0.35); /* هاور با رنگ آبی */
    color: #fff; /* تغییر رنگ متن در هاور */
    cursor: pointer; /* نشانگر موس */
}

/* پیام خطای سفارشی */
.alert-custom {
    background: rgba(255, 0, 0, 0.25);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    color: #ffecec;
    margin-top: 25px;
    text-align: center;
    font-size: 1.1em;
    border: 1px solid rgba(255, 0, 0, 0.4);
}

/* دکمه‌های دانلود و بازگشت */
.download-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px; /* فاصله بین دکمه‌ها */
}

.download-btn {
    display: inline-block;
    background: linear-gradient(135deg, #28a745, #218838); /* سبز برای دانلود */
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(40,167,69,0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #218838, #28a745);
    box-shadow: 0 6px 15px rgba(40,167,69,0.5);
    transform: translateY(-2px);
}

.back-btn {
    display: inline-block;
    background: linear-gradient(135deg, #6c757d, #5a6268); /* خاکستری */
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(108,117,125,0.3);
}

.back-btn:hover {
    background: linear-gradient(135deg, #5a6268, #6c757d);
    box-shadow: 0 6px 15px rgba(108,117,125,0.5);
    transform: translateY(-2px);
}

/* فوتر سایت */
.site-footer {
    margin-top: auto; /* برای چسبیدن به پایین صفحه */
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    width: 100%;
}

/* استایل‌های ریسپانسیو (برای صفحات کوچک) */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: row; /* بازگرداندن به حالت row برای مدیریت صحیح */
        align-items: center;
        flex-wrap: nowrap; /* اطمینان از عدم پیچ خوردن */
    }
    .site-header img {
        margin-bottom: 0; /* حذف مارجین پایین */
    }
    .glass-box {
        width: 95%;
        margin: 30px auto;
        padding: 20px;
    }
    .glass-box h2 { /* اصلاح h3 به h2 مطابق HTML */
        font-size: 1.7em;
    }
    .custom-btn, .download-btn, .back-btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px;
    }
    .download-buttons {
        flex-direction: column;
    }
    .result-table th, .result-table td {
        padding: 10px 5px;
        font-size: 14px;
    }
    .custom-btn, .download-btn, .back-btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px 15px; /* کمی padding عمودی بیشتر برای خوانایی */
        font-size: 14px; /* کوچک کردن فونت */
    }  
    
    /* استایل‌های جدید برای ریسپانسیو هدر */
    .site-header .container.menu-open {
        z-index: 1001; /* اطمینان از اینکه زیر منوی باز شده قرار نگیرد */
    }
    .site-header .container.menu-open .mobile-menu-icon {
       position: relative; /* برای قرارگیری دقیق */
       z-index: 1002; /* بالای همه چیز */
    }
}
