/* Organizational Theme - Custom Overrides */

/* ==========================================
   IRANSans Font Overrides
   Override theme's broken iransans font-face declarations
   ========================================== */
@font-face {
  font-family: 'iransans';
  src: url("/layout/fonts/iransans/eot/IRANSansWeb.eot");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'iransans';
  src: url("/layout/fonts/iransans/woff2/IRANSansWeb.woff2") format("woff2"),
       url("/layout/fonts/iransans/woff/IRANSansWeb.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'iransansLight';
  src: url("/layout/fonts/iransans/eot/IRANSansWeb_Light.eot");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'iransansLight';
  src: url("/layout/fonts/iransans/woff2/IRANSansWeb_Light.woff2") format("woff2"),
       url("/layout/fonts/iransans/woff/IRANSansWeb_Light.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

/* ==========================================
   SIDEBAR OVERRIDES
   ========================================== */
.layout-sidebar {
  background-color: var(--sidebar-bg) !important;
  border-right: 1px solid var(--sidebar-border) !important;
}

.sidebar-header {
  background: var(--sidebar-header-bg) !important;
  border-bottom-color: var(--sidebar-border) !important;
}

.sidebar-header .sidebar-logo {
  filter: brightness(0) invert(1) !important;
}

.sidebar-header .brand-name {
  color: #ffffff !important;
}

.sidebar-footer {
  background: var(--sidebar-footer-bg) !important;
  border-top-color: var(--sidebar-border) !important;
}

.sidebar-footer .footer-avatar {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
}

.sidebar-footer .footer-name {
  color: #e2e8f0 !important;
}

.sidebar-footer .sidebar-footer-content:hover {
  background: var(--sidebar-hover) !important;
}

/* Menu items in sidebar */
.layout-menu ul a {
  color: var(--sidebar-text) !important;
}

.layout-menu ul a:hover {
  background-color: var(--sidebar-hover) !important;
  color: var(--sidebar-text-active) !important;
}

.layout-menu ul a.active-route {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-text-active) !important;
}

.layout-menu ul a.active-route .layout-menuitem-icon {
  color: var(--primary-color) !important;
}

/* Root menu text */
.layout-menuitem-root-text {
  color: rgba(148, 163, 184, 0.5) !important;
}

/* Scrollbar in sidebar */
.layout-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1) !important;
}

.menu-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================
   TOPBAR OVERRIDES
   ========================================== */
.layout-topbar {
  background-color: var(--surface-card) !important;
  border-bottom: 1px solid var(--surface-border) !important;
}

.layout-topbar .topbar-search {
  background: var(--surface-section) !important;
  border-color: var(--surface-border) !important;
}

.layout-topbar .topbar-search:focus-within {
  border-color: var(--primary-color) !important;
}

/* ==========================================
   MAIN CONTENT OVERRIDES
   ========================================== */
.layout-main {
  background: var(--surface-ground) !important;
}

.layout-main-container {
  background: var(--surface-ground) !important;
}

/* ==========================================
   GLOBAL COMPONENT OVERRIDES
   ========================================== */

/* DataTable - Table Section Background */
.models-table-section {
  background: var(--surface-section);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--surface-border);
}

/* Overlay Panel */
.p-overlaypanel-content {
  padding: 0px 10px;
}

/* Select Action Section */
.SelectActionSection ul {
  list-style: none;
  padding: 0;
}
.SelectActionSection ul li {
  cursor: pointer;
  padding: 8px 0 8px 0;
  color: var(--text-color);
  transition: background-color 0.2s, color 0.2s;
  border-radius: 4px;
  padding-left: 8px;
  padding-right: 8px;
}
.SelectActionSection ul li:hover {
  background-color: var(--surface-hover);
  color: var(--primary-color);
}
.SelectActionSection ul li i {
  width: 20px;
  height: 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding-right: 8px;
}

/* ==========================================
   DIALOG OVERRIDES
   ========================================== */
.p-dialog {
  border-radius: 16px;
}

.p-dialog .p-dialog-header {
  border-bottom: 1px solid var(--surface-border);
  padding: 1.25rem 1.5rem;
}

.p-dialog .p-dialog-footer {
  border-top: 1px solid var(--surface-border);
  padding: 1rem 1.5rem;
}

/* ==========================================
   DATATABLE OVERRIDES
   ========================================== */
.p-datatable .p-datatable-thead > tr > th {
  background: var(--surface-section);
  color: var(--text-color);
  border-bottom: 2px solid var(--surface-border);
  font-weight: 600;
}

.p-datatable .p-datatable-tbody > tr {
  color: var(--text-color);
}

.p-datatable .p-datatable-tbody > tr > td {
  border-bottom: 1px solid var(--surface-border);
  padding: 0.75rem 1rem;
}

.p-datatable .p-datatable-tbody > tr:hover {
  background: var(--surface-hover);
}

/* ==========================================
   INPUT / SELECT OVERRIDES
   ========================================== */
.p-inputtext,
.p-dropdown,
.p-calendar,
.p-autocomplete,
.p-inputnumber,
.p-password input {
  background-color: var(--surface-card);
  color: var(--text-color);
  border-color: var(--surface-border);
  border-radius: 8px;
}

.p-inputtext:enabled:hover,
.p-dropdown:not(.p-disabled):hover,
.p-calendar:not(.p-disabled):hover .p-inputtext,
.p-autocomplete:not(.p-disabled):hover .p-inputtext {
  border-color: var(--surface-400);
}

.p-inputtext:enabled:focus,
.p-dropdown:not(.p-disabled).p-focus,
.p-calendar:not(.p-disabled).p-focus .p-inputtext,
.p-autocomplete:not(.p-disabled).p-focus .p-inputtext {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================
   BUTTON OVERRIDES
   ========================================== */
.p-button {
  border-radius: 8px;
}

.p-button.p-button-primary {
  background-color: var(--primary-color);
  color: var(--primary-color-text);
  border-color: var(--primary-color);
}

.p-button.p-button-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

/* ==========================================
   CARD OVERRIDES
   ========================================== */
.p-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.p-card .p-card-title {
  color: var(--text-color);
  font-weight: 600;
}

.p-card .p-card-content {
  color: var(--text-color);
}

.p-card .p-card-subtitle {
  color: var(--text-color-secondary);
}

/* ==========================================
   SIDEBAR (PrimeVue component) OVERRIDES
   ========================================== */
.p-sidebar.p-sidebar-right {
  background: var(--surface-card);
  border-left: 1px solid var(--surface-border);
}

.p-sidebar .p-sidebar-header {
  border-bottom: 1px solid var(--surface-border);
}

.p-sidebar .p-sidebar-content {
  color: var(--text-color);
}

/* ==========================================
   TABVIEW OVERRIDES
   ========================================== */
.p-tabview .p-tabview-nav {
  border-color: var(--surface-border);
}

.p-tabview .p-tabview-nav li .p-tabview-nav-link {
  color: var(--text-color-secondary);
  background: transparent;
  border-color: transparent;
}

.p-tabview .p-tabview-nav li.p-highlight .p-tabview-nav-link {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* ==========================================
   TOAST OVERRIDES
   ========================================== */
.p-toast {
  font-family: var(--font-family);
}

.p-toast-message {
  border-radius: 10px;
}

/* ==========================================
   BADGE OVERRIDES
   ========================================== */
.p-badge {
  font-family: var(--font-family);
  border-radius: 6px;
}

/* ==========================================
   PROGRESS BAR OVERRIDES
   ========================================== */
.p-progressbar {
  background: var(--surface-100);
  border-radius: 100px;
  overflow: hidden;
}

.p-progressbar .p-progressbar-value {
  background: var(--primary-color);
}

/* ==========================================
   TAG OVERRIDES
   ========================================== */
.p-tag {
  background: var(--primary-color);
  color: var(--primary-color-text);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
}

/* ==========================================
   TOOLTIP OVERRIDES
   ========================================== */
.p-tooltip .p-tooltip-text {
  background: var(--surface-700);
  color: var(--surface-0);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

/* ==========================================
   DROPDOWN OVERRIDES
   ========================================== */
.p-dropdown-panel {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.p-dropdown-items {
  padding: 0.25rem;
}

.p-dropdown-items .p-dropdown-item {
  color: var(--text-color);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

.p-dropdown-items .p-dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text-color);
}

.p-dropdown-items .p-dropdown-item.p-highlight {
  background: var(--highlight-bg);
  color: var(--highlight-text-color);
}

/* ==========================================
   CALENDAR / DATE PICKER OVERRIDES
   ========================================== */
.p-calendar-panel {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.p-datepicker {
  background: var(--surface-card);
  color: var(--text-color);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
}

.p-datepicker .p-datepicker-header {
  background: var(--surface-card);
  color: var(--text-color);
  border-bottom: 1px solid var(--surface-border);
}

.p-datepicker .p-datepicker-day:hover {
  background: var(--surface-hover);
  color: var(--text-color);
}

.p-datepicker .p-datepicker-day.p-highlight {
  background: var(--primary-color);
  color: var(--primary-color-text);
}

/* ==========================================
   MULTISELECT OVERRIDES
   ========================================== */
.p-multiselect-panel {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.p-multiselect-items .p-multiselect-item {
  color: var(--text-color);
}

.p-multiselect-items .p-multiselect-item:hover {
  background: var(--surface-hover);
  color: var(--text-color);
}

.p-multiselect-items .p-multiselect-item.p-highlight {
  background: var(--highlight-bg);
  color: var(--highlight-text-color);
}

/* ==========================================
   FIELD OVERRIDES (for labels)
   ========================================== */
.p-field label,
.formgroup-inline label,
.field label {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

/* ==========================================
   SCROLLBAR OVERRIDES (for dark mode)
   ========================================== */
.layout-theme-dark ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.layout-theme-dark ::-webkit-scrollbar-track {
  background: var(--surface-ground);
}

.layout-theme-dark ::-webkit-scrollbar-thumb {
  background: var(--surface-300);
  border-radius: 3px;
}

.layout-theme-dark ::-webkit-scrollbar-thumb:hover {
  background: var(--surface-400);
}

/* ==========================================
   PRELOADER OVERRIDES
   ========================================== */
.layout-theme-dark .preloader {
  background: var(--surface-ground);
}

/* ==========================================
   MARK OVERRIDES
   ========================================== */
.layout-theme-dark mark {
  background: rgba(96, 165, 250, 0.2);
  color: var(--text-color);
}

.layout-theme-light mark {
  background: #eff6ff;
  color: var(--text-color);
}

/* ==========================================
   BLOCKQUOTE OVERRIDES
   ========================================== */
.layout-theme-dark blockquote {
  border-left-color: var(--surface-300);
  color: var(--text-color-secondary);
}

.layout-theme-light blockquote {
  border-left-color: #93c5fd;
  color: var(--text-color-secondary);
}

/* ==========================================
   CUSTOM TABLE ACTION BUTTONS
   ========================================== */
.customer-action-overlay .p-overlaypanel-content {
  padding: 0.5rem;
}

/* ==========================================
   PRINT STYLES - Override for print
   ========================================== */
@media print {
  .layout-topbar,
  .layout-sidebar,
  .layout-config-button,
  .layout-footer,
  .layout-mask {
    display: none !important;
  }

  .layout-main-container {
    padding: 0 !important;
    margin: 0 !important;
  }

  .layout-main {
    width: 100% !important;
  }
}
