/* Navigation button for map open */
.grd-map-cta-wrapper { margin-top: 16px; }
.grd-nav-btn {
	display: inline-block;
	padding: 10px 16px;
	border-radius: 8px;
	background: #1a73e8;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	transition: background .2s ease, transform .1s ease;
}
.grd-nav-btn:hover { background: #1558b0; }
.grd-nav-btn:active { transform: translateY(1px); }
/* -------------------------------
   سبک کلی داشبورد (container)
--------------------------------- */
.grd-dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    background: #1f2329;
    box-shadow: 0 2px 14px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* -------------------------------
   بخش بالایی (Header) - خوش‌آمدگویی
--------------------------------- */
.grd-dashboard-header {
    background: linear-gradient(135deg, #2d2f36, #3a3d45);
    color: #e5e7eb;
    padding: 20px;
    text-align: center;
    position: relative;
}

.grd-dashboard-header h2 {
    margin: 0;
    font-size: 28px;
}

.grd-dashboard-header p {
    margin: 5px 0 0;
    font-size: 16px;
}

/* دکمه خروج بالا سمت چپ */
.grd-dashboard-header .logout-section {
    position: absolute;
    top: 15px;
    left: 15px;
}

.grd-dashboard-header .logout-section a {
    background: linear-gradient(90deg,#b23b3b,#8c2f2f);
    color: #f3f4f6;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}
.grd-dashboard-header .logout-section a:hover {
    transform: scale(1.05);
}

/* -------------------------------
   ساختار بدنه داشبورد
--------------------------------- */
.grd-dashboard-body {
    display: flex;
    min-height: 400px;
}

/* منوی تب‌ها - ستون عمودی */
.grd-dashboard-menu {
    width: 250px;
    background: #2a2d33;
    border-right: 1px solid #3a3f47;
}

.grd-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.grd-tab-link {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #3a3f47;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    color: #d1d5db;
    text-align: center;
    font-weight: 500;
}

.grd-tab-link:hover {
    background-color: #343841;
}

.grd-tab-link.active {
    background-color: #6b7280;
    color: #111827;
}

/* محتوای تب‌ها */
.grd-dashboard-content {
    flex: 1;
    padding: 20px;
    background: #1f2329;
    color: #e5e7eb;
}

.grd-tab-content {
    display: none;
}

.grd-tab-content.active {
    display: block;
}

/* -------------------------------
   جدول آگهی‌ها
--------------------------------- */
.user-ads-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.user-ads-table thead {
    background-color: #2f333a;
    color: #e5e7eb;
}

.user-ads-table th, .user-ads-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #3a3f47;
}

.user-ads-table tr:nth-child(even) {
    background-color: #23262c;
}

.ad-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #3a3f47;
}

/* -------------------------------
   دکمه‌های ویرایش و حذف
--------------------------------- */
.btn-edit, .btn-delete {
	display: inline-block;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 14px;
	text-decoration: none;
	font-weight: bold;
	text-transform: uppercase;
	transition: all 0.3s ease-in-out;
	cursor: pointer;
	border: 2px solid transparent;
}

.btn-edit {
    background-color: #4b5563;
    color: #f3f4f6;
    border-color: #3f4852;
}

.btn-edit:hover {
    background-color: transparent;
    color: #cbd5e1;
    border-color: #6b7280;
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
}

.btn-delete {
    background-color: #a85555;
    color: #f3f4f6;
    border-color: #924444;
}

.btn-delete:hover {
    background-color: transparent;
    color: #f2b3b3;
    border-color: #a85555;
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
}

/* -------------------------------
   فرم OTP (ورود و تأیید)
--------------------------------- */
.otp-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.otp-card {
    background-color: #1e1e1e;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.otp-card h3 {
    margin-bottom: 1rem;
    color: #4cafef;
}

.otp-card p {
    margin-bottom: 1.5rem;
    font-size: 14px;
    color: #ccc;
}

.otp-card input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: #fff;
    margin-bottom: 1rem;
    font-size: 16px;
    text-align: center;
    letter-spacing: 4px;
}

.otp-card button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #4cafef, #007bff);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.otp-card button:hover {
    transform: scale(1.03);
    background: linear-gradient(90deg, #5fd1ff, #0a84ff);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------
   📱 حالت واکنش‌گرا (Responsive)
--------------------------------- */

/* 📱 تبلت‌ها */
@media (max-width: 992px) {
    .grd-dashboard-body {
        flex-direction: column;
    }
    .grd-dashboard-menu {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #1f2a3a;
    }
    .grd-tabs {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
    .grd-tab-link {
        flex: 1 1 33%;
        border-bottom: none;
        border-right: 1px solid #1f2a3a;
    }
}

/* 📱 گوشی‌ها */
@media (max-width: 600px) {
    .grd-dashboard-header h2 {
        font-size: 22px;
    }
    .grd-dashboard-header p {
        font-size: 14px;
    }
    .grd-dashboard-menu {
        display: block;
        width: 100%;
    }
    .grd-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
        scrollbar-color: #6b7280 transparent;
    }
    .grd-tab-link {
        display: inline-block;
        min-width: 150px;
        text-align: center;
        border: none;
        margin: 5px;
        border-radius: 8px;
        background: #2a2d33;
        color: #d1d5db;
    }
    .grd-dashboard-content {
        padding: 15px;
        background: #1f2329;
        color: #e5e7eb;
    }

    /* جدول آگهی‌ها به حالت کارت تبدیل می‌شود */
    .user-ads-table thead {
        display: none;
    }
    .user-ads-table, .user-ads-table tbody, .user-ads-table tr, .user-ads-table td {
        display: block;
        width: 100%;
    }
    .user-ads-table tr {
        margin-bottom: 15px;
        background: #23262c;
        border-radius: 10px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.25);
        padding: 10px;
    }
    .user-ads-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 5px;
        border: none;
    }
    .user-ads-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #9ca3af;
    }
    .ad-thumbnail {
        width: 60px;
        height: 60px;
        border-radius: 8px;
    }
    .btn-edit, .btn-delete {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* 📱 خیلی کوچک (موبایل‌های قدیمی) */
@media (max-width: 400px) {
    .grd-tab-link {
        min-width: 120px;
        font-size: 13px;
        padding: 10px 8px;
    }
    .grd-dashboard-header .logout-section a {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {

    /* چینش کلی به حالت ستونی تغییر کند */
    .grd-dashboard-body {
        flex-direction: column;
    }

    /* منوی تب‌ها از حالت ستون عمودی خارج شود */
    .grd-dashboard-menu {
        width: 100%;
        order: 2; /* زیر هدر قرار گیرد */
        background: #0b1220;
        border: none;
        border-top: 1px solid #1f2a3a;
        border-bottom: 1px solid #1f2a3a;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
        scrollbar-color: #22c55e transparent;
    }

    /* تب‌ها در یک ردیف قرار گیرند */
    .grd-tabs {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: stretch;
        margin: 0;
        padding: 0;
        overflow-x: auto;
    }

    /* استایل تب‌ها در حالت افقی */
    .grd-tab-link {
        display: inline-block;
        flex: 0 0 auto;
        padding: 12px 18px;
        font-size: 14px;
        font-weight: 600;
        border: none;
        border-right: 1px solid #1f2a3a;
        background: #0f172a;
        color: #cbd5e1;
        text-align: center;
        transition: all 0.3s;
        border-radius: 0;
    }

    .grd-tab-link:last-child {
        border-right: none;
    }

    .grd-tab-link:hover {
        background: #162032;
    }

    .grd-tab-link.active {
        background: #22c55e;
        color: #0b1220;
    }

    /* محتوای تب‌ها زیر نوار تب‌ها */
    .grd-dashboard-content {
        order: 3;
        padding: 15px;
        background: #0f1216;
        color: #e5e7eb;
    }

    /* بهبود استایل هدر برای حالت موبایل */
    .grd-dashboard-header {
        text-align: center;
        padding: 25px 10px 50px;
        position: relative;
    }

    .grd-dashboard-header h2 {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .grd-dashboard-header p {
        font-size: 14px;
        margin-bottom: 10px;
    }

    /* دکمه خروج در حالت موبایل */
    .grd-dashboard-header .logout-section {
        top: 10px;
        left: 10px;
    }

    .grd-dashboard-header .logout-section a {
        font-size: 12px;
        padding: 6px 10px;
    }
}


/* نمایش چک‌باکس‌های فیلد دسته‌بندی به‌صورت شبکه‌ای ۷تایی */
.categories-grid .ginput_container_checkbox {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* ۷ ستون در هر ردیف */
  gap: 10px 15px; /* فاصله بین آیتم‌ها */
  justify-items: start;
}

.categories-grid .ginput_container_checkbox label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
  .categories-grid .ginput_container_checkbox {
    grid-template-columns: repeat(3, 1fr); /* در موبایل ۳ تا در هر ردیف */
  }
}