/*
 * Modern UI Theme for POS System
 * Enhanced design with modern colors, shadows, and animations
 */

/* ========================================
   ROOT VARIABLES - Modern Color Palette (Green/Light Theme)
   ======================================== */
:root {
  --primary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --success-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  --warning-gradient: linear-gradient(135deg, #f7b733 0%, #fc4a1a 100%);
  --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

  --dark-bg: #1a1d29;
  --card-bg: #ffffff;
  --border-color: #e8e8e8;
  --text-primary: #2d3748;
  --text-secondary: #718096;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   GLOBAL IMPROVEMENTS
   ======================================== */
body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  background-attachment: fixed;
}

/* ========================================
   FIXED LAYOUT WITH SMOOTH SCROLLING
   ======================================== */
/* Make header fixed at top */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

/* Make sidebar fixed on left */
.main-sidebar {
  position: fixed;
  top: 50px;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 810;
  scroll-behavior: smooth;
}

/* Adjust content wrapper for fixed header/sidebar */
.content-wrapper {
  background: transparent;
  margin-top: 50px;
  margin-left: 230px;
  min-height: calc(100vh - 50px);
  transition: margin-left 0.3s ease;
}

/* Content header - removed duplicate, consolidated below */

/* Add shadow when scrolling */
.content-header.scrolled {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Adjust for collapsed sidebar */
.sidebar-collapse .content-wrapper {
  margin-left: 50px;
}

.sidebar-collapse .main-sidebar {
  width: 50px;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .content-wrapper {
    margin-left: 0;
    margin-top: 50px;
  }

  .main-sidebar {
    left: -230px;
    transition: left 0.3s ease;
  }

  .sidebar-open .main-sidebar {
    left: 0;
  }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
}

/* ========================================
   MODERN DASHBOARD CARDS
   ======================================== */
.info-box {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: none;
  transition: var(--transition);
  background: white;
  overflow: hidden;
  position: relative;
  margin-bottom: 25px;
}

.info-box:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.info-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}

.info-box:hover::before {
  opacity: 1;
}

.info-box-icon {
  border-radius: var(--radius-md) 0 var(--radius-md) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 45px;
  transition: var(--transition);
}

/* Modern gradient backgrounds for info boxes */
.info-box-icon.bg-aqua {
  background: var(--info-gradient) !important;
}

.info-box-icon.bg-yellow {
  background: var(--warning-gradient) !important;
}

.info-box-icon.bg-red {
  background: var(--danger-gradient) !important;
}

.info-box-icon.bg-green {
  background: var(--success-gradient) !important;
}

.info-box-icon.bg-purple {
  background: var(--primary-gradient) !important;
}

.info-box:hover .info-box-icon {
  transform: scale(1.1) rotate(5deg);
}

.info-box-content {
  padding: 20px 15px;
}

.info-box-number {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

.info-box-text {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ========================================
   MODERN BOXES & CARDS
   ======================================== */
.box {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: none;
  transition: var(--transition);
  background: white;
  margin-bottom: 25px;
}

.box:hover {
  box-shadow: var(--shadow-lg);
}

.box-header {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #e8e8e8;
}

.box-header.with-border {
  border-bottom: 2px solid #e8e8e8;
}

.box-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.box-body {
  padding: 25px;
}

.box-footer {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 15px 20px;
  background: #f8f9fa;
}

/* ========================================
   MODERN BUTTONS
   ======================================== */
.btn {
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  border: none;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-success {
  background: var(--success-gradient);
  color: white;
}

.btn-danger {
  background: var(--danger-gradient);
  color: white;
}

.btn-warning {
  background: var(--warning-gradient);
  color: white;
}

.btn-info {
  background: var(--info-gradient);
  color: white;
}

/* Outline buttons */
.btn-outline-primary {
  background: transparent;
  border: 2px solid #11998e;
  color: #11998e;
}

.btn-outline-primary:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

/* ========================================
   MODERN HEADER & NAVBAR
   ======================================== */
.main-header {
  box-shadow: var(--shadow-md);
  border-bottom: none;
}

.main-header .logo {
  /* Background color controlled by skin classes */
  border-right: none;
  font-weight: 700;
  transition: var(--transition);
}

.main-header .logo:hover {
  opacity: 0.95;
}

.main-header .navbar {
  background: white;
  box-shadow: var(--shadow-sm);
}

.navbar-custom-menu > .navbar-nav > li > a {
  transition: var(--transition);
}

.navbar-custom-menu > .navbar-nav > li > a:hover {
  background: rgba(17, 153, 142, 0.1);
}

/* ========================================
   MODERN SIDEBAR - Complete Redesign
   ======================================== */
/* Keep dynamic skin colors, just add modern enhancements */
.main-sidebar {
  box-shadow: var(--shadow-lg);
  /* Background color controlled by skin classes (skin-blue, skin-black, etc.) */
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(17, 153, 142, 0.5);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 153, 142, 0.8);
}

/* Modern User Panel - Vertical Centered Layout */
.user-panel {
  padding: 15px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-panel:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* User Panel Image - Centered on Top */
.user-panel-image {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-panel-image img {
  border: 3px solid rgba(17, 153, 142, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  width: 50px;
  height: 50px;
}

.user-panel:hover .user-panel-image img {
  border-color: rgba(17, 153, 142, 0.8);
  transform: scale(1.05);
}

/* User Panel Info - Centered Below Image */
.user-panel-info {
  width: 100%;
  text-align: center;
}

.user-panel-info p {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  color: #2d9d91;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-panel-info a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.user-panel-info a:hover {
  color: rgba(17, 153, 142, 1);
}

/* Enhanced Sidebar Menu */
.sidebar-menu {
  padding-top: 5px;
}

.sidebar-menu > li {
  margin-bottom: 2px;
}

.sidebar-menu > li > a {
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.sidebar-menu > li > a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(17, 153, 142, 0.1);
  transition: width 0.3s ease;
}

.sidebar-menu > li > a:hover::before {
  width: 100%;
}

.sidebar-menu > li > a:hover {
  border-left-color: rgba(17, 153, 142, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu > li.active > a {
  font-weight: 700;
  border-left-color: #11998e;
  background: rgba(17, 153, 142, 0.35);
  color: #ffffff;
  box-shadow: inset 0 0 20px rgba(17, 153, 142, 0.2);
}

.sidebar-menu > li.active > a::before {
  width: 100%;
}

/* Enhanced Icons */
.sidebar-menu .fa,
.sidebar-menu .ion {
  margin-right: 15px;
  width: 20px;
  text-align: center;
  opacity: 0.85;
  transition: all 0.3s ease;
  font-size: 16px;
}

.sidebar-menu > li > a:hover .fa,
.sidebar-menu > li > a:hover .ion {
  opacity: 1;
  transform: scale(1.15) rotate(5deg);
}

.sidebar-menu > li.active > a .fa,
.sidebar-menu > li.active > a .ion {
  opacity: 1;
  color: #38ef7d;
  text-shadow: 0 0 10px rgba(56, 239, 125, 0.5);
}

/* Treeview Menu Enhancements */
.sidebar-menu .treeview-menu {
  background: rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  margin: 5px 0;
}

.sidebar-menu .treeview-menu > li {
  margin: 2px 0;
}

.sidebar-menu .treeview-menu > li > a {
  padding: 10px 20px 10px 45px;
  font-size: 13px;
  font-weight: 400;
  transition: var(--transition);
  border-left: 2px solid transparent;
  position: relative;
}

.sidebar-menu .treeview-menu > li > a::before {
  content: '›';
  position: absolute;
  left: 30px;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.sidebar-menu .treeview-menu > li > a:hover::before {
  left: 32px;
  opacity: 1;
  color: #38ef7d;
}

.sidebar-menu .treeview-menu > li > a:hover {
  padding-left: 48px;
  background: rgba(17, 153, 142, 0.1);
  border-left-color: rgba(17, 153, 142, 0.5);
}

.sidebar-menu .treeview-menu > li.active > a {
  font-weight: 600;
  background: rgba(17, 153, 142, 0.35);
  border-left-color: #38ef7d;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Treeview Arrow Animation */
.sidebar-menu .treeview > a > .pull-right-container > .fa-angle-left {
  transition: transform 0.3s ease;
}

.sidebar-menu .treeview.active > a > .pull-right-container > .fa-angle-left {
  transform: rotate(-90deg);
}

/* Modern Labels/Badges */
.sidebar-menu .label,
.sidebar-menu .badge {
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: pulse 2s infinite;
}

.sidebar-menu .label-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.sidebar-menu .label-primary {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.sidebar-menu .label-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.sidebar-menu .label-warning {
  background: linear-gradient(135deg, #f7b733 0%, #fc4a1a 100%);
}

.sidebar-menu .label-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

/* Sidebar Header (if any) */
.sidebar-menu .header {
  padding: 15px 20px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10px;
}

/* Responsive Sidebar */
@media (max-width: 767px) {
  .user-panel {
    padding: 15px 10px;
  }

  .sidebar-menu > li > a {
    padding: 12px 15px;
  }
}

/* ========================================
   MODERN FORMS
   ======================================== */
.form-control {
  border-radius: var(--radius-sm);
  border: 2px solid #e8e8e8;
  /*padding: 12px 16px;*/
  transition: var(--transition);
  font-size: 14px;
}

.form-control:focus {
  border-color: #11998e;
  box-shadow: 0 0 0 3px rgba(17, 153, 142, 0.1);
  outline: none;
}

.input-group-addon {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #e8e8e8;
  border-right: none;
}

.form-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 8px;
}

/* ========================================
   MODERN TABLES
   ======================================== */
.table {
  border-radius: var(--radius-md);
  overflow: visible;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Table wrapper to handle border radius without clipping dropdowns */
.table-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-wrapper .table {
  margin-bottom: 0;
  box-shadow: none;
}

/* Modern table header - Default green theme */
.table thead th {
  background: linear-gradient(135deg, #11998e 0%, #2d9d91 100%);
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  border: none;
  padding: 18px 16px;
  text-align: left;
  white-space: nowrap;
  position: relative;
}

.table thead th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
}

/* Override for bg-primary class - Better design */
.table thead th.bg-primary,
thead.bg-primary th,
.bg-primary {
  background: linear-gradient(135deg, #0d7a6f 0%, #11998e 100%) !important;
  color: white !important;
  border: none !important;
}

/* Alternative header styles */
.table thead.table-header-light th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #2d3748;
  border-bottom: 3px solid #11998e;
}

.table thead.table-header-dark th {
  background: linear-gradient(135deg, #2d3748 0%, #1a1d29 100%);
  color: white;
}

/* Table body improvements */
.table tbody tr {
  transition: var(--transition);
  border-bottom: 1px solid #f0f0f0;
  background: white;
}

.table tbody tr:hover {
  background: linear-gradient(90deg, rgba(17, 153, 142, 0.08) 0%, rgba(17, 153, 142, 0.02) 100%);
  box-shadow: -4px 0 0 0 #11998e;
}

.table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.table tbody tr:nth-child(even):hover {
  background: linear-gradient(90deg, rgba(17, 153, 142, 0.08) 0%, rgba(17, 153, 142, 0.02) 100%);
}

.table tbody td {
  padding: 16px;
  vertical-align: middle;
  font-size: 14px;
  color: #2d3748;
  border: none;
}

/* Table striped enhancement */
.table-striped tbody tr:nth-of-type(odd) {
  background: white;
}

.table-striped tbody tr:nth-of-type(even) {
  background: rgba(17, 153, 142, 0.03);
}

/* Table bordered */
.table-bordered {
  border: 1px solid #e8e8e8;
  border-radius: var(--radius-md);
}

.table-bordered thead th {
  border: none;
}

.table-bordered tbody td {
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.table-bordered tbody td:last-child {
  border-right: none;
}

.table-bordered tbody tr:last-child td {
  border-bottom: none;
}

/* DataTables specific */
.dataTable {
  border-collapse: separate !important;
  border-spacing: 0;
}

.dataTables_wrapper .dataTable thead th {
  background: linear-gradient(135deg, #11998e 0%, #2d9d91 100%);
  color: white;
  font-weight: 700;
  border: none;
}

/* Table action buttons */
.table .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  margin: 0 2px;
  line-height: 1.2;
}

/* Table button groups - compact sizing */
.table .btn-group .btn {
  padding: 4px 8px;
  font-size: 11px;
}

.table .dropdown-toggle {
  padding: 4px 8px;
  font-size: 11px;
}

/* Table badges in cells */
.table .badge,
.table .label {
  font-size: 11px;
  padding: 5px 10px;
}

/* Responsive table wrapper */
.table-responsive {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   MODERN MODALS
   ======================================== */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: var(--primary-gradient);
  color: white;
  padding: 20px 25px;
  border-bottom: none;
}

.modal-title {
  font-weight: 700;
  font-size: 22px;
}

.modal-body {
  padding: 30px 25px;
}

.modal-footer {
  background: #f8f9fa;
  padding: 15px 25px;
  border-top: none;
}

.close {
  color: white;
  opacity: 0.9;
  text-shadow: none;
  transition: var(--transition);
}

.close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* ========================================
   MODERN ALERTS
   ======================================== */
.alert {
  border-radius: var(--radius-md);
  border: none;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
}

.alert-success {
  background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
  border-left-color: #11998e;
  color: #0a6b62;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(235, 51, 73, 0.1) 0%, rgba(244, 92, 67, 0.1) 100%);
  border-left-color: #eb3349;
  color: #b8242f;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
  border-left-color: #f093fb;
  color: #b8576c;
}

.alert-info {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
  border-left-color: #4facfe;
  color: #2774b8;
}

/* ========================================
   MODERN BADGES & LABELS
   ======================================== */
.badge,
.label {
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
}

.badge-primary,
.label-primary {
  background: var(--primary-gradient) !important;
  color: white !important;
  border: none !important;
}

.badge-success,
.label-success {
  background: var(--success-gradient) !important;
  color: white !important;
}

.badge-danger,
.label-danger {
  background: var(--danger-gradient) !important;
  color: white !important;
}

.badge-warning,
.label-warning {
  background: var(--warning-gradient) !important;
  color: white !important;
}

.badge-info,
.label-info {
  background: var(--info-gradient) !important;
  color: white !important;
}

/* Background color classes - Override Bootstrap */
.bg-primary {
  background: linear-gradient(135deg, #11998e 0%, #2d9d91 100%) !important;
  color: white !important;
}

.bg-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%) !important;
  color: white !important;
}

.bg-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%) !important;
  color: white !important;
}

.bg-warning {
  background: linear-gradient(135deg, #f7b733 0%, #fc4a1a 100%) !important;
  color: white !important;
}

.bg-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  color: white !important;
}

/* ========================================
   MODERN PAGINATION
   ======================================== */
.pagination > li > a,
.pagination > li > span {
  border-radius: var(--radius-sm);
  margin: 0 4px;
  border: 2px solid #e8e8e8;
  color: var(--text-primary);
  transition: var(--transition);
  font-weight: 600;
}

.pagination > li > a:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

.pagination > .active > a {
  background: var(--primary-gradient);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* ========================================
   MODERN BREADCRUMB
   ======================================== */
.breadcrumb {
  background: transparent;
  padding: 12px 0;
  border-radius: var(--radius-sm);
}

.breadcrumb > li + li:before {
  content: "→";
  padding: 0 8px;
  color: #11998e;
}

/* ========================================
   LOADING & ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-box,
.box {
  animation: fadeInUp 0.5s ease-out;
}

.content {
  animation: fadeInUp 0.6s ease-out;
}

/* Pulse animation for important elements */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* ========================================
   MODERN DROPDOWN
   ======================================== */
.dropdown-menu {
  border-radius: var(--radius-md);
  border: none;
  box-shadow: var(--shadow-xl);
  padding: 8px 0;
  margin-top: 8px;
  z-index: 9999 !important;
  position: absolute !important;
}

.dropdown-menu > li > a {
  padding: 12px 20px;
  transition: var(--transition);
}

.dropdown-menu > li > a:hover {
  background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
  color: #11998e;
}

/* Fix dropdown positioning in tables */
.table .dropdown,
.table .btn-group {
  position: relative !important;
}

.table .dropdown-menu,
.table .btn-group .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: auto !important;
  right: 0 !important;
  z-index: 9999 !important;
  margin-top: 2px !important;
  will-change: transform;
  display: none;
}

.table .dropdown.open .dropdown-menu,
.table .btn-group.open .dropdown-menu {
  display: block !important;
}

/* Ensure dropdowns are not clipped */
.table-responsive {
  overflow: visible !important;
}

.dataTables_wrapper {
  overflow: visible !important;
}

.box-body {
  overflow: visible !important;
}

/* Fix for action button dropdowns */
.btn-group.open .dropdown-menu {
  display: block !important;
  position: absolute !important;
  top: 100% !important;
  bottom: auto !important;
  left: auto !important;
  right: 0 !important;
  z-index: 9999 !important;
  transform: translateY(0) !important;
  animation: dropdownSlideDown 0.2s ease;
  margin-top: 2px;
}

/* Force dropdown to appear below button, not under other buttons */
.table td .btn-group,
.table td .dropdown {
  position: relative !important;
  z-index: 1;
}

.table td .btn-group.open,
.table td .dropdown.open {
  z-index: 10000 !important;
}

.table td .btn-group.open .dropdown-menu,
.table td .dropdown.open .dropdown-menu {
  position: absolute !important;
  z-index: 10001 !important;
}

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

/* Dropdown button improvements */
.btn-group .btn {
  position: relative;
  z-index: 1;
}

.btn-group.open .btn {
  z-index: 9998;
}

/* Pull-right dropdown fix */
.dropdown-menu.pull-right {
  right: 0;
  left: auto;
}

.dropdown-menu.dropdown-light {
  background: white;
  border: 1px solid #e8e8e8;
}

/* Prevent body overflow issues */
body.modal-open {
  overflow: hidden !important;
}

/* DataTables wrapper overflow fix */
.dataTables_wrapper .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

/* Table container overflow */
.table-container {
  overflow: visible !important;
}

.panel-body,
.box-body {
  position: relative;
  overflow: visible !important;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.gradient-primary { background: var(--primary-gradient) !important; color: white; }
.gradient-success { background: var(--success-gradient) !important; color: white; }
.gradient-danger { background: var(--danger-gradient) !important; color: white; }
.gradient-warning { background: var(--warning-gradient) !important; color: white; }
.gradient-info { background: var(--info-gradient) !important; color: white; }

/* ========================================
   CONTENT HEADER
   ======================================== */
.content-header {
  padding: 15px 20px;
  background: white;
  margin: 0 0 15px 0;
  border-bottom: 2px solid rgba(17, 153, 142, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.content-header h1 {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 26px;
  margin: 0;
  line-height: 1.3;
  flex: 1;
  min-width: 200px;
}

.content-header h1 small {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  display: block;
  margin-top: 5px;
}

/* Content header breadcrumb alignment */
.content-header .breadcrumb {
  margin: 0;
  background: transparent;
  padding: 0;
}

/* ========================================
   SCROLL TO TOP BUTTON
   ======================================== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
  transition: all 0.3s ease;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE IMPROVEMENTS
   ======================================== */
@media (max-width: 768px) {
  .info-box {
    margin-bottom: 15px;
  }

  .box {
    margin-bottom: 15px;
  }

  .content-header {
    padding: 20px 15px;
    flex-direction: column;
    align-items: flex-start;
  }

  .content-header h1 {
    font-size: 20px;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here for future enhancement */
}
