/* ====================================================== */
/* 1) Globální styly                                      */
/* ====================================================== */

body {
  padding-top: 75px;
}
h4 {
  font-size: 1rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.section-title {
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
}
a { color: #000; }
.vikend-tadum { border-left: 2px solid #000; }
td.vikend-datum, td.svatek-datum { font-weight: 800; }
td.datum, td.den {
  width: 1%;
  white-space: nowrap;
}
.legend-bar {
  width: 20px; height: 24px; display: inline-block;
}

.mt-25 {
  margin-top: 12px;
}

#btnShowHistory {
  display: none;
}

/* === Klubové pozadí (jen pro roli produkce) === */
body.role-produkce.club-fmb { background-color: #ffe5e8 !important; } /* světle červená */
body.role-produkce.club-cargo { background-color: #cae1ff !important; } /* světle modrá */

/* Odstranění bílého pozadí kontejnerů (ať prosvítá background) */
body.role-produkce .container,
body.role-produkce .container-lg,
body.role-produkce .container-fluid {
  background-color: transparent !important;
}

/* Tabulky v kalendáři */
body.role-produkce #calendarContainer .table,
body.role-produkce #calendarContainer table {
  background-color: transparent !important;
  --bs-table-bg: transparent !important;
}

/* === Stavové barvy akcí === */
/* celý řádek podle stavu akce */
#calendarContainer tr:has(td.bg-rezervace) td { background-color: #d9ead3 !important; } /* zelená */
#calendarContainer tr:has(td.bg-nove)      td { background-color: #fff2cc !important; } /* žlutá */
#calendarContainer tr:has(td.bg-zruseno)   td { background-color: #f4cccc !important; } /* červená */

/* (volitelné) lehce ztmav hranice, ať jsou vidět i na podbarvení */
#calendarContainer tr:has(td.bg-rezervace) td,
#calendarContainer tr:has(td.bg-nove) td,
#calendarContainer tr:has(td.bg-zruseno) td {
  border-bottom-color: rgba(0,0,0,0.25) !important;
}

/* === Víkendy a svátky: žádné podbarvení, ale tučný text === */
#calendarContainer td.vikend-datum,
#calendarContainer td.svatek-datum {
  background-color: transparent !important;
  font-weight: 600 !important;
}

/* === Silnější oddělení mezi dny (jen u Futura a Carga) === */
body.role-produkce.club-fmb #calendarContainer td,
body.role-produkce.club-cargo #calendarContainer td {
  border-bottom: 1px solid rgba(0,0,0,0.2) !important;
}

body.role-produkce.club-fmb #calendarContainer tr:last-child td,
body.role-produkce.club-cargo #calendarContainer tr:last-child td {
  border-bottom: none !important;
}

      #modalEditAkce .modal-header {

    background-color: #fff; /* Důležité: aby obsah neprosvítal */
    border-bottom: 1px solid #dee2e6; /* Aby byla vidět oddělovací čára */
    
    /* Ošetření zaoblených rohů nahoře, aby to vypadalo hezky */
    border-top-left-radius: calc(0.5rem - 1px);
    border-top-right-radius: calc(0.5rem - 1px);
}


@media (max-width: 575.98px) {
    
  /* ať je modal na mobilu co nejširší */
  #modalEditAkce .modal-dialog {
    max-width: 100%;
    margin: 0.25rem;
  }

  /* menší vnitřní padding modalu */
  #modalEditAkce .modal-body {
    padding: 0.5rem 0.5rem;
  }

  /* „cards“ – menší boční padding */
  #modalEditAkce .border.rounded-3 {
    padding: 0.75rem 0.5rem;
  }

  /* trochu menší mezery mezi card sekcemi */
  #modalEditAkce .border.rounded-3.mb-3 {
    margin-bottom: 0.75rem;
  }
}

/* === Spodní lišta (legenda) === */
body.role-produkce.club-fmb .footer-legend {
  background-color: #ffe5e8 !important;
  color: #661a1d !important;
  border-top: 1px solid rgba(0,0,0,0.3);
}

body.role-produkce.club-cargo .footer-legend {
  background-color: #cae1ff !important;
  color: #123a66 !important;
  border-top: 1px solid rgba(0,0,0,0.3);
}

/* ====================================================== */
/* 2) Navigace / Navbar                                   */
/* ====================================================== */
.navbar {
  position: fixed;
  top: 0; width: 100%; z-index: 1050;
}
.navbar-toggler { border: none !important; }
.navbar-toggler:focus,
.navbar-toggler:active {
  box-shadow: none !important; outline: none !important;
}
.form-select-sm,
.form-control-sm { font-size: 1rem !important; }
.nav-link {
  color: rgba(255,255,255,0.6); transition: color 0.15s;
}
.nav-link.active { color: #fff; }
.nav-link:not(.active):hover { color: #f8f9fa; }
.toolbar-wrapper {
  position: sticky; top: 56px; padding: 15px 0; margin-bottom: 15px;
  z-index: 1030; background: #fff; border-bottom: 1px solid #dee2e6;
}

/* ====================================================== */
/* 3) Sticky hlavička měsíce                              */
/* ====================================================== */
.sticky-month-header {
  position: sticky; top: 75px; z-index: 1040; padding: 8px 0;
}

/* ====================================================== */
/* 4) Kontejner kalendáře                                 */
/* ====================================================== */
#calendarContainer { margin-top: 130px; }

/* ====================================================== */
/* 5) Barvy pozadí / stavy                                */
/* ====================================================== */
.bg-secondary { border-color: #f0f0f0 !important; }
.bg-zruseno   { background: rgba(217,42,73,0.2) !important; }
.bg-nove      { background: rgba(255,243,205,0.8) !important; }
.bg-rezervace, .bg-rezervace td {
  background: rgba(167,202,160,0.5) !important;
}

/* ====================================================== */
/* 6) Dnešní den v kalendáři                              */
/* ====================================================== */
.today {
  border-top: 2px solid #212529;
  border-bottom: 2px solid #212529;
}

/* ====================================================== */
/* 7) Anchor roky, invisible trigery                      */
/* ====================================================== */
.year-anchor, #loadMoreTrigger, #loadMoreTriggerTop { pointer-events: none !important; }

/* ====================================================== */
/* 8) Modal backdrop                                      */
/* ====================================================== */
.modal-backdrop { opacity: 0.8 !important; }

/* ====================================================== */
/* 9) Datepicker                                          */
/* ====================================================== */
.air-datepicker {
  z-index: 9999; position: fixed;
}

/* ====================================================== */
/* 10) Obecné elementy                                    */
/* ====================================================== */
.header { position: sticky; top: 0; }
.holiday { border-bottom: 1px solid #000; }
.clickable-row { cursor: pointer; }
tr.clickable-row.disabled-click { pointer-events: none; cursor: default; }
#dropZone { height: 87px !important; }
#dropMoreTrigger, #loadMoreTrigger, #loadMoreTriggerTop { pointer-events: none !important; }
.fade-out { opacity: 1; transition: opacity 0.4s ease; }
.fade-out.removed { opacity: 0; }
.flash-added { animation: flashAdded 1s ease-in-out; }
.flash-removed {
  background-color: #f8d7da !important;
  transition: background-color 0.5s ease;
}
@keyframes flashAdded {
  0%   { background-color: rgba(0,123,255,0.2); }
  100% { background-color: transparent; }
}
.calendar-month { display: inline-block; vertical-align: top; }
.textarea-overflow { box-shadow: inset 0 -6px 6px -6px rgba(0,0,0,0.2); }
/* === Název akce – správné zalamování, žádné lámání slov === */
#calendarContainer .akce-nazev,
#calendarContainer .event-title,
#calendarContainer .nazev-akce,
#calendarContainer td:nth-child(3) {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important; /* pokud je jedno slovo moc dlouhé */
  hyphens: auto;
}

/* ====================================================== */
/* 11) Input[type=number] – odstranění šipek              */
/* ====================================================== */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* ====================================================== */
/* 12) Search overlay                                     */
/* ====================================================== */
#searchOverlay {
  display: none; position: fixed; inset: 0; background: #fff;
  z-index: 1050; overflow-y: auto; top: 63px !important;
}
#searchOverlay .sticky-month-header { top: 10px !important; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-ms-clear,
input[type="search"]::-o-clear,
input[type="search"]::-moz-search-clear,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-decoration { display: none; }
.input-group-sm { overflow: visible !important; }

/* ====================================================== */
/* 13) Styl vyhledávacího pole (desktop)                  */
/* ====================================================== */
#searchInputDesktop {
  background: transparent; color: #fff;
  border: 0; border-bottom: 1px solid transparent; border-radius: 0;
  line-height: 1.5; height: calc(1.5rem + 2px) !important; width: 100%;
  border-bottom: 1px solid rgba(255,255,255,0.5) !important;
}
#searchInputDesktop:hover,
#searchInputDesktop:focus {
  border-bottom-color: #fff !important;
  outline: none !important; box-shadow: none !important;
}
.position-relative { position: relative; }

.clear-btn {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  width: 1.5rem; height: 1.5rem; padding: 0;
  background: transparent; border: none; z-index: 5; opacity: 0.8; display: block; cursor: pointer; line-height: 1;
}
.clear-btn.d-none { display: none !important; }
.clear-btn svg { display: block; width: 100%; height: 100%; }

.select-borderless {
  background-color: #212529 !important; color: #fff !important;
  border: none !important; box-shadow: none !important;
}
.select-borderless option {
  background-color: #212529 !important; color: #fff !important;
}

.drinks-table-actions { opacity: 0; transition: opacity 0.2s ease; }
tr:hover .drinks-table-actions,
tr:has(:focus-within) .drinks-table-actions { opacity: 1; }

.card-body { padding: 0 !important; border: 0 !important; }

#resultsWrapper .btn.btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
}
#resultsWrapper .btn.btn-sm i.fa-solid { margin-right: 0.3em; }

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-ms-clear,
input[type="search"]::-o-clear,
input[type="search"]::-moz-search-clear,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-decoration {
  display: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
body input[type="search"]::-webkit-search-cancel-button { display: none !important; }

/* Oprava iOS input glitche */
.modal .form-control, 
.modal .form-select {
    transform: translate3d(0, 0, 0); 
}

/* === STYLY PRO AUDIT TABULKU (Desktop default) === */
.table-audit { width: 100%; border-collapse: collapse; font-size: 1rem; background: transparent; }
.table-audit thead th { background-color: #212529; color: #fff; text-transform: uppercase; font-weight: 600; font-size: 0.85rem; padding: .6rem .75rem; border: none; white-space: nowrap; }
.table-audit tbody tr { background-color: #fff; border-bottom: 1px solid #e9ecef; transition: background-color .15s ease; cursor: pointer; }
.table-audit tbody tr:hover { background: #f8f9fa; }
.table-audit td { padding: .6rem .75rem; vertical-align: middle; }

/* Badge styly - obecné */
.badge { padding: .3em .55em; border-radius: .35rem; font-size: .75rem; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-insert { background-color: #198754; }
.badge-update { background-color: #0d6efd; }
.badge-delete { background-color: #dc3545; }
.badge-drinks { background-color: #20c997; }
.badge-riders { background-color: #6f42c1; }

/* Detail řádek - základ pro desktop */
.audit-detail-row td { background: #fff; border-top: 2px solid #212529; padding: 1rem; }


/* ====================================================== */
/* 15) Mobilní vyhledávání (offcanvas)                    */
/* ====================================================== */
@media (max-width: 767px) {
  .offcanvas-header { padding-bottom: 0; }
  .drink-card { margin-bottom: 15px; }
  .drink-card:hover { background: #dee2e6; padding: 10px; }
  hr { padding: 0 }
  .sticky-month-header { top: 70px; }
  .btn-sm { font-size: 1rem !important; color: #fff; transition: color 0.15s; }
  .active { color: #fff !important; }
  .input-borderless {
    border: none !important; box-shadow: none !important; border-radius: 0 !important;
    background: transparent !important; color: #fff !important;
  }
  .input-borderless:focus { outline: none !important; box-shadow: none !important; }
  .select-borderless {
    padding-top: 0.8em !important; padding-bottom: 0.8em !important;
    border: none !important; box-shadow: none !important; border-radius: 0 !important;
    color: #fff !important; font-size: 1rem !important;
    -webkit-appearance: none !important; appearance: none !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 7l3 3 3-3z'/></svg>");
    background-repeat: no-repeat; background-position: 95% 70%; background-size: 2.5em 2.5em; padding-right: 2.5em !important;
  }
  .bg-rezervace td { color: #000 !important; }
  #searchInputMobile::placeholder,
  #searchInputMobile::-webkit-input-placeholder,
  #searchInputMobile::-moz-placeholder,
  #searchInputMobile:-ms-input-placeholder {
    color: rgba(255,255,255,0.6) !important; font-size: 1rem !important;
    opacity: 1 !important;
  }
  #mobileSearchResults { z-index: 1060 !important; }
  .clear-btn:active, .clear-btn:hover { opacity: 1; }
   #drinkSearchClear i { color: #000 !important; }
  .btn-termin { padding-bottom: 4px !important; color: #fff !important; }
  .navbar-brand { padding-left: 5px; }
  .navbar-toggler { padding-right: 5px !important; }
  #col-datum-akce .input-group { width: 100% !important; }
  }
  
/* ==========================================================================
     GOOUT PROGRESS LOADER (Calendar) - OBRÁCENÉ BARVY
     ========================================================================== */
  
  :root {
      --goout-width: 75px; 
  }
  
  /* 1. Reset buňky */
  td.akce-nazev {
      padding: 0 !important;
      height: 1px;
      vertical-align: middle;
  }
  
  /* 2. Flex kontejner */
  .akce-cell-content {
      display: flex;
      align-items: stretch;
      height: 100%;
      width: 100%;
      min-height: 28px;
  }
  
  /* 3. Název akce */
  .akce-title {
      flex: 1;
      min-width: 0;
      padding: 4px 8px;
      display: flex;
      align-items: center;
  }
  
  /* 4. Wrapper grafu */
  .goout-loader-wrapper {
      flex: 0 0 var(--goout-width);
      max-width: var(--goout-width);
      background-color: #e9ecef;
      position: relative;
      border-left: 1px solid rgba(0,0,0,0.08);
      overflow: hidden;
  }
  
  /* 5. Výplň grafu - OBRÁCENÝ SEMAFOR */
  .progress-goout-fill {
      height: 100%;
      width: 0%;
      transition: width 0.6s ease;
      background-image: none;
  
      /* Default (nízké prodeje 0-33%) - ČERVENÁ */
      background-color: #e74c3c; 
  }
  
  /* Pásmo: Střední (33% - 66%) - Oranžová */
  .progress-goout-fill.level-medium {
      background-color: #e67e22; 
  }
  
  /* Pásmo: Vysoké (66% - 90%) - Žlutá */
  .progress-goout-fill.level-high {
      background-color: #f1c40f; 
  }
  
  /* Pásmo: Kritické (90%+) - Světle zelená */
  .progress-goout-fill.level-critical {
      background-color: #2ecc71; 
  }
  
  /* 6. Výplň grafu - VYPRODÁNO (Sytá zelená) */
  .progress-goout-fill.sold-out {
      background-image: none !important;
      background-color: #27ae60 !important; /* Tmavší zelená pro SOLD OUT */
  }
  
  /* 7. Textový overlay - DEFAULT (Bílý text na červené) */
  .goout-text-overlay {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100%;
      text-align: center;
      font-size: 12px;
      white-space: nowrap;
      pointer-events: none;
      line-height: 1;
      z-index: 2;
      color: #000000; /* Bílá pro lepší kontrast na červené */
  }
  
  /* 8. Text VYPRODÁNO (Bílý, extra tučný) */
  .goout-text-overlay.sold-out-text {
      color: #ffffff !important;
      font-weight: 800;
  }
  
  /* Pokud je řádek víkend nebo svátek, udělej text v GoOut baru tučný */
  tr.vikend .goout-text-overlay,
  tr.svatek .goout-text-overlay {
      font-weight: 800 !important;
  }
  
  /* ==========================================================================
     MODIFIKÁTORY (Přepínání v navbaru)
     ========================================================================== */
  
  /* A) REŽIM ČERNOBÍLÝ (Váš preferovaný Flat Grey) */
  body.mode-bw .progress-goout-fill {
      background-image: none !important;
      background-color: #212529 !important;
  }
  
  body.mode-bw .progress-goout-fill.sold-out {
      background-color: #000000 !important;
  }
  
  body.mode-bw .goout-text-overlay {
      color: #ffffff !important;
      text-shadow: 
         -1px -1px 0 #000,  
          1px -1px 0 #000,
         -1px  1px 0 #000,
          1px  1px 0 #000;
  }
  
  /* B) REŽIM VYPNUTO (Skryto) */
  body.mode-hidden .goout-loader-wrapper {
      display: none !important;
  }
  
  body.mode-hidden th.col-goout,
  body.mode-hidden td.col-goout {
      display: none !important;
  }