/* Modern styling overrides */
:root {
  --bg-color: rgb(255, 255, 255);
  --text-color: #333;
  --navbar-bg: #fff;
  --navbar-border: #eaeaea;
  --table-bg: #fff;
  --table-header-bg: #f1f1f1;
  --table-hover-bg: rgba(0,0,0,0.02);
  --border-color: #eaeaea;
  --input-border: grey;
  --footer-text: #999;
  --secondary-text: #666;
  --accent-color: #D60824;
}

.dark-mode {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --navbar-bg: #1e1e1e;
  --navbar-border: #333;
  --table-bg: #1e1e1e;
  --table-header-bg: #2a2a2a;
  --table-hover-bg: rgba(255,255,255,0.05);
  --border-color: #333;
  --input-border: #555;
  --footer-text: #888;
  --secondary-text: #aaa;
  --accent-color: #ff435c;
}

/* Custom styling for the navbar logo in dark mode */
.dark-mode #navbar-logo {
  /* Use a drop-shadow filter to create a white glow around the logo */
  filter: drop-shadow(0 0 1px white) drop-shadow(0 0 1px white) brightness(1.2);
  /* Increase opacity to make it more visible */
  opacity: 0.9;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-top: 60px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar-default {
  background-color: var(--navbar-bg);
  border-color: var(--navbar-border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-default .navbar-brand {
  color: var(--accent-color);
  font-weight: 100;
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.navbar-default .navbar-nav > li > a {
  color: var(--text-color);
  font-weight: 500;
  padding: 15px 20px;
  transition: color 0.3s ease;
}

.navbar-default .navbar-nav > li > a:hover {
  background-color: rgba(0,0,0,0.03);
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.brand-logo {
  width: 24px;
  margin-bottom: 5px;
}

.page-header {
  border-bottom: none;
  margin-top: 0;
  padding-bottom: 0;
}

.page-header h2 {
  font-size: 2.5rem;
  font-weight: 100 !important;
  margin-bottom: 10px;
}

.page-header h4 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--secondary-text);
  transition: color 0.3s ease;
}

#main {
  margin-bottom: 40px;
}

hr{
  width: 100%;
}

.table {
  background-color: var(--table-bg);
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-top: 1.5rem;
  border-collapse: separate;
  border-spacing: 0;
}

.table > thead > tr > th {
  background-color: var(--table-header-bg);
  border-bottom: 2px solid var(--accent-color);
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  padding: 15px 10px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.table > tbody > tr > td {
  padding: 12px 10px;
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.table-hover > tbody > tr:hover {
  background-color: var(--table-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.table-bordered {
  border: 1px solid var(--border-color);
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border: 1px solid var(--border-color);
}

/* Alternating row colors for better readability */
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,0.02);
}

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

#loading-image {
  color: var(--accent-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  transition: color 0.3s ease;
}

footer {
  display: block;
  text-align: center;
  color: var(--footer-text);
  padding: 20px 0;
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin-bottom: 25px;
}

.search-wrapper input[type=search] {
  -webkit-appearance: none;
  width: 100%;
  max-width: 100%;
  height: 45px;
  font-size: 16px;
  border: solid 1px var(--input-border);
  padding-left: 10px;
  padding-right: 40px; /* space for icon */
  border-radius: 10px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.search-wrapper input[type=search]::placeholder {
  font-size: clamp(12px, 0.875rem, 16px);
}

.search-wrapper .search-icon {
  position: absolute;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 18px;
  color: var(--input-border);
  transition: color 0.3s ease;
}
.search-wrapper svg.search-icon {
  position: absolute;
  right: 12px;
  top: 32%;
  transform: translateY(-50%);
  pointer-events: none;
}


input[type="search"] {
  -webkit-appearance: none;
  width: 100%;
  min-width:320px;
  max-width: 850px;
  height: 45px;
  /* font-size: 16px; */
  border: solid 1px var(--input-border);
  padding-left: 10px;
  padding-right: 40px; /* space for icon */
  border-radius: 10px;
  background-color: var(--bg-color);
  color: var(--text-color);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='gray' viewBox='0 0 24 24'><path d='M10 2a8 8 0 105.293 14.293l5.707 5.707 1.414-1.414-5.707-5.707A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/></svg>") no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input[type="search"]::placeholder {
  font-size: clamp(10px, 0.95rem, 16px);
}

#escalation_filter{
  place-self: center;
  margin-bottom: 25px;
}

div#escalation_paginate {
  margin-left: -5px;
  margin-top: 10px;
}

.jss-enum{
  text-align: end;
  position: relative;
  float: right;
  top: -50px;
  right: 30px;
}

.dataTables_length {
  place-self: anchor-center;
  float: none !important;
}

/* Override anchor styles to use CSS variables */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--accent-color);
  text-decoration: none;
  opacity: 0.8;
}

/* Form elements styling for dark mode */
.dark-mode button,
.dark-mode input,
.dark-mode select,
.dark-mode textarea {
  background-color: #000;
  color: var(--text-color);
  border-color: var(--input-border);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

iframe{
  height: 500px !important;
}

img.loaded {
  height: 24px;
  width: 24px;
  margin-left: 3px;
}

img.error {
  height: 24px;
  width: 24px;
  margin-left: 3px;
  filter: grayscale(100%);
}

td.sorting_1 {
  text-align-last: center;
}