﻿/* Azhar Theme - Green Color Scheme */
:root {
  --azhar-primary: #1967D3;
  --azhar-primary-light: #E8F0FB;
  --azhar-primary-dark: #0a4291;
  --azhar-secondary: #3d7ed8;
  --azhar-accent: #66BB6A;
  --azhar-success: #4CAF50;
  --azhar-info: #26A69A;
  --azhar-warning: #FFA726;
  --azhar-danger: #EF5350;
  --azhar-light: #F1F8E9;
  --azhar-dark: #0a4291;
  --primary-300: #6599E2;
  --primary-800: #0E3974;
}

body {
  text-align: start;
}

/* Consolidated Header Styles */
.main-header-green {
  background-color: var(--azhar-primary);
  color: white;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.main-header-green .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-header-green .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  min-height: 60px;
}

.main-header-green .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-header-green .menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.main-header-green .menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.main-header-green .main-navigation {
  display: flex;
  align-items: center;
}

.main-header-green .nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.main-header-green .nav-item {
  position: relative;
}

.main-header-green .nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.main-header-green .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--azhar-accent);
}

.main-header-green .nav-item.active .nav-link {
  background-color: var(--azhar-primary-light);
  color: white;
}

.main-header-green .header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-header-green .site-title {
  text-align: right;
}

.main-header-green .main-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.2;
  color: white;
}

.main-header-green .subtitle {
  font-size: 0.8rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
}

.main-header-green .header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-header-green .lang-toggle,
.main-header-green .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-header-green .lang-toggle:hover,
.main-header-green .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main-header-green .theme-toggle {
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  justify-content: center;
}

/* Dropdown Menu Styles */
.nav-item.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-toggle::after {
  content: '▼';
  margin-left: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.dropdown-toggle:hover::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  transition: background-color 0.3s ease;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: var(--azhar-light);
  color: var(--azhar-primary);
}

/* Responsive Design for Header */
@media (max-width: 768px) {
  .main-header-green .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
  }

  .main-header-green .header-left {
    width: 100%;
    justify-content: space-between;
  }

  .main-header-green .nav-list {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .main-header-green .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .main-header-green .main-title {
    font-size: 1rem;
  }

  .main-header-green .subtitle {
    font-size: 0.75rem;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background-color: var(--azhar-primary-light);
    margin-top: 0.5rem;
    border-radius: 4px;
  }

  .dropdown-item {
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
  }
}

@media (max-width: 480px) {
  .main-header-green .nav-list {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .main-header-green .nav-link {
    padding: 0.75rem 1rem;
    text-align: center;
    width: 100%;
  }
}

/* Override AdminLTE primary colors */
.navbar-white {
  background-color: var(--azhar-primary) !important;
  border-bottom: 1px solid var(--azhar-primary-dark) !important;
}

.navbar-white .navbar-nav .nav-link {
  color: white !important;
}

.navbar-white .navbar-nav .nav-link:hover {
  color: var(--azhar-accent) !important;
}

/* Sidebar styling */
.sidebar-dark-primary {
  background-color: var(--azhar-primary-dark) !important;
}

.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active {
  background-color: var(--azhar-primary-secondary) !important;
  color: white !important;
}

.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link:hover {
  background-color: var(--azhar-secondary) !important;
  color: white !important;
}

/* Brand link styling */
.brand-link {
  background-color: var(--azhar-primary-dark) !important;
  border-bottom: 1px solid var(--azhar-primary) !important;
}

.brand-text {
  color: white !important;
  font-weight: 600 !important;
}

/* Info boxes with Azhar colors */
.info-box-icon.bg-info {
  background-color: var(--azhar-info) !important;
}

.info-box-icon.bg-success {
  background-color: var(--azhar-success) !important;
}

.info-box-icon.bg-warning {
  background-color: var(--azhar-warning) !important;
}

.info-box-icon.bg-danger {
  background-color: var(--azhar-danger) !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--azhar-primary) !important;
  border-color: var(--azhar-primary) !important;
}

.btn-primary:hover {
  background-color: var(--azhar-primary-dark) !important;
  border-color: var(--azhar-primary-dark) !important;
}

.btn-success {
  background-color: var(--azhar-success) !important;
  border-color: var(--azhar-success) !important;
}

.btn-info {
  background-color: var(--azhar-info) !important;
  border-color: var(--azhar-info) !important;
}

/* Progress bars */
.progress-bar.bg-primary {
  background-color: var(--azhar-primary) !important;
}

.progress-bar.bg-success {
  background-color: var(--azhar-success) !important;
}

/* Cards */
.card-header {
  background-color: transparent !important;
  border-bottom: 1px solid var(--azhar-accent) !important;
}

/* Badges */
.badge-success {
  background-color: var(--azhar-success) !important;
}

.badge-info {
  background-color: var(--azhar-info) !important;
}

.badge-warning {
  background-color: var(--azhar-warning) !important;
}

.badge-danger {
  background-color: var(--azhar-danger) !important;
}

/* prevent the drop down icon going onto a new line for the top bar language link */
.top-bar-language-nav-link {
  min-width: 65px;
}

/* bootstrap model showing two scroll bars */
html {
  overflow: visible;
}

/* main sidebar not under model */
.modal {
  z-index: 1110;
}

.form-group.required .col-form-label:after {
  color: #d00;
  content: "*";
  position: absolute;
  margin-left: 3px;
}

.nav-user-menu .user-image {
  width: 20px;
  margin-right: 4px;
  margin-top: -4px;
}

.famfamfam-flags {
  display: inline-block;
}

.sidebar ul li p {
  white-space: nowrap !important;
  text-overflow: ellipsis;
  transition: opacity 0.5s ease-in-out !important;
  opacity: 1;
}

.sidebar-mini .main-sidebar .sidebar,
.sidebar-mini .main-sidebar .sidebar:hover {
  overflow-x: auto !important;
  width: 250px;
  transition: width 0.3s ease-in-out;
}

/* Force sidebar to always be on the left side (both RTL and LTR) */
.main-sidebar {
  left: 0 !important;
  right: auto !important;
}

/* Adjust content wrapper for both RTL and LTR */
body:not(.sidebar-collapse) .content-wrapper,
body:not(.sidebar-collapse) .main-footer {
  margin-left: 250px !important;
  margin-right: 0 !important;
}

/* When sidebar is collapsed */
body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-footer {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Ensure sidebar mini behavior works correctly */
.sidebar-mini.sidebar-collapse .main-sidebar {
  left: 0 !important;
  right: auto !important;
}

html[dir="rtl"] .sidebar-mini.sidebar-collapse .main-sidebar {
  left: auto !important;
  right: 0 !important;
}

/* Fix for RTL - override default RTL positioning */
html[dir="rtl"] .main-sidebar,
body.rtl .main-sidebar {
  left: auto !important;
  right: 0 !important;
}

html[dir="rtl"] .content-wrapper,
html[dir="rtl"] .main-footer,
body.rtl .content-wrapper,
body.rtl .main-footer {
  margin-left: 0 !important;
  margin-right: 250px !important;
}

html[dir="rtl"].sidebar-collapse .content-wrapper,
html[dir="rtl"].sidebar-collapse .main-footer,
body.rtl.sidebar-collapse .content-wrapper,
body.rtl.sidebar-collapse .main-footer {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Push menu button - ensure it toggles correctly */
.nav-link[data-widget="pushmenu"] {
  cursor: pointer;
}

/* Navbar positioning - ensure it's positioned correctly with left sidebar */
.main-header.navbar {
  left: 0 !important;
  right: 0 !important;
}


/* When sidebar is open, adjust navbar */
body:not(.sidebar-collapse) .main-header.navbar {
  margin-left: 250px !important;
  margin-right: 0 !important;
}

html[dir="rtl"] body:not(.sidebar-collapse) .main-header.navbar {
  margin-left: 0 !important;
  margin-right: 250px !important;
}

/* When sidebar is collapsed, reset navbar */
body.sidebar-collapse .main-header.navbar {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* RTL overrides for navbar */
html[dir="rtl"] .main-header.navbar,
body.rtl .main-header.navbar {
  left: 0 !important;
  right: 0 !important;
}


body.rtl:not(.sidebar-collapse) .main-header.navbar {
  margin-left: 0 !important;
  margin-right: 250px !important;
}


body.rtl.sidebar-collapse .main-header.navbar {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Ensure sidebar content alignment is correct for both languages */
.main-sidebar .sidebar {
  text-align: right;
}

html[dir="ltr"] .main-sidebar .sidebar,
body:not(.rtl) .main-sidebar .sidebar {
  text-align: left;
}

/* Nav sidebar items alignment */
.sidebar .nav-sidebar .nav-item .nav-link {
  display: flex;
  align-items: center;
  width: 100%;
}

.sidebar .nav-sidebar .nav-item .nav-link .nav-icon {
  margin-right: 0.5rem;
  margin-left: 0;
}

html[dir="rtl"] .sidebar .nav-sidebar .nav-item .nav-link .nav-icon,
body.rtl .sidebar .nav-sidebar .nav-item .nav-link .nav-icon {
  margin-right: 0;
  margin-left: 0.5rem;
}

.sidebar-collapse .navbar-nav {
  padding-inline-start: 75px;
}

.main-sidebar .nav-sidebar {
  padding-inline-start: 5px;
}

.sidebar-collapse .nav-sidebar {
  padding-inline-start: 5px;
}

.main--btn {
  background-color: var(--azhar-primary) !important;
  color: #fff !important;
  border-radius: 1000px !important;
  height: 50px !important;
  padding: 8px 20px !important;
  min-width: 150px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

.btn-search {
  background-color: var(--azhar-primary) !important;
  color: #fff !important;
  border-radius: 8px 0 0 8px !important;
}

html[dir="rtl"] .btn-search {
  border-radius: 0 8px 8px 0 !important;
}

.form-control {
  background-color: var(--azhar-primary-light) !important;
  color: var(--azhar-primary-dark) !important;
  border: none !important;
  height: 50px !important;
  border-radius: 8px !important;
}

.form-control.txt-search {
  border-radius: 0 8px 8px 0 !important;
}

html[dir="rtl"] .form-control.txt-search {
  border-radius: 8px 0 0 8px !important;
}

html[dir="rtl"] table.dataTable tfoot td,
html[dir="rtl"] table.dataTable tfoot th,
html[dir="rtl"] table.dataTable thead td,
html[dir="rtl"] table.dataTable thead th {
  text-align: right !important;
}

html[dir="rtl"] .main-header.navbar .lang--nav {
  margin-right: auto !important;
  margin-left: unset !important;
}

html[dir="rtl"] [class*=icheck-]>input:first-child+label::before {
  margin-right: -29px !important;
  margin-left: unset !important;
}
.nav-user-menu .dropdown-menu-right{
  right: unset !important;
  left: 0 !important;
}
.nav-user-menu .dropdown-menu-right .dropdown-item{
  text-align: right !important;
}
body.rtl.sidebar-collapse .content-wrapper{
  margin-right: 80px !important;
}