@font-face {
  font-family: Parastoo;
  src: url("../fonts/Parastoo-FD.eot");
  src:
    url("../fonts/Parastoo-FD.eot?#iefix") format("embedded-opentype"),
    url("../fonts/Parastoo-FD.woff") format("woff"),
    url("../fonts/Parastoo-FD.ttf") format("truetype");
  font-weight: normal;
}

@font-face {
  font-family: Parastoo;
  src: url("../fonts/Parastoo-Bold-FD.eot");
  src:
    url("../fonts/Parastoo-Bold-FD.eot?#iefix") format("embedded-opentype"),
    url("../fonts/Parastoo-Bold-FD.woff") format("woff"),
    url("../fonts/Parastoo-Bold-FD.ttf") format("truetype");
  font-weight: bold;
}

@font-face {
  font-family: Peyda;
  src:
    url("../fonts/peyda/woff/PeydaWebFaNum-Regular.woff") format("woff"),
    url("../fonts/peyda/woff2/PeydaWebFaNum-Regular.woff2") format("woff2");
  font-weight: normal;
}

@font-face {
  font-family: Peyda;
  src:
    url("../fonts/peyda/woff/PeydaWebFaNum-Bold.woff") format("woff"),
    url("../fonts/peyda/woff2/PeydaWebFaNum-Bold.woff2") format("woff2");
  font-weight: bold;
}

body {
  font-family: Peyda, "B Nazanin", "Nazain", "Tahoma";
}

/* Additional frontend styles for better compatibility */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Ensure Tailwind utilities work */
#crm-dashboard * {
  box-sizing: border-box;
}

/* Animation for notifications */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.fixed.top-4.right-4 {
  animation: slideIn 0.3s ease-out;
}

/* Mobile Menu Toggle Button */
#mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 0.5rem;
  right: 1rem;
  z-index: 50;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.3s ease;
}

#mobile-menu-toggle:hover {
  background-color: #2563eb;
  transform: scale(1.05);
}

#mobile-menu-toggle:active {
  transform: scale(0.95);
}

#mobile-menu-toggle.menu-open {
  background-color: #dc2626;
}

#mobile-menu-toggle.menu-open:hover {
  background-color: #b91c1c;
}

/* Hamburger to X transformation */
#mobile-menu-toggle svg {
  transition: transform 0.3s ease;
}

#mobile-menu-toggle.menu-open svg {
  transform: rotate(90deg);
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

#mobile-menu-overlay.active {
  opacity: 1;
}

/* Sidebar mobile styles */
@media (max-width: 1023px) {
  #mobile-menu-toggle {
    display: block;
  }

  .crm-portal-sidebar {
    position: fixed !important;
    top: 0;
    right: -100%;
    height: auto !important;
    max-height: 100vh !important;
    min-height: 100vh;
    width: 280px;
    max-width: 85vw;
    z-index: 50;
    overflow-y: auto !important;
    transition: right 0.3s ease;
    box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
    margin: 0 !important;
  }

  .crm-portal-sidebar.mobile-open {
    right: 0;
  }

  /* Hide sidebar on mobile by default in flex container */
  aside.lg\\:w-80 {
    display: none;
  }

  aside.lg\\:w-80:has(.crm-portal-sidebar.mobile-open) {
    display: block;
  }

  /* RTL support - keep sidebar on right side */
  [dir="rtl"] .crm-portal-sidebar {
    right: -100%;
    left: auto;
    box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
  }

  [dir="rtl"] .crm-portal-sidebar.mobile-open {
    right: 0;
    left: auto;
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  #crm-dashboard {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #crm-dashboard h1 {
    font-size: 1.5rem;
  }

  #crm-dashboard .grid {
    grid-template-columns: 1fr;
  }

  #crm-dashboard .flex.space-x-4 {
    flex-direction: column;
    space-x: 0;
  }

  #crm-dashboard .flex.space-x-4 > * {
    margin-bottom: 0.5rem;
    width: 100%;
  }

  #crm-dashboard .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  #crm-dashboard table {
    min-width: 600px;
  }
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Focus styles for accessibility */
#crm-dashboard button:focus,
#crm-dashboard input:focus,
#crm-dashboard select:focus,
#crm-dashboard textarea:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.login-background {
  background: url(../img/auth-b-7Q6nLn.png) no-repeat bottom;
  background-color: #fafafa;
  height: 420px;
  filter: none;
}

.crm-support-wrapper select {
  font-size: 14px;
  height: unset;
  background-position: left;
}

.crm-support-wrapper input[type="email"],
.crm-support-wrapper input[type="text"],
.crm-support-wrapper textarea {
  font-size: 16px;
  font-family: inherit;
  padding: 0.5rem 0.75rem;
  height: auto;
}

#new-case-form :is(input, textarea) {
  font-size: 13px;
}

#new-case-modal .crm-modal-panel {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
}

#new-case-modal .crm-modal-body {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f9fafb;
}

/* Lightweight Theme Mode */
body.crm-portal-light-theme {
  margin: 0 !important;
  padding: 0 !important;
  background-color: #f9fafb;
}

/* Stats Cards Responsive Layout */
.stat-card {
  flex: 1 1 calc(50% - 0.625rem);
  min-width: calc(50% - 0.625rem);
}

@media (min-width: 1024px) {
  .stat-card {
    flex: 1 1 calc(25% - 0.9375rem);
    min-width: calc(25% - 0.9375rem);
  }
}

/* Sidebar scrollbar styling for lightweight theme */
.crm-portal-sidebar.overflow-y-auto {
  max-height: calc(100vh - 2rem);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.crm-portal-sidebar.overflow-y-auto::-webkit-scrollbar {
  width: 6px;
}

.crm-portal-sidebar.overflow-y-auto::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 3px;
}

.crm-portal-sidebar.overflow-y-auto::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.crm-portal-sidebar.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Case detail container - full height */
#case-detail-container {
  height: calc(100vh - 130px);
  overflow: hidden;
}

/* Conversation container scrolling */
#case-conversation-container {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f9fafb;
}

#case-conversation-container::-webkit-scrollbar {
  width: 8px;
}

#case-conversation-container::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 4px;
}

#case-conversation-container::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

#case-conversation-container::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Install/Update Menu - Download button hover effect */
.install-update-download-btn:hover {
  background-color: var(--hover-bg) !important;
  color: #ffffff !important;
  border-color: var(--hover-bg) !important;
}

/* Cases container - full height with scroll */
#cases-container {
  max-height: calc(100vh - 370px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f9fafb;
  transition: max-height 0.3s ease;
}

/* When banner is hidden, reduce the reserved space */
#cases-container.no-banner {
  max-height: calc(100vh - 290px);
}

#cases-container.no-filters {
  max-height: calc(100vh - 300px);
}

#cases-container.no-filters.no-banner {
  max-height: calc(100vh - 230px);
}

/* Mobile responsive adjustments for cases container */
@media (max-width: 768px) {
  #cases-container {
    max-height: calc(100vh - 32rem);
  }

  #cases-container.no-banner {
    max-height: calc(100vh - 26rem);
  }

  #cases-container.no-filters {
    max-height: calc(100vh - 28rem);
  }

  #cases-container.no-filters.no-banner {
    max-height: calc(100vh - 22rem);
  }
}

@media (max-width: 640px) {
  #cases-container {
    max-height: calc(100vh - 32rem);
  }

  #cases-container.no-banner {
    max-height: calc(100vh - 26rem);
  }

  #cases-container.no-filters {
    max-height: calc(100vh - 28rem);
  }

  #cases-container.no-filters.no-banner {
    max-height: calc(100vh - 22rem);
  }
}

#cases-container::-webkit-scrollbar {
  width: 8px;
}

#cases-container::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 4px;
}

#cases-container::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

#cases-container::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Star Rating Feedback */
#star-rating-container {
  gap: 0.25rem;
}

.star-icon {
  transition: all 0.2s ease;
}

.star-icon:not(.cursor-default):hover {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.star-icon.text-yellow-400 {
  filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.5));
}

/* Feedback section animations */
.bg-blue-50,
.bg-green-50 {
  transition: all 0.3s ease;
}

input#searchCases {
  font-size: 12px;
}


