/* استایل کلی صفحه */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    text-align: center;
}

.navbar {
    font-size: 20px;
    font-weight: bold;
    background-color: #2c3e50;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
}
.navbar .logo {
    font-size: 20px;
    font-weight: bold;
}
.navbar ul {
    list-style: none;
    display: flex;
    align-items: center;
}
.navbar ul li {
    margin: 0 15px;
    position: relative;
}
/* فقط آیتم‌هایی که بعد از آیتمی دیگه میان */
.navbar ul li + li::before {
    content: "";
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background-color: white;
}
.navbar ul li a {
    color: white;
    text-decoration: none;
    transition: 0.3s;
}
.navbar ul li a:hover {
    color: #f39c12;
}
.menu-toggle {
    display: none;
    cursor: pointer;
}
.menu-toggle div {
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px;
}

@media (max-width: 768px) {
    .navbar ul {
        display: none;
        flex-direction: column;
        background: #2c3e50;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        text-align: center;
    }
    .navbar ul.show {
        display: flex;
    }
    .menu-toggle {
        display: block;
    }
    .navbar ul li:not(:last-child)::after {
        display: none;
    }
}


/* جعبه اصلی */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

/* عنوان */
h1 {
    color: #333;
}

/* فرم */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    
}

/* ورودی‌ها */
input[type="url"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    font-style: bold;
    text-align: right;
    width: 95%;
    margin: auto;
}

/* دکمه */
/* استایل برای تبلیغات */
.ad-container {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ad-item {
    background-color: #fff;
    padding: 10px;
}

.ad-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.ad-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ad-item h3 {
    font-size: 16px;
    margin: 10px 0;
}

.price-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    margin-left: 10px;
    font-size: 14px;
}

.new-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

.discount-badge {
    background-color: #e74c3c;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.empty-ad {
    padding: 30px;
    text-align: center;
    color: #999;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
}
/* اسلایدر تبلیغات */
.ad-slider {
    position: relative;
    width: 100%;
    height: 160px; /* ارتفاع ثابت برای اسلایدر */
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 3px;
}

.ad-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: none;
    padding: 2px;
    box-sizing: border-box;
}

.ad-slide.active {
    opacity: 1;
    display: block;
}

.ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px;
    border: 1px solid #f0f0f0;
}

/*Price-ads*/
.price-box {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #eee;
    border-radius: 16px;
    background: #fdfdfd;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
  }

  .old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 10px;
    display: block;
  }

  .new-price {
    font-size: 14px;
    color: #d32f2f;
    font-weight: bold;
  }

  .discount-badge {
    background-color: #ffdddd;
    color: #d32f2f;
    padding: 2px 5px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 10px;
    display: inline-block;
  }





/* Responsive adjustments */
@media (max-width: 992px) {
    .page-wrapper {
        flex-direction: column;
        display: flex;
    }
    
    .main-content {
        order: -1; /* نمایش محتوای اصلی در ابتدا - فقط در حالت موبایل */
        max-width: 100%;
        margin: 0 0 20px 0;
    }
    
    .left-sidebar, .right-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin: 0 0 20px 0;
    }
    
    .left-sidebar .ad-banner, .right-sidebar .ad-banner {
        width: calc(50% - 10px);
    }
    
    /* تنظیم ارتفاع اسلایدر برای نمایش بهتر در تبلت */
    .ad-slider {
        height: 140px;
    }
    
    .ad-slide img {
        object-fit: contain; /* نمایش کامل تصویر بدون برش */
    }
}

@media (max-width: 576px) {
    .left-sidebar .ad-banner, .right-sidebar .ad-banner {
        width: 100%;
    }
    
    /* تنظیم ارتفاع اسلایدر برای نمایش بهتر در موبایل */
    .ad-slider {
        height: 120px;
    }
}





/* اضافه کردن استایل برای جدول در داشبورد */
table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

/* بهبود نمایش سلول‌های جدول */
td, th {
    padding: 8px;
    word-break: break-word;
}

/* استایل برای سلول‌های حاوی لینک‌های طولانی */
td:first-child {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}


      /* استایل برای صفحه‌بندی */
      .pagination {
        display: flex;
        justify-content: center;
        margin: 20px 0;
        padding: 0;
        list-style: none;
    }
    
    .pagination li {
        margin: 0 5px;
    }
    
    .pagination a, .pagination span {
        display: inline-block;
        padding: 8px 12px;
        text-decoration: none;
        border: 1px solid #ddd;
        color: #333;
        border-radius: 4px;
    }
    
    .pagination a:hover {
        background-color: #f5f5f5;
    }
    
    .pagination .active span {
        background-color: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .pagination .disabled span {
        color: #ccc;
        cursor: not-allowed;
    }
    
    /* استایل برای اطلاعات صفحه‌بندی */
    .pagination-info {
        text-align: center;
        margin-top: 15px;
        color: #666;
        font-size: 14px;
    }
    
    /* استایل برای بخش انتخاب */
    .section-selector {
        margin: 20px 0;
        text-align: center;
    }
    
    .section-selector label {
        margin: 0 15px;
        cursor: pointer;
    }
    
    .section-selector input[type="radio"] {
        margin-left: 5px;
    }
    
    /* استایل برای بخش فعال */
    .section {
        display: none;
    }
    
    .section.active {
        display: block;
    }
    
    /* استایل برای هشدار */
    .alert {
        background-color: #f8d7da;
        color: #721c24;
        padding: 10px;
        border-radius: 4px;
        margin-bottom: 20px;
    }

/* صفحه افزودن تبلیغ*/
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-check {
    margin-top: 10px;
}

.btn-container {
    margin-top: 20px;
}

.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.success {
    background-color: #d4edda;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
}


/* استایل برای تبلیغات */
.ad-banner {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.ad-slider {
    position: relative;
    overflow: hidden;
    height: 200px; /* ارتفاع استاندارد برای همه تصاویر */
}

.ad-slide {
    display: none;
    width: 100%;
    height: 100%;
}

.ad-slide.active {
    display: block;
}

.ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* برای حفظ نسبت تصویر و پر کردن فضا */
}

.ad-content {
    padding: 15px;
}

.ad-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.price-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    margin-left: 10px;
    font-size: 14px;
}

.new-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

.discount-badge {
    background-color: #e74c3c;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 10px;
}

.ad-link {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 5px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.ad-link:hover {
    background-color: #45a049;
}
/* ریست استایل‌ها */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    direction: rtl;
    text-align: right;
}

/* منوی بالا */
header {
    background-color: #2c3e50;
    padding: 20px 0;
}

.navbar {
    display: flex;
    justify-content: center;
}

.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

.navbar ul li {
    margin: 0 15px;
    position: relative;
}

.navbar ul li + li::before {
    content: "";
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background-color: white;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

.navbar ul li a:hover {
    color: #f39c12;
}

/* ساختار اصلی - اصلاح شده برای تناسب بهتر */
.wrapper {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.main-content {
    flex: 3; /* افزایش نسبت محتوای اصلی از 2 به 3 */
    margin: 0 20px;
}

.right-ads, .left-ads {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 180px; /* کاهش حداقل عرض سایدبارها از 200px به 180px */
    max-width: 220px; /* اضافه کردن حداکثر عرض برای سایدبارها */
}

/* باکس کوتاه‌کننده لینک */
.shortener-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
}

.title {
    margin-bottom: 20px;
}

.shortener-box form {
    display: flex;
    margin-bottom: 15px;
}

.shortener-box input[type="url"] {
    flex: 1;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    text-align: right;
}

.btn-shorten {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 15px; /* کاهش پدینگ افقی از 20px به 15px */
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease; /* اضافه کردن انیمیشن برای هاور */
    width: auto; /* عرض خودکار بر اساس محتوا */
    min-width: 120px; /* حداقل عرض */
}

.btn-shorten:hover {
    background-color: #219653; /* تغییر رنگ پس‌زمینه در حالت هاور */
    transform: translateY(-2px); /* حرکت کمی به بالا در حالت هاور */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* اضافه کردن سایه در حالت هاور */
}

.result-message {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.short-url-container {
    display: flex;
    margin-top: 15px;
}

.short-url-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.btn-copy {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* استایل تبلیغات - بازنویسی شده */
.ad-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 12px; /* کاهش پدینگ از 15px به 12px */
    text-align: center;
    margin-bottom: 15px;
}

.ad-box h3 {
    margin-bottom: 8px;
    font-size: 14px; /* کاهش اندازه فونت از 16px به 14px */
}

.ad-box img {
    width: 100%;
    max-height: 160px; /* کاهش حداکثر ارتفاع تصاویر از 200px به 160px */
    object-fit: contain;
    margin-bottom: 8px;
}

.price-info {
    margin: 10px 0;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    display: block;
    margin-bottom: 5px;
}

.new-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

.discount-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 5px 0;
}

.ad-link {
    display: inline-block;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 4px;
    margin-top: 10px;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }
    
    .main-content {
        order: 1; /* تغییر ترتیب نمایش */
        margin: 0 0 20px 0;
    }
    
    .right-ads {
        order: 2;
    }
    
    .left-ads {
        order: 3;
    }
    
    .shortener-box form {
        flex-direction: column;
    }
    
    .shortener-box input[type="url"] {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .btn-shorten {
        border-radius: 4px;
    }
}

/* حفظ سایر استایل‌های مورد نیاز */
/* استایل برای صفحه‌بندی */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.pagination li {
    margin: 0 5px;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #333;
    border-radius: 4px;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .active span {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .disabled span {
    color: #ccc;
    cursor: not-allowed;
}

/* استایل برای اطلاعات صفحه‌بندی */
.pagination-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* استایل برای بخش انتخاب */
.section-selector {
    margin: 20px 0;
    text-align: center;
}

.section-selector label {
    margin: 0 15px;
    cursor: pointer;
}

.section-selector input[type="radio"] {
    margin-left: 5px;
}

/* استایل برای بخش فعال */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* استایل برای هشدار */
.alert {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* صفحه افزودن تبلیغ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-check {
    margin-top: 10px;
}

.btn-container {
    margin-top: 20px;
}

.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.success {
    background-color: #d4edda;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* اضافه کردن استایل برای جدول در داشبورد */
table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

/* بهبود نمایش سلول‌های جدول */
td, th {
    padding: 8px;
    word-break: break-word;
}

/* استایل برای سلول‌های حاوی لینک‌های طولانی */
td:first-child {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* صفحه لوگین ادمین*/

.login-form {
    width: 300px; /* عرض فرم */
    margin: 50px auto; /* قرار دادن فرم در مرکز صفحه */
    padding: 20px;
    border: 1px solid #ccc; /* یک حاشیه خاکستری روشن */
    border-radius: 5px; /* گوشه‌های گرد */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* سایه ملایم */
    background-color: #f9f9f9; /* پس‌زمینه فرم */
    font-family: sans-serif; /* فونت ساده */
}

/* گروه هر فیلد (برچسب و ورودی) */
.login-form-group {
    margin-bottom: 15px; /* فاصله زیر هر گروه */
}

/* استایل‌دهی به فیلدهای ورودی (username و password) */
.login-form-input {
    width: 100%;
    padding: 10px;
    margin-top: 5px; /* فاصله بین برچسب و ورودی */
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box; /* اطمینان از اینکه padding و border به عرض اضافه نشوند */
}

/* استایل‌دهی به دکمه */
.login-form-button {
    width: 100%;
    padding: 10px;
    background-color: #5cb85c; /* رنگ سبز برای دکمه */
    color: white; /* متن سفید */
    border: none;
    border-radius: 3px;
    cursor: pointer; /* نشانگر ماوس به شکل دست */
    font-size: 16px;
    transition: background-color 0.3s ease; /* انیمیشن برای تغییر رنگ */
}

/* افکت Hover برای دکمه */
.login-form-button:hover {
    background-color: #4cae4c; /* سبز کمی تیره‌تر هنگام نگه داشتن ماوس */
}