﻿@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: normal;
  src: url('fonts/woff/IRANSansX-regular.woff') format('woff'), url('fonts/woff2/IRANSansX-regular.woff2') format('woff2');
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
  transition: all 0.3s ease;
}

  ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
  }

/* برای اسکرول سایدبار */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: #ffffff;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #e2e8f0;
}

  #sidebar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
  }

/* برای اسکرول افقی در جداول */
.table-container::-webkit-scrollbar {
  height: 6px;
}

/* برای اسکرول در مودال‌ها */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

/* برای textarea ها */
textarea::-webkit-scrollbar {
  width: 6px;
}

/* برای select های چند انتخابی */
select[multiple]::-webkit-scrollbar {
  width: 6px;
}

/* برای المان‌های با کلاس custom-scroll */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

  .custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

.fixed-toast-container {
  position: fixed;
  z-index: 50;
}

.toast-fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* برای اسکرول در دارک مود */
@media (prefers-color-scheme: dark) {
  * {
    scrollbar-color: #475569 #1e293b;
  }

  ::-webkit-scrollbar-track {
    background: #1e293b;
  }

  ::-webkit-scrollbar-thumb {
    background: #475569;
  }

    ::-webkit-scrollbar-thumb:hover {
      background: #64748b;
    }
}

/* برای اسکرول در حالت rtl */
[dir="rtl"] ::-webkit-scrollbar {
  margin-left: -4px;
}

/* برای اسکرول در موبایل */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

/* برای اسکرول در صفحات طولانی */
html {
  scroll-behavior: smooth;
}

/* برای المان‌هایی که نیاز به اسکرول ندارند */
.no-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

  .no-scroll::-webkit-scrollbar {
    display: none;
  }

body {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
  font-family: IRANSansX !important;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.ss02 {
  -moz-font-feature-settings: "ss02";
  -webkit-font-feature-settings: "ss02";
  font-feature-settings: "ss02";
}

.k-grid {
  font-family: IRANSansX !important;
  border-radius: 4px !important;
}

.k-header {
  border-style: solid !important;
  border-width: 0 0 1px 1px !important;
}

.k-grid-header {
  padding-right: 0px !important;
  padding-left: 0px !important;
}

.k-grid .k-column-title {
  margin: auto !important;
}

.k-grid {
  border-radius: 1rem;
  max-width: 85vw;
  margin: 0 auto;
}

.k-grid-header {
  background: #f8fafc;
}

.k-grid td {
  border-width: 0;
  border-bottom-width: 1px;
  border-color: #e2e8f0;
}

.k-grid-header th {
  border-width: 0;
  border-bottom-width: 2px;
  border-color: #e2e8f0;
  font-weight: 600;
}

.k-grid-content tr:hover {
  background: #f8fafc;
}

/* Common Modal Styles */
.modal-backdrop {
  @apply fixed inset-0 bg-black/50 backdrop-blur-sm;
}

.modal-container {
  @apply flex items-center justify-center min-h-screen p-4;
}

.modal-content {
  @apply bg-white rounded-2xl shadow-2xl transform transition-all overflow-hidden;
}

.modal-header {
  @apply bg-gradient-to-r from-indigo-600 to-purple-600 p-6;
}


/* General Grid Styling */
.k-grid {
  border-radius: 0.75rem;
  border: 1px solid #d1d5db; /* Light gray border */
  font-family: 'IRANSans', sans-serif;
  background-color: #ffffff; /* White background */
  overflow: hidden; /* Rounded corners apply */
}

/* Header Styling */
.k-grid-header {
  background: linear-gradient(90deg, #4f46e5, #6366f1); /* Gradient background */
  color: white;
  font-weight: bold;
  border-bottom: 2px solid #d1d5db; /* Light gray divider */
}

  .k-grid-header th {
    padding: 14px 18px;
    font-size: 0.95rem;
    text-transform: uppercase;
    text-align: center;
  }

/* Row Styling */
.k-grid tbody tr {
  transition: all 0.3s ease; /* Smooth hover effect */
}

  .k-grid tbody tr:nth-child(odd) {
    background-color: #f9fafb; /* Light gray background for alternate rows */
  }

  .k-grid tbody tr:hover {
    background-color: #e5e7eb; /* Slightly darker gray on hover */
  }

.k-grid td {
  padding: 12px 18px;
  text-align: center;
  font-size: 0.9rem;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 1rem;
}

.status-active {
  background-color: #16a34a; /* Green background */
  color: white; /* White text */
}

.status-inactive {
  background-color: #dc2626; /* Red background */
  color: white; /* White text */
}

/* Command Buttons */
.k-grid .btn-edit {
  background-color: #4f46e5; /* Indigo */
  color: white;
  border-radius: 0.5rem;
  padding: 8px 12px;
}

  .k-grid .btn-edit:hover {
    background-color: #4338ca; /* Darker Indigo */
  }

.k-grid .btn-delete {
  background-color: #ef4444; /* Red */
  color: white;
  border-radius: 0.5rem;
  padding: 8px 12px;
}

  .k-grid .btn-delete:hover {
    background-color: #dc2626; /* Darker Red */
  }

/* Pagination Styling */
.k-pager-wrap {
  background-color: #f3f4f6; /* Light gray background */
  padding: 16px;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.k-pager-numbers .k-link {
  color: #4f46e5;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  margin: 0 4px;
  padding: 6px 10px;
}

.k-pager-numbers .k-state-selected {
  background-color: #4f46e5;
  color: white;
}

/* Filter Menu Styling */
.k-filter-menu {
  background-color: #ffffff;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

/* Loading Mask */
.k-loading-mask {
  background-color: rgba(255, 255, 255, 0.9);
}

/* Price Formatting */
.price-cell {
  text-align: right;
  font-weight: bold;
  color: #1f2937; /* Dark gray */
}

  .price-cell::before {
    content: "₮ ";
    font-weight: normal;
    color: #9ca3af; /* Light gray */
  }

.k-grid-filter {
  color: white !important;
}

.k-column-title {
  color: white !important;
}

.k-grid.k-grid-display-block {
  display: block;
  border-radius: 8px !important;
}

.fixed-toast-container {
  position: fixed;
  bottom: 20px; /* Adjust as needed */
  right: 20px; /* Adjust as needed */
  z-index: 1000; /* Ensure it's above other content */
}

.k-editor-toolbar-wrap .k-input:not(:-webkit-autofill) {
  padding: 0 4px;
  margin: 0 4px;
}

.form-grid {
  display: grid;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: .875rem;
  color: #4b5563;
  font-weight: 500;
}

.k-editor {
  direction: rtl;
}

  .k-editor .k-editor-content {
    height: 300px;
  }

.image-upload-container, .gallery-upload-container {
  width: 100%;
  height: 400px;
  border: 2px dashed #ccc;
  border-radius: 4px;
  padding: 10px;
  background: #f8f9fa;
  transition: .3s;
  display: flex;
  flex-direction: column;
}

.image-preview-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 4px;
  position: relative;
  margin-bottom: 10px;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-preview-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 5px;
  background: white;
  border-radius: 4px;
  margin-bottom: 10px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

.remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: #dc2626;
  transition: .2s;
  z-index: 10;
}

  .remove-image:hover {
    background: #dc2626;
    color: white;
  }

.file-input-wrapper {
  width: 100%;
}

  .file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: white;
    cursor: pointer;
  }

.drag-over {
  border-color: #3b82f6;
  background: rgba(59,130,246,.1);
}

.default-image .remove-image {
  display: none;
}

.submit-button {
  width: 100%;
  padding: .75rem 1.5rem;
  background: #3b82f6;
  color: white;
  border-radius: .5rem;
  font-weight: 500;
  transition: .2s;
}

  .submit-button:hover {
    background: #2563eb;
  }

.file-input-wrapper::after {
  content: "حداکثر 5 تصویر، هر تصویر حداکثر 10 مگابایت";
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-top: 4px;
}

.image-upload-container .file-input-wrapper::after {
  content: "حداکثر 1 تصویر، حداکثر 10 مگابایت";
}

.dropzone {
  border: 2px dashed #0087F7;
  border-radius: 5px;
  background: white;
  min-height: 150px;
  padding: 20px;
  text-align: center;
}

  /* استایل‌های جدید برای بهبود ظاهر Dropzone */
  .dropzone .dz-preview {
    margin: 10px;
  }

    .dropzone .dz-preview .dz-image {
      border-radius: 8px;
      overflow: hidden;
    }

    /* حذف نوار پیشرفت سیاه */
    .dropzone .dz-preview .dz-progress {
      display: none !important;
    }

    /* استایل دکمه حذف */
    .dropzone .dz-preview .dz-remove {
      color: #dc3545;
      text-decoration: none;
      font-weight: 500;
      margin-top: 5px;
      display: inline-block;
    }

      .dropzone .dz-preview .dz-remove:hover {
        text-decoration: underline;
      }

  /* استایل پیام پیش‌فرض */
  .dropzone .dz-message {
    color: #6c757d;
    font-size: 1.1em;
    margin: 2em 0;
  }

  /* استایل برای نمایش تصویر */
  .dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* استایل برای hover روی تصویر */
  .dropzone .dz-preview:hover .dz-image img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
  }

.main-image-preview {
  width: 100%;
  min-height: 200px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

  .main-image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
  }

.image-product {
  display: flex;
  align-items: center;
  /*justify-content: center;*/
  gap: 20px;
  margin: auto;
}

.notification-container {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000; /* Ensure it's above other elements */
}

.notification {
  background-color: #f44336; /* Red background for errors */
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 10px;
  text-align: center;
  display: none; /* Initially hidden */
  animation: slideIn 0.3s ease-out forwards, slideOut 0.3s 2s ease-in forwards;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(-50px);
    opacity: 0;
  }
}

.card {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  padding: 1.25rem;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
}

.role-tree {
  direction: rtl;
  padding: 0.5rem;
}

.k-treeview {
  font-family: 'IRANSansX' !important;
}

  .k-treeview .k-in {
    margin: 4px 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    width: calc(100% - 16px);
  }

    .k-treeview .k-in:hover {
      background-color: rgba(0, 0, 0, 0.04);
    }

/* Item Styling */
.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.item-content {
  display: flex;
  align-items: center;
  flex: 1;
}

/* Icon Styling */
.tree-icon {
  margin-left: 10px;
  width: 20px;
  text-align: center;
}

.fa-user-shield {
  color: #3a7bd5;
}

.fa-folder {
  color: #ffd43b;
}

.fa-code {
  color: #20c997;
}

/* Checkbox Styling */
.form-check {
  margin: 0;
  padding-right: 15px;
}

.form-switch .form-check-input {
  width: 2.8em;
  height: 1.4em;
  cursor: pointer;
  margin: 0;
}

.form-check-input:checked {
  background-color: #3a7bd5;
  border-color: #3a7bd5;
}

/* Tree Level Indentation */
.k-treeview .k-group {
  margin-right: 20px;
}

/* Loading State */
.form-check-input:disabled {
  opacity: 0.6;
  cursor: wait;
}