/* Custom Theme Color Override - #1E88E5 */

:root {
  --blue: #1E88E5;
  --primary: #1E88E5;
}

/* Override Primary Button Colors */
.btn-primary {
  background-color: #1E88E5 !important;
  border-color: #1E88E5 !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
  background-color: #1565C0 !important;
  border-color: #1565C0 !important;
  color: #fff !important;
  box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.5) !important;
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
  background-color: #1565C0 !important;
  border-color: #0D47A1 !important;
  color: #fff !important;
}

.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus,
.show > .btn-primary.dropdown-toggle:focus {
  box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.5) !important;
}

/* Override Background Primary */
.bg-primary {
  background-color: #1E88E5 !important;
}

a.bg-primary:hover,
a.bg-primary:focus,
button.bg-primary:hover,
button.bg-primary:focus {
  background-color: #1565C0 !important;
}

/* Override Text Primary */
.text-primary {
  color: #1E88E5 !important;
}

a.text-primary:hover,
a.text-primary:focus {
  color: #1565C0 !important;
}

/* Override Border Primary */
.border-primary {
  border-color: #1E88E5 !important;
}

/* Override Card Header Primary */
.card-header.text-primary {
  color: #1E88E5 !important;
}

/* Override Link Colors */
a {
  color: #1E88E5;
}

a:hover {
  color: #1565C0;
}

/* Override Nav Links */
.nav-link:hover {
  color: #1E88E5;
}

/* Override Sidebar Background Gradient Info to Primary Color */
.bg-gradient-info {
  background-color: #1E88E5 !important;
  background-image: linear-gradient(180deg, #1E88E5 10%, #1565C0 100%) !important;
  background-size: cover !important;
}

/* Sidebar Shadow - Menyambung dengan Topbar */
.sidebar {
  box-shadow: 2px 0 0.5rem rgba(13, 71, 161, 0.15), 
              0 0.15rem 1.75rem 0 rgba(13, 71, 161, 0.25) !important;
  position: relative;
  z-index: 1000;
}

/* Shadow lebih tegas di area yang menyambung dengan topbar */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(13, 71, 161, 0.2) 0%, 
    rgba(13, 71, 161, 0.1) 50%, 
    rgba(13, 71, 161, 0.2) 100%);
  pointer-events: none;
}

/* Override Sidebar Active State - Use white text for contrast on blue background */
.sidebar .nav-item.active .nav-link {
  color: #fff !important;
}

.sidebar .nav-item.active .nav-link i {
  color: #fff !important;
}

/* Ensure sidebar-dark nav-links remain white/light for contrast */
.sidebar-dark .sidebar-brand {
  color: #fff !important;
}

/* Logo Dishub Styling */
.logo-dishub {
  transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.sidebar-brand:hover .logo-dishub {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
}

.sidebar-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.375rem !important;
  flex-shrink: 0;
}

/* Sidebar Brand Layout - Logo dan Text Berdekatan */
.sidebar-brand {
  padding: 1rem 0.75rem !important;
  gap: 0.25rem !important;
}

.sidebar-brand-text {
  margin-left: 0 !important;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-dark .sidebar-heading {
  color: rgba(255, 255, 255, 0.6) !important;
}

.sidebar-dark .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-dark .nav-item .nav-link i {
  color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar-dark .nav-item .nav-link:hover,
.sidebar-dark .nav-item .nav-link:focus,
.sidebar-dark .nav-item .nav-link:active {
  color: #fff !important;
}

.sidebar-dark .nav-item .nav-link:hover i,
.sidebar-dark .nav-item .nav-link:focus i,
.sidebar-dark .nav-item .nav-link:active i {
  color: #fff !important;
}

/* Override Collapse Item Active State */
.sidebar .nav-item .collapse .collapse-inner .collapse-item.active,
.sidebar .nav-item .collapsing .collapse-inner .collapse-item.active {
  color: #1E88E5 !important;
  font-weight: 700 !important;
}

/* Dashboard Cards Styling */
.dashboard-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Chart Container Styling */
.chart-pie,
.chart-bar {
  position: relative;
  height: 15rem;
  width: 100%;
}

@media (min-width: 768px) {
  .chart-pie,
  .chart-bar {
    height: 20rem;
  }
}

/* Dashboard Table Responsive */
@media (max-width: 768px) {
  #moduleSummaryTable {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Dashboard Card Icon Animation */
.dashboard-card .fa-2x {
  transition: transform 0.3s ease-in-out;
}

.dashboard-card:hover .fa-2x {
  transform: scale(1.1);
}

/* Consistent Button Styling */
.btn {
  transition: all 0.2s ease-in-out;
  font-weight: 500;
  border-radius: 0.35rem;
}

.btn:hover:not(:disabled):not(.disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled):not(.disabled) {
  transform: translateY(0);
}

.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.25);
}

/* Consistent Button Sizes */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Button Shadow Consistency */
.btn.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.btn.shadow-sm:hover:not(:disabled):not(.disabled) {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   Topbar Enhancements
   ============================================ */

/* Notification Badge Counter */
.topbar .badge-counter {
  position: absolute;
  transform: scale(0.7);
  transform-origin: top right;
  right: 0.5rem;
  margin-top: -0.5rem;
  font-size: 0.6rem;
  padding: 0.25rem 0.4rem;
  border-radius: 10rem;
}

/* Icon Circle for Dropdown Items */
.icon-circle {
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Dropdown List Enhancements */
.dropdown-list {
  max-height: 450px;
  overflow-y: auto;
  overflow-x: hidden;
}

.dropdown-list .dropdown-item {
  padding: 0.75rem 1rem;
  transition: background-color 0.15s ease-in-out;
}

.dropdown-list .dropdown-item:hover {
  background-color: #f8f9fc;
}

.dropdown-list .dropdown-item-text {
  padding: 0.75rem 1rem;
}

/* Navbar Search (if added) */
.navbar-search {
  position: relative;
}

.navbar-search .form-control {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.35rem;
  background-color: #f8f9fc;
  border: 1px solid #e3e6f0;
  transition: all 0.15s ease-in-out;
}

.navbar-search .form-control:focus {
  background-color: #fff;
  border-color: #1E88E5;
  box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.25);
}

.navbar-search .input-group-append .btn {
  border-left: 0;
}

/* Nav Item Hover Effects */
.topbar .nav-item .nav-link {
  transition: color 0.15s ease-in-out;
}

.topbar .nav-item .nav-link:hover {
  color: #1E88E5 !important;
}

/* Dropdown Animation */
.animated--grow-in {
  animation-name: growIn;
  animation-duration: 200ms;
  animation-timing-function: transform cubic-bezier(0.18, 1.25, 0.4, 1), opacity cubic-bezier(0, 1, 0.4, 1);
}

@keyframes growIn {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive Adjustments for Topbar */
@media (max-width: 1200px) {
  /* Hide quick stats dropdown on smaller screens */
  .topbar .nav-item.d-none.d-xl-inline {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* Adjust notification badge size on mobile */
  .topbar .badge-counter {
    font-size: 0.5rem;
    padding: 0.2rem 0.3rem;
  }
  
  /* Smaller dropdown width on mobile */
  .dropdown-list {
    width: 280px !important;
    max-width: calc(100vw - 2rem);
  }
}

/* User Dropdown Enhancements */
.topbar .dropdown-menu {
  border: 0;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.topbar .dropdown-item {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.topbar .dropdown-item i {
  width: 1.25rem;
  text-align: center;
}

/* Badge Styling in User Dropdown */
.badge-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
}

/* Prevent Text Overflow in Dropdowns */
.dropdown-item-text,
.dropdown-list .dropdown-item {
  white-space: normal;
  word-wrap: break-word;
}

/* Flex Grow for Dropdown Items with Icons */
.dropdown-item .flex-grow-1 {
  min-width: 0;
}

/* ============================================
   Enhanced User Profile Dropdown
   ============================================ */

/* User Profile Nav Link */
.user-profile-nav {
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.user-profile-nav:hover {
  background-color: #f8f9fc !important;
  color: #1E88E5 !important;
}

.user-profile-nav:focus {
  background-color: #f8f9fc !important;
}

/* User Avatar Wrapper */
.user-avatar-wrapper {
  display: inline-block;
}

.user-avatar-wrapper .img-profile {
  transition: transform 0.2s ease-in-out;
}

.user-profile-nav:hover .user-avatar-wrapper .img-profile {
  transform: scale(1.05);
  border-color: #1E88E5 !important;
}

/* User Status Indicator */
.user-status-indicator {
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

/* User Profile Dropdown */
.user-profile-dropdown {
  border-radius: 0.75rem !important;
  overflow: hidden;
  margin-top: 0.5rem !important;
}

/* User Profile Header with Gradient */
.user-profile-header {
  background: linear-gradient(135deg, #1E88E5 0%, #1565C0 50%, #0D47A1 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.user-profile-header .user-avatar-large img {
  transition: transform 0.3s ease-in-out;
}

.user-profile-dropdown:hover .user-profile-header .user-avatar-large img {
  transform: scale(1.05);
}

/* User Profile Menu */
.user-profile-menu {
  background-color: #fff;
}

/* User Menu Item */
.user-menu-item {
  padding: 0.875rem 1rem !important;
  transition: all 0.2s ease-in-out;
  border-left: 3px solid transparent;
}

.user-menu-item:hover {
  background-color: #f8f9fc !important;
  border-left-color: #1E88E5;
  transform: translateX(2px);
}

.user-menu-item:active {
  background-color: #e9ecef !important;
}

.user-menu-item.text-danger:hover {
  background-color: #fff5f5 !important;
  border-left-color: #dc3545;
  color: #dc3545 !important;
}

/* Menu Icon Wrapper */
.menu-icon-wrapper {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e3f2fd;
  color: #1E88E5;
  margin-right: 0.875rem;
  flex-shrink: 0;
  transition: all 0.2s ease-in-out;
}

.user-menu-item:hover .menu-icon-wrapper {
  background-color: #1E88E5;
  color: #fff;
  transform: scale(1.1);
}

.menu-icon-wrapper.bg-danger-light {
  background-color: #ffe0e0;
  color: #dc3545;
}

.user-menu-item.text-danger:hover .menu-icon-wrapper.bg-danger-light {
  background-color: #dc3545;
  color: #fff;
}

.menu-icon-wrapper i {
  font-size: 1rem;
}

/* User Menu Item Content */
.user-menu-item .flex-grow-1 {
  min-width: 0;
}

.user-menu-item .font-weight-medium {
  font-size: 0.875rem;
  font-weight: 600;
  color: #5a5c69;
  margin-bottom: 0.125rem;
}

.user-menu-item:hover .font-weight-medium {
  color: #1E88E5;
}

.user-menu-item.text-danger:hover .font-weight-medium {
  color: #dc3545 !important;
}

.user-menu-item small.text-muted {
  font-size: 0.75rem;
  color: #858796;
}

.user-menu-item:hover small.text-muted {
  color: #5a5c69;
}

/* Chevron Right Icon */
.user-menu-item .fa-chevron-right {
  opacity: 0;
  transition: all 0.2s ease-in-out;
  transform: translateX(-5px);
}

.user-menu-item:hover .fa-chevron-right {
  opacity: 1;
  transform: translateX(0);
}

/* User Profile Dropdown Responsive */
@media (max-width: 768px) {
  .user-profile-dropdown {
    width: calc(100vw - 2rem) !important;
    max-width: 300px !important;
  }
  
  .user-profile-header {
    padding: 1rem !important;
  }
  
  .user-profile-header .user-avatar-large {
    margin-right: 1rem !important;
  }
  
  .user-profile-header .user-avatar-large img {
    width: 48px !important;
    height: 48px !important;
  }
  
  .user-name-text,
  .user-role-text {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .user-profile-nav .d-lg-block {
    display: none !important;
  }
  
  .user-profile-dropdown {
    width: calc(100vw - 1rem) !important;
  }
}

/* Smooth Dropdown Animation */
.user-profile-dropdown {
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Shadow for User Dropdown */
.user-profile-dropdown {
  box-shadow: 0 0.5rem 1rem rgba(30, 136, 229, 0.15) !important;
}

/* User Dropdown Divider */
.user-profile-menu .dropdown-divider {
  margin: 0.5rem 0;
  border-color: #e3e6f0;
}

/* NIP Display Section */
.user-profile-menu .dropdown-item-text {
  background-color: #f8f9fc;
  font-size: 0.8125rem;
}

/* User Profile Link Active State */
.user-profile-nav[aria-expanded="true"] {
  background-color: #f8f9fc !important;
  color: #1E88E5 !important;
}

.user-profile-nav[aria-expanded="true"] .user-avatar-wrapper .img-profile {
  border-color: #1E88E5 !important;
}

/* ============================================
   Topbar Blue Theme - Selaras dengan Sidebar
   ============================================ */

/* Topbar Background - Gradient Biru Selaras dengan Sidebar */
.topbar-blue {
  background: linear-gradient(180deg, #1E88E5 0%, #1565C0 100%) !important;
  background-color: #1E88E5 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Topbar Nav Links - White Text untuk Kontras */
.topbar-blue .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

.topbar-blue .nav-link:hover,
.topbar-blue .nav-link:focus {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.topbar-blue .nav-link i {
  color: rgba(255, 255, 255, 0.9) !important;
}

.topbar-blue .nav-link:hover i,
.topbar-blue .nav-link:focus i {
  color: #fff !important;
}

/* Topbar Toggle Button */
.topbar-blue #sidebarToggleTop {
  color: rgba(255, 255, 255, 0.9) !important;
}

.topbar-blue #sidebarToggleTop:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.topbar-blue #sidebarToggleTop:active,
.topbar-blue #sidebarToggleTop:focus {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* User Profile Nav - Adjust untuk Dark Background */
.topbar-blue .user-profile-nav {
  color: rgba(255, 255, 255, 0.9) !important;
}

.topbar-blue .user-profile-nav:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.topbar-blue .user-name-text {
  color: rgba(255, 255, 255, 0.95) !important;
}

.topbar-blue .user-role-text {
  color: rgba(255, 255, 255, 0.8) !important;
}

.topbar-blue .user-profile-nav:hover .user-name-text,
.topbar-blue .user-profile-nav:hover .user-role-text {
  color: #fff !important;
}

/* Dropdown Menu Styling untuk Topbar Blue */
.topbar-blue .dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Notification Badge - Adjust untuk visibility di background biru */
.topbar-blue .badge-counter {
  background-color: #dc3545 !important;
  color: #fff !important;
}

/* Quick Stats and Notification Icons */
.topbar-blue .nav-link i.fas {
  color: rgba(255, 255, 255, 0.9) !important;
}

.topbar-blue .nav-link:hover i.fas {
  color: #fff !important;
}

/* Chevron Icon */
.topbar-blue .fa-chevron-down {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Shadow adjustment untuk topbar biru - Menyambung dengan Sidebar */
.topbar-blue.shadow {
  box-shadow: 0 0.15rem 1.75rem 0 rgba(13, 71, 161, 0.3) !important;
  position: relative;
  z-index: 999;
}

/* Shadow di bagian kiri topbar yang menyambung dengan sidebar */
.topbar-blue.shadow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(13, 71, 161, 0.15);
  pointer-events: none;
}

/* Avatar Border Adjustment untuk Topbar Blue */
.topbar-blue .img-profile {
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.topbar-blue .user-profile-nav:hover .img-profile {
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* User Status Indicator - Adjust untuk visibility */
.topbar-blue .user-status-indicator {
  border-color: #1E88E5 !important;
}

/* Dropdown Toggle Arrow */
.topbar-blue .dropdown-toggle::after {
  color: rgba(255, 255, 255, 0.7) !important;
}

.topbar-blue .dropdown-toggle:hover::after {
  color: #fff !important;
}

