/* Modern CSS Variables for Theming */
:root {
  --primary-color: #06296e;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-color: #3a7bd5;
  --accent-color: #f5c122;
  --dark-bg: #00283b;
  --dark-hover: #0f4e67;
  --light-bg: #f8f9fa;
  --border-color: #e2e6ea;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --border-radius-sm: 8px;
}

/* Modern Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.border_bottom {
  border-bottom: 1px solid var(--border-color);
}

.pointer {
  cursor: pointer;
}

.font-italic {
  font-style: italic !important;
}

/* Modern Header */
.header-custom {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

/* DataTables Modern Styling */
.dataTables_processing {
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  border-radius: var(--border-radius-sm);
}

/* Autocomplete Modern */
.ui-autocomplete {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
}

.ui-autocomplete-loading {
  background: white url("../../plugins/autocomplete/loader2.gif") right center no-repeat;
}

/* Modern Color Palette */
.bg-dream-blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.bg-dream-red {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

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

.bg-dream-purple {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
}

.bg-dream-pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.bg-dream-maroon {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
  color: white;
}

/* Modern Select2 Readonly */
select[readonly].select2 + .select2-container {
  pointer-events: none;
  touch-action: none;
}

select[readonly].select2 + .select2-container .select2-selection {
  background: var(--light-bg);
  box-shadow: none;
  opacity: 0.7;
}

select[readonly].select2 + .select2-container .select2-selection__arrow,
select[readonly].select2 + .select2-container .select2-selection__clear {
  display: none;
}

/* Modern Gradient Buttons */
.btn-grad {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

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

.btn-grad::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

.btn-grad:hover::before {
  left: 100%;
}

/* Modern Dashboard Backgrounds */
.bg-1, .bg-2, .bg-3, .bg-4, .bg-5 {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.bg-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bg-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.bg-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.bg-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.bg-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.bg-1:hover, .bg-2:hover, .bg-3:hover, .bg-4:hover, .bg-5:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Modern Info Boxes */
.info-box {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.info-box-icon {
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.info-box-number {
  font-weight: 700;
  font-size: 1.5rem;
}

.info-box-text {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Modern Small Boxes */
.small-box {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.small-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.small-box-footer {
  transition: var(--transition);
}

.small-box:hover .small-box-footer {
  background: rgba(0, 0, 0, 0.1);
}

/* Modern Table Styling */
.custom_table_header {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.custom_hover > tbody > tr {
  transition: var(--transition);
}

.custom_hover > tbody > tr:hover {
  background-color: var(--light-bg);
  box-shadow: var(--shadow-sm);
  transform: scale(1.01);
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Modern Sidebar Styling */
.skin-blue .wrapper,
.skin-blue .main-sidebar,
.skin-blue .left-side {
  background-color: var(--dark-bg);
}

.skin-blue .sidebar-menu > li > a {
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.skin-blue .sidebar-menu > li:hover > a,
.skin-blue .sidebar-menu > li.active > a {
  color: #fff;
  background: var(--dark-hover);
  border-left-color: var(--accent-color);
}

.skin-blue .sidebar-menu > li > .treeview-menu {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  margin: 4px 8px;
  padding: 4px 0;
}

/* Modern Header */
.skin-blue .main-header .navbar,
.skin-blue .main-header .logo,
.skin-blue .main-header .logo:hover,
.skin-blue .main-header li.user-header {
  background-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Modern Inbox Widget */
.inbox-widget .inbox-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.inbox-widget .inbox-item:hover {
  background-color: var(--light-bg);
}

.inbox-widget .inbox-item .inbox-item-img img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.inbox-widget .inbox-item .inbox-item-date {
  background-color: var(--light-bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Modern Control Sidebar */
.control-sidebar-dark,
.control-sidebar-dark + .control-sidebar-bg {
  background: white;
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border-color);
}

/* Modern Form Inputs */
input:focus,
textarea:focus,
select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus {
  background-color: white !important;
  border-color: var(--secondary-color) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.1);
}

/* Modern Form Controls */
.form-control {
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.form-control:hover {
  border-color: #c4c9d0;
}

/* Smooth Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --border-radius: 8px;
    --border-radius-sm: 6px;
  }
  
  .info-box-text {
    font-size: 0.75rem;
  }
  
  .info-box-number {
    font-size: 1.25rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #1a1a1a;
    --border-color: #333;
  }
}