.tab-container {
  position: relative;
  top: 50px;
  left: 50%;
  border-radius: 0.5rem;
  transform: translateX(-50%);
  width: 100%;
  overflow: visible;
  z-index: 10;
}

.tabs-wrapper {
  position: relative;
  height: auto;
}

.tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
  transition: transform 1s ease, opacity 0.8s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.inactive-left,
.inactive-right {
  filter: drop-shadow(0px 12px 16px rgba(0, 0, 0, 0.4));
  cursor: pointer;
}

@media (max-width: 767px) {
  .tab-pane {
    display: flex;
    justify-content: center;
    align-items: start;
  }

  #tabButtons {
    justify-content: center;
  }
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(1);
  background-color: transparent;
  outline: none !important;
  color: #00babd;
  border: none;
  font-size: 2rem;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 11;
  border-radius: 0.5rem;
  user-select: none;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.nav-arrow:hover {
  color: #a400fc;
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
}
.nav-arrow.left {
  left: 10px;
}

.nav-arrow.right {
  right: 10px;
}

.schedule-table {
  width: 100%;
  table-layout: fixed;
  max-width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.65rem !important;
  background-color: var(--table-bg, white) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  opacity: 0.7;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.schedule-table:hover {
  transform: scale(1.02);
  opacity: 1;
  z-index: 2;
  position: relative;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid var(--table-border, #a400fc1d) !important;
  padding-top: 4px !important;
  padding-bottom: 0px !important;
  text-align: center !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
  width: 50px !important;
  max-width: 50px !important;
}

body.dark-mode .schedule-table {
  --table-bg: #1e1e1e;
  --table-header-bg: #2c2c2c;
  --table-border: #444;
  color: #ddd;
}

body.dark-mode .schedule-table td,
body.dark-mode .schedule-table th {
  color: #ddd;
}

.badge {
  display: inline-block;
  border-radius: 12px;
  color: rgb(255, 255, 255);
  font-size: 0.6rem;
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: transform 0.25s ease, opacity 0.3s ease;
  will-change: transform;
  font-weight: 400;
}

input[type="range"] {
  width: 100px;
}

.text-center {
  text-align: center;
}

.schedule-table td.shift-cell,
.schedule-table th:nth-child(2) {
  width: 20px !important;
  max-width: 20px !important;
  min-width: 20px !important;
}

.schedule-table th {
  white-space: pre-line !important;
}

#addRow {
  background-color: #a400fc1d;
  transition: background-color 0.3s ease;
}

#addRow:hover {
  background-color: rgba(0, 255, 0, 0.2);
}

td {
  position: relative;
}

.schedule-table td.empty:hover::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #00bb0020;
  color: #0a0;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
}

td.assigned:hover .remove-btn {
  display: inline-block;
}

.remove-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #ff000033;
  color: red;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  display: none;
  z-index: 2;
}

td.assigned:hover .badge {
  transform: scale(1.1);
  z-index: 1;
  cursor: pointer;
}

td.drop-target {
  background-color: #00ff0055 !important;
  outline: 2px dashed #00bb00;
}

input[type="range"].colorized::-webkit-slider-thumb {
  transition: background 0.3s;
}

input[type="range"] {
  accent-color: #a400fc;
}

#addRow td:first-child {
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#addRow td:first-child:hover {
  transform: scale(1.1);
  background-color: #00fc2678;
  color: white;
}

.schedule-table th.date-header {
  background-color: #f4f4ff;
}

.driver-grid thead tr th,
body.dark-mode .schedule-table th.date-header {
  background-color: #2b2b3a;
}

.schedule-table td.car-col,
.schedule-table th:first-child {
  background-color: #e8e0f7;
  font-weight: 600;
}

.schedule-table td.shift-col,
.schedule-table th:nth-child(2) {
  background-color: #f0f8ff;
  font-weight: 500;
}

.driver-grid table tbody tr td:first-child,
body.dark-mode .schedule-table td.car-col,
body.dark-mode .schedule-table th:first-child {
  background-color: #a400fc1d;
}

body.dark-mode .schedule-table td.shift-col,
body.dark-mode .schedule-table th:nth-child(2) {
  background-color: #2b2b3a;
}

#welcomeCard {
  background: linear-gradient(270deg, #a400fc, #00babd, #007bff);
  background-size: 600% 600%;
  animation: animatedGradient 60s ease infinite;
  border-radius: 0.5rem !important;

  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.2),
    0 16px 40px rgba(0, 0, 0, 0.15);
  transform: translateZ(0);
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

@media (hover: hover) {
  #welcomeCard:hover {
    transform: perspective(1000px) rotateX(1.2deg) rotateY(-1.2deg);
    box-shadow: 0 4px 8px #ce73ff5a, 0 4px 16px #a400fcc0;
  }
}

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

#shiftPieChart {
  width: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  height: 100% !important;
  min-width: 30px !important;
  align-items: center;
  justify-content: center;
}

.shift-1 td,
td.shift-1 {
  background-color: #e0a6ff17;
}

.shift-2 td,
td.shift-2 {
  background-color: #c04aff17;
}

.shift-3 td,
td.shift-3 {
  background-color: #a400fc17;
}

#carProgressBars .progress {
  transition: opacity 0.2s ease;
}

#carProgressBars span {
  transition: font-size 0.2s ease;
}

.color-pill {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.driver-grid th,
.driver-grid td {
  text-align: center;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.driver-grid th:hover,
.driver-grid td:hover {
  transform: scale(1.06);
  z-index: 2;
  position: relative;
}

.rounded {
  border-radius: 0.5rem !important;
  overflow: hidden;
}

.driver-grid thead tr th {
  border-bottom: none !important;
}

.adjacent-info-card .card-body {
  padding: 0.5rem 0.75rem !important;
}

.driver-grid table {
  border-radius: 12px;
  overflow: hidden;
  table-layout: fixed;
}

.custom-list {
  list-style-type: none;
  padding-left: 1.2rem;
}

.custom-list li {
  will-change: transform;
  margin-bottom: 0.5rem;
  transform: scale(1);
}

.custom-list li:hover {
  transform: scale(1.03);
  z-index: 1;
  position: relative;
}

.custom-list li:last-child {
  margin-bottom: 0;
}

.card,
.shift-card {
  transition: transform 0.25s ease;
  opacity: 0.75;
}

.card:hover,
.shift-card:hover {
  transform: scale(1.03);
  opacity: 1;
}

.dark-mode .card-body {
  background-color: #1212126b !important;
}

.driver-grid table,
.driver-grid th,
.driver-grid td {
  transition: transform 0.25s ease, opacity 0.25s ease;
  border: 1px solid #a400fc1d;
  border-collapse: collapse;
  opacity: 0.7;
}

body:not(.dark-mode) .driver-grid thead tr th {
  background-color: #a400fc4b !important;
  color: white !important;
}

.dimmed {
  opacity: 0.25 !important;
  transition: opacity 0.3s ease-in-out;
}

#scheduleBody td,
.custom-list li {
  transition: opacity 0.35s ease-in-out, transform 0.35s ease-in-out;
}

.highlighted {
  opacity: 1 !important;
}

.driver-grid table:hover {
  transform: scale(1.02);
  opacity: 1;
  z-index: 2;
  position: relative;
}

.fade-in-element {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 1s ease;
}

.fade-in-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.badge.dimmed {
  opacity: 0.25;
}

.car-name {
  transition: all 0.2s ease;
}

#scheduleBody td[rowspan].hover-simulated {
  background-color: #00babd22 !important;
  transition: background-color 0.2s ease, transform 0.2s ease;
  transform: scale(1.06);
  z-index: 2;
  position: relative;
}

.zoom-float {
  animation: endlessZoom 30s ease-in-out infinite;
  transform-origin: center center;
  display: inline-block;
}

@keyframes endlessZoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.emoji-add {
  font-size: 1.5em;
  cursor: pointer;
}

.emoji-menu button {
  font-size: 1em;
  width: 100%;
}

.emoji-label-badge {
  font-size: 1.2em;
  padding: 4px 8px;
}

.emoji-remove {
  font-size: 0.75em !important;
  line-height: 1;
  margin-left: 5px;
  background-color: transparent !important;
}

.emoji-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

#driverGridTabs {
  justify-content: center;
  margin-top: 1rem;
}

#driverGridTabs .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
}

.driver-grid td.empty .emoji-add {
  display: inline-block;
  transition: transform 0.25s ease;
}

.driver-grid td.empty:hover .emoji-add {
  transform: scale(1.3);
}

#tabButtons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0 0 10px 10px;
}

.tab-btn.active {
  color: white;
  font-weight: bold;
  border: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.tab-btn {
  background: none !important;
  border: none;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  transition: background 0.5s ease, transform 0.3s ease;
}

.tab-btn.active.tab-grafik {
  background-color: #007bff !important;
}

.tab-btn.active.tab-statystyki {
  background-color: #00babd !important;
}

.tab-btn.active.tab-protokoly {
  background-color: #a400fc !important;
}

.tab-btn:hover {
  filter: brightness(1.1) !important;
  transform: scale(1.1) !important;
}

#shiftLineChart {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  opacity: 0.15;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.question {
  transition: transform 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.question:hover {
  transform: scale(1.02);
}

.checklist-checkbox {
  accent-color: #00babd;
}

h6 {
  transition: color 0.3s ease;
}

.tiltable-wrapper {
  perspective: 1200px;
  perspective-origin: center;
  display: inline-block;
}

.tiltable {
  transform-style: preserve-3d;
  position: relative;
  will-change: transform, box-shadow;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tiltable-child {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform, box-shadow;
}

.tiltable-text {
  display: inline-block;
  transition: transform 0.2s ease, text-shadow 0.2s ease;
  will-change: transform, text-shadow;
}

.tiltable-child.elevated {
  transform: translateZ(40px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.tiltable-text.elevated {
  transform: translateZ(40px);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.inactive-pane {
  opacity: 0.25;
  transform: perspective(800px) rotateX(30deg) scale(0.98);
  filter: drop-shadow(0px 12px 16px rgba(0, 0, 0, 0.4));
  z-index: 0;
  transition: transform 1s ease, opacity 0.8s ease, filter 0.8s ease;
  pointer-events: none;
}

.bit-logo {
  transition: transform 0.3s ease !important;
}

.bit-logo:hover {
  transform: scale(1.1) !important;
}
