/**
 * Modern UI Enhancements
 * Custom animations, glassmorphism, and modern effects
 * Version: 1.0.0
 */

/* ============================================
   CSS Variables for Modern Theme
   ============================================ */
:root {
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-dark: linear-gradient(135deg, #232526 0%, #414345 100%);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.15);
  --shadow-hover: 0 14px 40px rgba(31, 38, 135, 0.25);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   Fade In Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 20%, 53%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -15px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -7px, 0);
  }
  80% {
    transform: translate3d(0, 0, 0);
  }
  90% {
    transform: translate3d(0, -3px, 0);
  }
}

/* ============================================
   Animation Utility Classes
   ============================================ */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

.animate-bounce {
  animation: bounce 1s ease infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Staggered animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ============================================
   Modern Card Styles
   ============================================ */
.card {
  transition: var(--transition-smooth);
  border: none;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card-modern {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: var(--transition-smooth);
}

.card-modern:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(31, 38, 135, 0.2);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.card-gradient {
  background: var(--gradient-primary);
  color: white;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.card-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  transform: rotate(45deg);
}

.card-gradient-success {
  background: var(--gradient-success);
}

.card-gradient-warning {
  background: var(--gradient-warning);
}

.card-gradient-info {
  background: var(--gradient-info);
}

/* ============================================
   Enhanced Buttons
   ============================================ */
.btn {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  border-radius: 10px;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-gradient {
  background: var(--gradient-primary);
  border: none;
  color: white;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  color: white;
}

.btn-glow {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.btn-glow:hover {
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.7);
}

/* ============================================
   Enhanced Tables
   ============================================ */
.table-modern {
  border-collapse: separate;
  border-spacing: 0 8px;
}

.table-modern thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table-modern thead th:first-child {
  border-radius: 12px 0 0 12px;
}

.table-modern thead th:last-child {
  border-radius: 0 12px 12px 0;
}

.table-modern tbody tr {
  background: white;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-modern tbody tr:hover {
  transform: scale(1.01);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.table-modern tbody td {
  border: none;
  padding: 15px 20px;
  vertical-align: middle;
}

.table-modern tbody td:first-child {
  border-radius: 12px 0 0 12px;
}

.table-modern tbody td:last-child {
  border-radius: 0 12px 12px 0;
}

/* ============================================
   Enhanced Form Inputs
   ============================================ */
.form-control-modern {
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px 16px;
  transition: var(--transition-smooth);
  background: #fafafa;
}

.form-control-modern:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control-modern:hover {
  border-color: #d0d0d0;
}

.form-floating-modern .form-control {
  border-radius: 12px;
  border: 2px solid #e8e8e8;
  padding: 20px 16px 8px;
  height: auto;
}

.form-floating-modern .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-floating-modern label {
  padding: 16px;
}

/* ============================================
   Enhanced Badges
   ============================================ */
.badge-modern {
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  transition: var(--transition-smooth);
}

.badge-modern:hover {
  transform: scale(1.05);
}

.badge-gradient-primary {
  background: var(--gradient-primary);
  color: white;
}

.badge-gradient-success {
  background: var(--gradient-success);
  color: white;
}

.badge-gradient-warning {
  background: var(--gradient-warning);
  color: white;
}

.badge-gradient-info {
  background: var(--gradient-info);
  color: white;
}

.badge-soft-primary {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
}

.badge-soft-success {
  background: rgba(17, 153, 142, 0.15);
  color: #11998e;
}

.badge-soft-danger {
  background: rgba(245, 87, 108, 0.15);
  color: #f5576c;
}

.badge-soft-warning {
  background: rgba(255, 193, 7, 0.15);
  color: #e0a800;
}

/* ============================================
   Stats Cards
   ============================================ */
.stat-card {
  position: relative;
  padding: 24px;
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(30%, -30%);
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
}

.stat-card .stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  margin-bottom: 16px;
}

.stat-card .stat-icon i {
  font-size: 28px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  opacity: 0.85;
}

/* ============================================
   Progress Bars
   ============================================ */
.progress-modern {
  height: 10px;
  border-radius: 10px;
  background: #f0f0f0;
  overflow: hidden;
}

.progress-modern .progress-bar {
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 1s ease-in-out;
}

.progress-striped .progress-bar {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: shimmer 1s linear infinite;
}

/* ============================================
   Page Transitions
   ============================================ */
.page-content {
  animation: fadeInUp 0.5s ease-out;
}

.container-xxl > .card {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.container-xxl > .card:nth-child(1) { animation-delay: 0.1s; }
.container-xxl > .card:nth-child(2) { animation-delay: 0.2s; }
.container-xxl > .card:nth-child(3) { animation-delay: 0.3s; }
.container-xxl > .card:nth-child(4) { animation-delay: 0.4s; }
.container-xxl > .card:nth-child(5) { animation-delay: 0.5s; }

.container-xxl > .row > .col,
.container-xxl > .row > [class*="col-"] {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.container-xxl > .row > .col:nth-child(1),
.container-xxl > .row > [class*="col-"]:nth-child(1) { animation-delay: 0.1s; }
.container-xxl > .row > .col:nth-child(2),
.container-xxl > .row > [class*="col-"]:nth-child(2) { animation-delay: 0.15s; }
.container-xxl > .row > .col:nth-child(3),
.container-xxl > .row > [class*="col-"]:nth-child(3) { animation-delay: 0.2s; }
.container-xxl > .row > .col:nth-child(4),
.container-xxl > .row > [class*="col-"]:nth-child(4) { animation-delay: 0.25s; }
.container-xxl > .row > .col:nth-child(5),
.container-xxl > .row > [class*="col-"]:nth-child(5) { animation-delay: 0.3s; }
.container-xxl > .row > .col:nth-child(6),
.container-xxl > .row > [class*="col-"]:nth-child(6) { animation-delay: 0.35s; }

/* ============================================
   Hover Effects
   ============================================ */
.hover-lift {
  transition: var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-scale {
  transition: var(--transition-smooth);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: var(--transition-smooth);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

.hover-rotate {
  transition: var(--transition-smooth);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* ============================================
   Loading States
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-button {
  width: 100px;
  height: 38px;
  border-radius: 8px;
}

/* ============================================
   Breadcrumb Modern
   ============================================ */
.breadcrumb-modern {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.breadcrumb-modern .breadcrumb-item {
  font-weight: 500;
}

.breadcrumb-modern .breadcrumb-item.active {
  color: #667eea;
}

/* ============================================
   Alerts Modern
   ============================================ */
.alert-modern {
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  border-left: 4px solid;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.alert-modern.alert-success {
  background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
  border-left-color: #11998e;
}

.alert-modern.alert-danger {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
  border-left-color: #f5576c;
}

.alert-modern.alert-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 151, 0, 0.1) 100%);
  border-left-color: #ffc107;
}

.alert-modern.alert-info {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
  border-left-color: #4facfe;
}

/* ============================================
   Device Status Indicators
   ============================================ */
.status-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.status-indicator::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px currentColor;
}

.status-indicator.online::before {
  background: #38ef7d;
  box-shadow: 0 0 10px rgba(56, 239, 125, 0.5);
  animation: pulse 2s infinite;
}

.status-indicator.offline::before {
  background: #f5576c;
  box-shadow: 0 0 10px rgba(245, 87, 108, 0.5);
}

.status-indicator.pending::before {
  background: #ffc107;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
  animation: pulse 1s infinite;
}

/* ============================================
   Modal Enhancements
   ============================================ */
.modal-content {
  border: none;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  animation: scaleIn 0.3s ease-out;
}

.modal-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid #f0f0f0;
  padding: 16px 24px;
}

/* ============================================
   Dropdown Enhancements
   ============================================ */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  animation: fadeInDown 0.2s ease-out;
}

.dropdown-item {
  border-radius: 8px;
  padding: 10px 16px;
  transition: var(--transition-smooth);
}

.dropdown-item:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: translateX(5px);
}

/* ============================================
   Tooltip Enhancements
   ============================================ */
.tooltip-inner {
  background: var(--gradient-dark);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #667eea, #764ba2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #764ba2, #667eea);
}

/* ============================================
   Quick Action Buttons
   ============================================ */
.quick-action-btn {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
  border: none;
  cursor: pointer;
}

.quick-action-btn:hover {
  transform: scale(1.1) rotate(5deg);
}

.quick-action-btn i {
  font-size: 1.3rem;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: float 3s ease-in-out infinite;
}

.empty-state .empty-icon i {
  font-size: 3rem;
  color: #667eea;
}

.empty-state h4 {
  color: #333;
  margin-bottom: 10px;
}

.empty-state p {
  color: #888;
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================
   Counter Animation
   ============================================ */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  
  .card:hover {
    transform: none;
  }
  
  .table-modern tbody tr:hover {
    transform: none;
  }
}

/* ============================================
   Dark Mode Support
   ============================================ */
[data-bs-theme="dark"] {
  --glass-bg: rgba(0, 0, 0, 0.3);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .card-modern {
  background: linear-gradient(145deg, #1e1e2d 0%, #2d2d3f 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .table-modern tbody tr {
  background: #1e1e2d;
}

[data-bs-theme="dark"] .form-control-modern {
  background: #2d2d3f;
  border-color: #3d3d4f;
  color: #fff;
}

[data-bs-theme="dark"] .breadcrumb-modern {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: #1e1e2d;
}

/* ============================================
   Sidebar Modern Enhancements
   ============================================ */
.layout-menu {
  transition: var(--transition-smooth);
}

.layout-menu .menu-inner {
  position: relative;
}

.layout-menu .menu-item {
  position: relative;
  transition: var(--transition-smooth);
}

.layout-menu .menu-item .menu-link {
  position: relative;
  transition: var(--transition-smooth);
  overflow: hidden;
  border-radius: 8px;
  margin: 2px 8px;
}

.layout-menu .menu-item .menu-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.1;
  transition: width 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.layout-menu .menu-item .menu-link:hover::before {
  width: 100%;
}

/* Ensure select and form controls in sidebar are clickable */
.layout-menu .menu-item .menu-link select,
.layout-menu .menu-item .menu-link input,
.layout-menu .menu-item .menu-link .form-control {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.layout-menu .menu-item .menu-link:hover {
  transform: translateX(5px);
  background: rgba(102, 126, 234, 0.08);
}

.layout-menu .menu-item .menu-link:hover .menu-icon {
  transform: scale(1.15) rotate(5deg);
  color: #667eea;
}

.layout-menu .menu-item .menu-icon {
  transition: var(--transition-bounce);
}

.layout-menu .menu-item.active > .menu-link {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.layout-menu .menu-item.active > .menu-link .menu-icon {
  color: #fff;
}

.layout-menu .menu-item.active > .menu-link::before {
  display: none;
}

/* Sidebar Menu Submenu Animation */
.layout-menu .menu-sub {
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.layout-menu .menu-sub .menu-item .menu-link {
  padding-left: 1rem;
}

.layout-menu .menu-sub .menu-item .menu-link::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: height 0.2s ease;
}

.layout-menu .menu-sub .menu-item .menu-link:hover::after {
  height: 60%;
}

/* Menu Toggle Arrow Animation */
.layout-menu .menu-toggle::after {
  transition: transform 0.3s ease;
}

.layout-menu .menu-item.open > .menu-toggle::after {
  transform: rotate(90deg);
}

/* Menu Header Styling */
.layout-menu .menu-header {
  position: relative;
  padding: 1.5rem 1rem 0.5rem;
}

.layout-menu .menu-header .menu-header-text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.6;
  position: relative;
  display: inline-block;
}

.layout-menu .menu-header .menu-header-text::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* App Brand Animation */
.app-brand-link {
  transition: var(--transition-smooth);
}

.app-brand-link:hover {
  transform: scale(1.02);
}

.app-brand-logo {
  transition: var(--transition-bounce);
}

.app-brand-link:hover .app-brand-logo {
  transform: rotate(-5deg) scale(1.1);
}

/* Sidebar Menu Mobile Toggler */
.menu-mobile-toggler {
  transition: var(--transition-smooth);
}

.menu-mobile-toggler:hover {
  transform: scale(1.1);
}

/* ============================================
   Navbar Modern Enhancements
   ============================================ */
.layout-navbar {
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.layout-navbar .nav-link {
  position: relative;
  transition: var(--transition-smooth);
}

.layout-navbar .nav-link.btn-icon {
  overflow: hidden;
}

.layout-navbar .nav-link.btn-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.layout-navbar .nav-link.btn-icon:hover::before {
  width: 100%;
  height: 100%;
}

.layout-navbar .nav-link.btn-icon:hover {
  transform: scale(1.1);
}

.layout-navbar .nav-link.btn-icon:hover i {
  color: #667eea !important;
  transform: rotate(15deg);
  transition: var(--transition-bounce);
}

.layout-navbar .nav-link i {
  transition: var(--transition-smooth);
}

/* Navbar Dropdown Animation */
.layout-navbar .dropdown-menu {
  animation: dropdownFadeIn 0.25s ease;
  border: none;
  box-shadow: var(--shadow-soft);
  border-radius: 12px;
  overflow: visible;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.layout-navbar .dropdown-item {
  transition: var(--transition-smooth);
  border-radius: 8px;
  margin: 2px 8px;
  padding: 8px 12px;
}

.layout-navbar .dropdown-item:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: translateX(5px);
}

.layout-navbar .dropdown-item:hover i {
  transform: scale(1.1);
  color: #667eea;
}

.layout-navbar .dropdown-item i {
  transition: var(--transition-smooth);
}

/* Navbar User Avatar Animation */
.layout-navbar .avatar {
  transition: var(--transition-smooth);
  border: 2px solid transparent;
}

.layout-navbar .avatar:hover {
  transform: scale(1.1);
  border-color: #667eea;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

/* Navbar Shortcuts Grid */
.dropdown-shortcuts-item {
  transition: var(--transition-smooth);
  padding: 1.5rem 1rem;
}

.dropdown-shortcuts-item:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.dropdown-shortcuts-item:hover .dropdown-shortcuts-icon {
  transform: scale(1.15) rotate(5deg);
  background: var(--gradient-primary);
}

.dropdown-shortcuts-item:hover .dropdown-shortcuts-icon i {
  color: #fff !important;
}

.dropdown-shortcuts-icon {
  transition: var(--transition-bounce);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(102, 126, 234, 0.1);
}

/* Notification Badge Pulse */
.badge-notifications {
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
  }
}

/* Theme Switcher Button Animation */
.layout-navbar [data-bs-theme-value] {
  position: relative;
  overflow: hidden;
}

.layout-navbar [data-bs-theme-value].active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.layout-navbar [data-bs-theme-value].active i {
  color: #667eea;
}

/* Navbar Search Animation */
.navbar-search-wrapper {
  transition: var(--transition-smooth);
}

.navbar-search-wrapper:hover {
  opacity: 0.8;
}

/* Dark Mode Sidebar/Navbar */
[data-bs-theme="dark"] .layout-menu .menu-item .menu-link:hover {
  background: rgba(102, 126, 234, 0.15);
}

[data-bs-theme="dark"] .layout-navbar {
  background: rgba(30, 30, 45, 0.9) !important;
}

[data-bs-theme="dark"] .layout-navbar .dropdown-menu {
  background: #2d2d3f;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .dropdown-shortcuts-icon {
  background: rgba(102, 126, 234, 0.2);
}

/* ============================================
   Layout Overflow Fix
   ============================================ */
.layout-page {
  overflow-x: hidden;
}

.content-wrapper {
  overflow-x: hidden;
}

/* Prevent row negative margins from causing horizontal scroll */
.container-xxl,
.container-fluid {
  overflow-x: hidden;
}

/* ============================================
   Navbar Dropdown Overflow Fix
   ============================================ */
#layout-navbar,
.layout-navbar,
.navbar-nav,
#navbar-collapse {
  overflow: visible !important;
}

.layout-navbar .dropdown {
  position: static;
}

.layout-navbar .dropdown-menu {
  position: absolute !important;
  overflow: visible !important;
}

/* Fix dropdown appearing inside navbar with scrollbar */
.navbar-nav .dropdown-menu {
  max-height: none !important;
  overflow-y: visible !important;
}

/* ============================================
   Sidebar Logo Minimize Switch
   ============================================ */
.sidebar-logo-full {
  display: inline-block !important;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sidebar-logo-mini {
  display: none !important;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* When sidebar is collapsed */
html.layout-menu-collapsed .sidebar-logo-full {
  display: none !important;
}

html.layout-menu-collapsed .sidebar-logo-mini {
  display: inline-block !important;
}

/* Hover effect on logo when collapsed */
html.layout-menu-collapsed .layout-menu:hover .sidebar-logo-full {
  display: inline-block !important;
}

html.layout-menu-collapsed .layout-menu:hover .sidebar-logo-mini {
  display: none !important;
}

/* ============================================
   Template Customizer Visibility Fix
   ============================================ */
#template-customizer {
  z-index: 99999 !important;
  visibility: visible !important;
}

#template-customizer .template-customizer-open-btn {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 100000000 !important;
  position: fixed !important;
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  inset-block-start: 180px !important;
  transform: none !important;
}

/* Vuexy hides customizer on small screens; keep it available for dashboard pages only */
@media (max-width: 1200px) {
  html:not(.customizer-hide) #template-customizer {
    display: flex !important;
    visibility: visible !important;
  }
  html:not(.customizer-hide) #template-customizer .template-customizer-open-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

