/* Import Vazir font */
@font-face {
    font-family: Vazir;
    src: url('../fonts/Vazir-Regular.eot');
    src: url('../fonts/Vazir-Regular.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir-Regular.woff2') format('woff2'),
         url('../fonts/Vazir-Regular.woff') format('woff'),
         url('../fonts/Vazir-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: Vazir;
    src: url('../fonts/Vazir-Bold.eot');
    src: url('../fonts/Vazir-Bold.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir-Bold.woff2') format('woff2'),
         url('../fonts/Vazir-Bold.woff') format('woff'),
         url('../fonts/Vazir-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: Vazir;
    src: url('../fonts/Vazir-Black.eot');
    src: url('../fonts/Vazir-Black.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir-Black.woff2') format('woff2'),
         url('../fonts/Vazir-Black.woff') format('woff'),
         url('../fonts/Vazir-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}
@font-face {
    font-family: Vazir;
    src: url('../fonts/Vazir-Medium.eot');
    src: url('../fonts/Vazir-Medium.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir-Medium.woff2') format('woff2'),
         url('../fonts/Vazir-Medium.woff') format('woff'),
         url('../fonts/Vazir-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: Vazir;
    src: url('../fonts/Vazir-Light.eot');
    src: url('../fonts/Vazir-Light.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir-Light.woff2') format('woff2'),
         url('../fonts/Vazir-Light.woff') format('woff'),
         url('../fonts/Vazir-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: Vazir;
    src: url('../fonts/Vazir-Thin.eot');
    src: url('../fonts/Vazir-Thin.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir-Thin.woff2') format('woff2'),
         url('../fonts/Vazir-Thin.woff') format('woff'),
         url('../fonts/Vazir-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
}

body {
  direction: rtl;
  text-align: right;
  font-family: 'Vazir', sans-serif;
}

.sidebar {
    width: 250px;
    min-width: 250px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Custom Sidebar Styles */
.sidebar-nav .nav-link {
    border-radius: .25rem;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-nav .nav-link:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .collapse .nav-link {
    font-size: 0.9em;
}

.sidebar-nav .arrow-icon {
    transition: transform 0.3s ease;
}

/* Rotate arrow when dropdown is open (not collapsed) */
.sidebar-nav a[data-bs-toggle="collapse"]:not(.collapsed) .arrow-icon {
    transform: rotate(180deg);
}

/* Animation for scraping status modal */
.status-icon {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}
.status-icon.fade-in {
    opacity: 1;
}

/* Frosted glass effect for modal backdrop */
.modal-backdrop-blur {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Custom style for scraping status modal items */
.modal-status-item {
    font-size: 0.95rem; /* Slightly smaller font */
    font-weight: 500;   /* Medium font weight */
}

/* Modern status modal style */
.modal-status-content {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
}

/* Smaller font for product table */
.table-products {
    font-size: 0.9rem;
}

/* --- استایل برای کارت‌های انتخاب روش افزودن هوشمند --- */
.smart-insert-option {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.smart-insert-option:hover {
    transform: translateY(-5px);
    box-shadow: var(--bs-box-shadow);
}

.fade-in-status {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- استایل برای کارت‌های محصولات در صفحه افزودن گروهی --- */
.product-card {
    position: relative;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    border: 1px solid var(--bs-border-color-translucent); /* افزودن بوردر طوسی کمرنگ پیش‌فرض */
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--bs-box-shadow);
}
.product-card.is-duplicate {
    background-color: var(--bs-gray-200); /* کمی تیره‌تر برای وضوح بیشتر */
    cursor: default; /* تغییر نشانگر موس به حالت پیش‌فرض */
    opacity: 0.5; /* کم‌رنگ‌تر کردن بیشتر */
    cursor: not-allowed; /* تغییر نشانگر موس به حالت غیرمجاز */
    opacity: 0.6; /* کم‌رنگ‌تر کردن */
}
.product-card.is-duplicate:hover {
    transform: none; /* حذف افکت هاور */
    box-shadow: none; /* حذف افکت هاور */
}
.product-card.is-selected {
    background-color: var(--bs-primary-bg-subtle); /* تغییر رنگ پس‌زمینه کارت */
    border-color: var(--bs-primary-border-subtle); /* تغییر رنگ حاشیه */
    transform: scale(1.02); /* کمی بزرگنمایی برای تاکید */
}
.product-card .card-img-top {
    height: 150px; /* کاهش ارتفاع تصویر */
    object-fit: contain;
    padding: 0.5rem;
}
.product-card-title {
    font-size: 0.85rem; /* کمی بزرگ‌تر کردن فونت عنوان */
    line-height: 1.4;
    font-weight: 500; /* استفاده از وزن متوسط فونت وزیر */
}
.product-card-checkbox {
    display: none; /* مخفی کردن چک‌باکس */
}

/* --- استایل برای نوار شناور افزودن محصول --- */
.floating-import-bar {
    position: fixed;
    bottom: 1rem; /* فاصله از پایین */
    left: 50%; /* در مرکز افقی قرار بگیرد */
    transform: translateX(-50%); /* تنظیم دقیق مرکزیت */
    width: 95%;
    max-width: 800px; /* حداکثر عرض برای صفحات بزرگ */
    height: 80px;
    background-color: #3c3c3c; /* Dark background */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 1040; /* Below modals */
    border-radius: 1rem; /* گرد کردن گوشه‌ها */
    animation: slide-up 0.3s forwards ease-out;
}
@keyframes slide-up {
    from { transform: translate(-50%, 150%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* --- استایل برای جدول نتایج افزودن گروهی --- */
.table-results {
    font-size: 0.85rem;
}

/* --- Page Builder Styles --- */
.page-builder-container {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 200px); /* Adjust height based on your header/footer */
}

.page-builder-sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #fff;
    border-radius: var(--bs-card-border-radius);
    border: 1px solid var(--bs-card-border-color);
    padding: 1rem;
    overflow-y: auto;
}

.page-builder-canvas {
    flex-grow: 1;
    background-color: #fff;
    border-radius: var(--bs-card-border-radius);
    border: 1px solid var(--bs-card-border-color);
    padding: 1.5rem;
    overflow-y: auto;
    background-image: radial-gradient(var(--bs-gray-300) 1px, transparent 1px);
    background-size: 15px 15px;
}

.builder-block {
    background-color: var(--bs-gray-100);
    border: 1px solid var(--bs-gray-300);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    cursor: grab;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    min-height: 90px;
}
.builder-block:hover {
    background-color: var(--bs-gray-200);
}
.builder-block i {
    margin-left: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--bs-secondary);
}

.page-builder-sidebar .builder-block i {
    font-size: 1.8rem;
    margin-left: 0;
    margin-bottom: 0.5rem;
}
.page-builder-sidebar .builder-block span {
    font-size: 0.75rem;
    line-height: 1.2;
}

.page-builder-sidebar .builder-block {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.25rem;
    gap: 0.25rem;
    min-height: 100px;
}

.empty-placeholder {
    min-height: 150px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #888;
    margin: 20px;
    background-color: #f8f9fa;
}

.empty-placeholder-content {
    padding: 20px;
}

#add-block-modal-content .builder-block {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 110px;
    text-align: center;
    gap: 0.5rem;
}

.canvas-element {
    background-color: #fff;
    border: 1px dashed var(--bs-primary);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    position: relative;
    cursor: grab;
}

.canvas-element-toolbar {
    position: absolute;
    top: -15px;
    display: flex;
    gap: 5px;
    background-color: #fff;
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid var(--bs-gray-300);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10;
}

.canvas-element:hover .canvas-element-toolbar {
    opacity: 1;
    visibility: visible;
}

.canvas-element-toolbar .btn {
    width: 30px;
    height: 30px;
}

/* --- Page Builder Grid System --- */
.builder-section {
    border: 2px dashed var(--bs-gray-400);
    padding: 1rem;
    background-color: rgba(0,0,0,0.02);
    position: relative;
}

.builder-section > .row {
    min-height: 100px; /* Ensure row has height for dropping */
}

.builder-column {
    border: 1px dashed var(--bs-gray-300);
    padding: 1rem;
    min-height: 80px; /* Minimum height for empty columns */
    background-color: rgba(255,255,255,0.5);
}

.builder-column {
    position: relative; /* Needed for positioning the toolbar */
    display: flex; /* Enable flexbox for vertical alignment */
    flex-direction: column; /* Stack content blocks vertically */
}

.builder-column-toolbar {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    gap: 5px;
    background-color: #fff;
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--bs-gray-300);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 11; /* Higher than section toolbar */
}

.builder-column:hover .builder-column-toolbar {
    opacity: 1;
    visibility: visible;
}
.builder-column-toolbar .btn {
    width: 24px; height: 24px; font-size: 0.75rem;
}

.builder-column.sortable-ghost {
    background-color: var(--bs-primary-bg-subtle);
    opacity: 0.5;
}

.builder-section-toolbar {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bs-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    z-index: 10;
    cursor: grab;
}

.builder-section-toolbar .dropdown-toggle::after {
    /* Hide default bootstrap arrow for a cleaner look */
    display: none;
}

.builder-section-wrapper {
    /* This wrapper will handle the margin */
    margin-bottom: 1.5rem;
}
.builder-section.has-bg {
    /* Remove the dashed border when a background color is set */
    border: 1px solid var(--bs-border-color);
}

/* --- Page Builder Fullscreen Mode --- */
.builder-mode .main-layout {
    grid-template-columns: 1fr; /* Remove main sidebar */
}
.builder-mode .content-wrapper {
    padding-bottom: 60px; /* Space for the new footer bar */
}

.page-builder-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #2c3338;
    color: #a7aaaf;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1050;
    border-top: 1px solid #4f5962;
}

.page-builder-footer .btn {
    font-weight: bold;
}
.page-builder-footer .footer-icons .btn {
    color: #a7aaaf;
}
.page-builder-footer .footer-icons .btn:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.block-settings-form-group {
    border-bottom: 1px solid var(--bs-border-color);
}

.image-upload-preview {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: var(--bs-gray-200);
    border: 1px solid var(--bs-border-color);
}

.image-upload-container {
    position: relative;
}
.image-upload-container .spinner-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.canvas-element-content hr {
    margin: 1rem 0;
    opacity: 0.75; /* Make it more visible than default Bootstrap hr */
}

.spacer-block-visual {
    width: 100%;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(0, 0, 0, 0.05),
        rgba(0, 0, 0, 0.05) 10px,
        rgba(0, 0, 0, 0.08) 10px,
        rgba(0, 0, 0, 0.08) 20px
    );
    border: 1px dashed var(--bs-gray-400);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-gray-600);
    font-size: 0.8rem;
    transition: height 0.2s ease-in-out;
}

/* Timeline Preview Styles */
.timeline-preview {
    position: relative;
    padding-right: 30px;
    border-right: 3px solid var(--bs-gray-300);
}
.timeline-item-preview {
    position: relative;
    margin-bottom: 20px;
}
.timeline-dot {
    position: absolute;
    right: -16.5px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    border: 2px solid #fff;
}
.timeline-content-preview {
    padding-right: 15px;
}
.timeline-date-preview {
    font-size: 0.8rem;
    color: var(--bs-gray-600);
}

/* Logo Slider Preview Styles */
.logo-slider-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}
.logo-preview-item img {
    max-height: 40px;
    max-width: 100px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Final Logo Slider Styles */
.logo-slider .swiper-slide {
    text-align: center;
}
.logo-slider .swiper-slide img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s, opacity 0.3s;
}
.logo-slider .swiper-slide:hover img {
    filter: grayscale(0%);
    opacity: 1;
}
