html {
     position: relative;
     min-height: 100%;
}

/* Bootstrap 5 overrides - restore BS3-like link appearance */
a {
    color: #337ab7;
    text-decoration: none;
}

a:hover, a:focus {
    color: #23527c;
    text-decoration: underline;
}

/* Restore BS3-like .well appearance (BS5 uses card p-3 as replacement) */
.card.p-3 {
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
}

/* Sidebar submenu nav (admin / vystupy tabs) - restore BS3 sidebar appearance */
.nav-sidebar {
    margin-bottom: 20px;
    padding-left: 0;
    list-style: none;
    flex-direction: column;
}

.nav-sidebar > li > a {
    display: block;
    padding: 4px 10px;
    border-radius: 3px;
    color: #337ab7;
    text-decoration: none;
}

.nav-sidebar > li > a:hover,
.nav-sidebar > li > a:focus {
    background-color: #e8e8e8;
    color: #23527c;
    text-decoration: none;
}

.nav-sidebar > li.active > a,
.nav-sidebar > li.active > a:hover {
    background-color: #337ab7;
    color: #fff;
}

/* Nav tabs - bottom border only, no gap below */
.nav-tabs {
    border-bottom: 1px solid #ddd;
    margin-bottom: 0 !important;
}

.nav-tabs .nav-link {
    color: #337ab7;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    color: #23527c;
}

.nav-tabs .nav-link.active {
    color: #555;
}

body {
     margin-bottom: 60px; /* Margin bottom by footer height */
     font-size: small;
}

/* Fixed table */
.table-fixed thead {
  top: 0;
  position: sticky;
}

.header img {
  float: left;
  width: 32px;
  margin-top: 10px;
}

.header h1 {
  position: relative;
  left: 10px;
  padding-top: 8px;
}

/* Tables - restore BS3-like gray borders */
.table-bordered,
.table-bordered > :not(caption) > * > * {
    border-color: #ddd;
}

/* Constrain form inputs inside tables to prevent BS5 width:100% from blowing out columns */
.table .form-control,
.table .form-select {
    width: auto;
    min-width: 60px;
    max-width: 200px;
}

/* Normalize Bootstrap 5 form control heights only inside admin panels */
.admin_tab .form-control,
.admin_tab .form-select,
.admin_tab input.datepicker.form-control,
.admin_view .form-control,
.admin_view .form-select,
.admin_view input.datepicker.form-control {
    min-height: 42px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    line-height: 1.4;
}

/* Sticky cols */
.sticky-col {
  position: -webkit-sticky;
  position: sticky;
  background-color: white;
  background-clip: padding-box;
}

.login_info {
  position: absolute;
  top: 20px;
  right: 20px;
}

/*.program_cell {
  border-bottom-color: black!important;
  border-bottom-width: 10px!important;
  border-bottom-style: solid;
}*/

.admin_tab {
  position: relative;
  width: 100%;
}

.admin_menu {
  position: fixed;
  left: 0px;
  width: 200px;
  background-color: #f5f5f5;
  border-right: 1px solid #eee;
}

.admin_view {
  position: absolute;
  top: 0px;
  left: 200px;
  right: 0;
  width: auto !important;
  
  /*height: 100%;*/
}

.container-fluid > h3,
.container-fluid > h4,
.admin_view > h3,
.admin_view > h4 {
  margin-top: 10px;
}

.admin_actor_row {
  visibility: hidden;
}

th.actor_header {
  /* Something you can count on */
  height: 140px;
  white-space: nowrap;
  border-right: hidden!important;
}

th.actor_header > div {
  transform: 
    /* Magic Numbers */
    translate(9px, 51px)
    /* 45 is really 360 - 45 */
    rotate(315deg);
  width: 30px;
}

th.actor_header > div > span {
  border-bottom: 1px solid #ccc;
  padding: 5px 10px;
}

th.tech_header {
  /* Something you can count on */
  height: 140px;
  white-space: nowrap;
  border-right: hidden!important;
}

th.tech_header > div {
  transform: 
    /* Magic Numbers */
    translate(9px, 51px)
    /* 45 is really 360 - 45 */
    rotate(315deg);
  width: 30px;
}

th.tech_header > div > span {
  border-bottom: 1px solid #ccc;
  padding: 5px 10px;
}

.presence_view {
  text-align:center;
  table-layout:fixed;
  width:100%;
}

.actor_view {
  text-align:center;
  table-layout:fixed;
  width:100%;
}

.presence_view input {
  height:20px;
}

.presence_view input[type=checkbox] {
  height:12px;
}

.actor_view input {
  height:20px;
}

/*.actor_view select {
  height:20px;
}*/

/*.sticky-nav {
  position: sticky;
  background-color: white;
  z-index: 200;
  top: 0;
}*/

.footer {
  position: fixed;
  bottom: 0px;
  width: 100%;
  height: 12px; /* Set the fixed height of the footer here */
  line-height: 12px; /* Vertically center the text there */
  background-color: #f5f5f5;
  font-size: 10px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

.spinner-tiny {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  margin-left: 10px;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.highlighted {
  background-color: yellow;
}

.overview_time {
  font-weight: bold;
}

input[type="text"] {
  font-size: small;
}

textarea {
  font-size: small!important;
}

/* Report section header rows */
.report-header {
    background-color: #e0e0e0;
    color: #000;
}

/* Weekend rows (Saturday / Sunday) */
.weekend-row {
    background-color: #E0E0E0;
}

/* Actor / technician column alternating background tints */
.actor-col-0 { background-color: #d4edff; }
.actor-col-1 { background-color: #fce6e6; }
.actor-col-2 { background-color: #f3ffe6; }
.actor-col-3 { background-color: #fcf0ff; }

/* ============================================================
   Dark mode overrides — triggered by Bootstrap 5's data-bs-theme="dark"
   (set automatically by js/darkmode.js from OS preference)
   ============================================================ */

[data-bs-theme="dark"] a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] a:hover,
[data-bs-theme="dark"] a:focus {
    color: #9ec5fe;
}

[data-bs-theme="dark"] .card.p-3 {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .nav-sidebar > li > a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .nav-sidebar > li > a:hover,
[data-bs-theme="dark"] .nav-sidebar > li > a:focus {
    background-color: #3a3f45;
    color: #9ec5fe;
}

[data-bs-theme="dark"] .nav-sidebar > li.active > a,
[data-bs-theme="dark"] .nav-sidebar > li.active > a:hover {
    background-color: #0d6efd;
    color: #fff;
}

[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover,
[data-bs-theme="dark"] .nav-tabs .nav-link:focus {
    color: #9ec5fe;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    color: #dee2e6;
}

[data-bs-theme="dark"] .table-bordered,
[data-bs-theme="dark"] .table-bordered > :not(caption) > * > * {
    border-color: #495057;
}

[data-bs-theme="dark"] .sticky-col {
    background-color: #212529;
}

[data-bs-theme="dark"] .footer {
    background-color: #2b3035;
    color: #adb5bd;
}

[data-bs-theme="dark"] .admin_menu {
    background-color: #2b3035;
    border-right-color: #495057;
}

[data-bs-theme="dark"] th.actor_header,
[data-bs-theme="dark"] th.tech_header {
    background-color: #212529;
}

[data-bs-theme="dark"] th.actor_header > div > span,
[data-bs-theme="dark"] th.tech_header > div > span {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .highlighted {
    background-color: #856404;
    color: #fff;
}

[data-bs-theme="dark"] .admin_menu {
    background-color: #2b3035;
    border-right-color: #495057;
}

[data-bs-theme="dark"] .report-header {
    background-color: #3a3f45;
    color: #dee2e6;
}

/* Weekend rows */
[data-bs-theme="dark"] .weekend-row {
    background-color: #3a3f45;
}

/* Actor / technician column tints — darkened pastel equivalents */
[data-bs-theme="dark"] .actor-col-0 { background-color: #1a3a4a; }
[data-bs-theme="dark"] .actor-col-1 { background-color: #4a1a1a; }
[data-bs-theme="dark"] .actor-col-2 { background-color: #1a3a1a; }
[data-bs-theme="dark"] .actor-col-3 { background-color: #3a1a4a; }

/* Program tab — semantic inline colors (show status, actor warnings) */
[data-bs-theme="dark"] [style*="background-color: #b3ffb3"],
[data-bs-theme="dark"] [style*="background-color:#b3ffb3"] {
    background-color: #1a4a1a !important; color: #ccc !important;
}
[data-bs-theme="dark"] [style*="background-color: #f5ad22"],
[data-bs-theme="dark"] [style*="background-color:#f5ad22"] {
    background-color: #7a5000 !important; color: #fff !important;
}
[data-bs-theme="dark"] [style*="background-color: #ff9999"],
[data-bs-theme="dark"] [style*="background-color:#ff9999"],
[data-bs-theme="dark"] [style*="background-color: #F79292"],
[data-bs-theme="dark"] [style*="background-color:#F79292"] {
    background-color: #6a1a1a !important; color: #ffcccc !important;
}
[data-bs-theme="dark"] [style*="background-color: red"],
[data-bs-theme="dark"] [style*="background-color:red"] {
    background-color: #cc0000 !important; color: #fff !important;
}
[data-bs-theme="dark"] [style*="background-color: #fffd76"],
[data-bs-theme="dark"] [style*="background-color:#fffd76"] {
    background-color: #6a6000 !important; color: #fff !important;
}
[data-bs-theme="dark"] [style*="background-color: #ff9933"],
[data-bs-theme="dark"] [style*="background-color:#ff9933"] {
    background-color: #7a4000 !important; color: #fff !important;
}

/* Play name alternating colors in Hry/actor admin column */
.play-name-odd  { color: #08006f; }
.play-name-even { color: #165200; }

[data-bs-theme="dark"] .play-name-odd  { color: #7eb3ff; }
[data-bs-theme="dark"] .play-name-even { color: #7ddf7d; }

/* Tooltipster dark mode — override the tooltipster-light theme */
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light .tooltipster-box {
    background: #2b3035;
    border-color: #495057;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light .tooltipster-content {
    color: #dee2e6;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-background {
    border-bottom-color: #2b3035;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-background {
    border-top-color: #2b3035;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-background {
    border-left-color: #2b3035;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-background {
    border-right-color: #2b3035;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-border {
    border-bottom-color: #495057;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-border {
    border-top-color: #495057;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-border {
    border-left-color: #495057;
}
[data-bs-theme="dark"] .tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-border {
    border-right-color: #495057;
}
