/* Kontajner + header */
.g-week-container {
  /*font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;*/
  margin: 16px 0;
  max-width: 450px;
}

.g-week-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.g-week-header button {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #afafaf;       /* rámček */
  background-color: #f2f2f0;       /* pozadie */
  cursor: pointer;
  border-radius: 4px;              /* jemne zaoblené rohy */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responzívne rolovanie do šírky */
.g-week-grid {
  max-width: 450px;
  overflow-x: auto;
  display: grid;
  /* užšie stĺpce: 40px pre čas, min 40px pre každý deň */
  grid-template-columns: 40px repeat(7, minmax(40px, 1fr));
  border: 1px solid #afafaf;
}

/* Grid riadky sú "contents", aby sme mali jednotnú 1px mriežku */
.g-week-row {
  display: contents;
}

/* HLAVIČKA */
.g-week-header-row .g-week-time-col {
  background: #000;
  color: #fff;
  border: 1px solid #000; /* zanikne okraj v hlavičke */
}

.g-week-header-row .g-week-day-col {
  background: #000;
  color: #fff;
  border: 1px solid #000; /* žiadna sivá mriežka v hlavičke */
  text-align: center;
  display: flex;
  flex-direction: column;
  padding: 4px 4px;
  line-height: 1.05;
}

.g-week-day-col .dow {
  font-weight: 500;
  font-size: 12px;
}

.g-week-day-col .date {
  font-size: 11px;
  opacity: 0.9;
}

/* Ľavý časový stĺpec (okrem hlavičky) */
.g-week-time-col {
  background: #000;
  color: #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #afafaf;
  padding: 3px 4px;        /* menší padding = kompaktnejšie riadky */
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

/* Bunky mriežky */
.g-week-cell {
  border-right: 1px solid #afafaf;
  border-bottom: 1px solid #afafaf;
  background-color: #f2f2f0;   /* neobsadené */
  height: 26px;                /* kompaktnejšia výška */
  min-height: 24px;
  box-sizing: border-box;
}

/* Obsadené sloty */
.g-week-occupied {
  background-color: #ff3d0f !important;
}

/* Menšie obrazovky */
@media (max-width: 960px) {
  .g-week-grid {
    grid-template-columns: 36px repeat(7, minmax(38px, 1fr));
  }
  .g-week-day-col .dow { font-size: 11px; }
  .g-week-day-col .date { font-size: 10px; }
  .g-week-time-col { font-size: 10px; padding: 3px; }
  .g-week-cell { height: 24px; }
}

@media (max-width: 680px) {
  .g-week-grid {
    grid-template-columns: 30px repeat(7, minmax(34px, 1fr));
  }
  .g-week-day-col .dow { font-size: 10px; }
  .g-week-day-col .date { font-size: 10px; }
  .g-week-cell { height: 22px; }
}

/* Zarovnanie šípok v hlavičke týždenného kalendára */
.g-week-header {
  gap: 16px;
}

.g-week-header button {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.arrow_button {
  text-align: center;
  font-family: "Material Symbols Sharp", sans-serif;
  font-size: 20px;
  font-weight: 200;
  line-height: 1;
}

/* Pravá šípka – bežný smer */
.arrow_wrapper_button_right {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ľavá šípka – horizontálne otočená */
.arrow_wrapper_button_left {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(180deg);
}

/* pravá šípka = default smer dopredu */
.arrow_wrapper_button_right {
  transform: none;
}

/* ľavá šípka – otočíme horizontálne */
.arrow_wrapper_button_left {
  transform: rotateY(180deg);
}

/* === ACCESSIBILITY & INTERAKCIA: šípky v hlavičke === */
.g-week-header button {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #afafaf;
  background-color: #f2f2f0;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-week-header button:hover {
  background-color: #ececec;         /* jemne tmavšie pri hover */
  border-color: #9a9a9a;
}
.g-week-header button:active {
  transform: scale(0.98);            /* drobná haptika pri kliku */
}
.g-week-header button:focus-visible {
  outline: 2px solid #000;           /* výrazný focus ring */
  outline-offset: 2px;
}

/* Ikona šípky (Material Symbols) */
.arrow_button {
  text-align: center;
  font-family: "Material Symbols Sharp", sans-serif;
  font-size: 20px;
  font-weight: 200;
  line-height: 1;
  user-select: none;
}
.arrow_wrapper_button_right,
.arrow_wrapper_button_left {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.arrow_wrapper_button_left { transform: rotateY(180deg); }

/* === LOADING STAV === */
/* Grid musí byť relatívny, aby overlay sedel */
.g-week-grid { position: relative; }

/* Overlay nad mriežkou počas načítavania */
.g-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
  z-index: 2;
}

/* Spinner (jemný) */
.g-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #afafaf;
  border-top-color: #ff3d0f;    /* vizuálne ladiace s obsadenosťou */
  border-radius: 50%;
  animation: gspin 1s linear infinite;
}
@keyframes gspin { to { transform: rotate(360deg); } }

/* Shimmer skelet pre bunky počas načítavania */
.g-week-grid.is-loading .g-week-cell {
  background: linear-gradient(
    90deg,
    #f2f2f0 0%,
    #ececea 50%,
    #f2f2f0 100%
  );
  background-size: 400% 100%;
  animation: gshimmer 1.2s linear infinite;
  border-color: #d3d3d3;
}
@keyframes gshimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

/* Vizualne skrytý text (pre čítačky obrazovky) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Rešpektuj preferencie zníženého pohybu */
@media (prefers-reduced-motion: reduce) {
  .g-spinner { animation: none; }
  .g-week-grid.is-loading .g-week-cell { animation: none; background: #f2f2f0; }
  .g-week-header button:active { transform: none; }
}

/* Shimmer len v rámci kalendára (neblokuje stránku) */
.g-week-grid.is-loading .g-week-cell {
  background: linear-gradient(90deg, #f2f2f0 0%, #ececea 50%, #f2f2f0 100%);
  background-size: 400% 100%;
  animation: gshimmer 1.2s linear infinite;
  border-color: #d3d3d3; /* jemnejšia mriežka počas načítania */
}

@keyframes gshimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

/* Rešpektuj znížený pohyb */
@media (prefers-reduced-motion: reduce) {
  .g-week-grid.is-loading .g-week-cell {
    animation: none;
    background: #f2f2f0;
  }
}