/* Oswald Font Faces */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 200;
  src: url('../static/Oswald-ExtraLight.ttf') format('truetype');
}

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 300;
  src: url('../static/Oswald-Light.ttf') format('truetype');
}

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  src: url('../static/Oswald-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 500;
  src: url('../static/Oswald-Medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 600;
  src: url('../static/Oswald-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 700;
  src: url('../static/Oswald-Bold.ttf') format('truetype');
}

* {
  margin: 0;
  padding: 0;
  font-family: 'Oswald', Arial, sans-serif;
  font-size: 13px;
  color: #333;

  --main-dark-color: #1b263b;
  --accent-dark-color: #0d1b2a;
  --bg-color: #f6f6f6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  height: calc(var(--vh, 1vh) * 100);

  overflow: hidden;

  display: flex;
  flex-direction: column;

  background-color: var(--bg-color);
}

a {
  text-decoration: none;
}

select {
  appearance: none;
  margin: 0;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  line-height: inherit;

  background-image: url("../images/down-arrow.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

select {
  outline: none;
}

.button-blue,
.button-red {
  height: 32px;
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  color: #fff;
  text-align: center;

  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.button-blue {
  background-color: var(--main-dark-color);
}

.button-blue:hover {
  background-color: #0d1b2a;
}

.button-red {
  background-color: #e11a1a;
  color: #fff;
}

.button-red:hover {
  background-color: #cb0c0c;
}

.white-block {
  padding: 16px;
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;

  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);

  border: solid #ccc 1px;
  border-radius: 16px;
  box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.1);
}

.input,
.textarea {
  height: 32px;
  width: 100%;
  padding: 8px 12px;

  line-height: 16px;

  background: rgba(238, 238, 238, 0.6);
  backdrop-filter: blur(1px);

  border: 1px solid #ccc;
  border-radius: 8px;
  color: #000;
}

.input:focus,
.textarea:focus {
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: #555;
}

.textarea {
  height: 84px;
  resize: none;
}

.link {
  text-decoration: underline;
  cursor: pointer;
  color: var(--main-dark-color);
}

.link:hover {
  color: #0d1b2a;
}

/* Header */

header {
  height: 64px;
  min-height: 64px;
  padding: 8px 16px;

  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;

  background-color: var(--main-dark-color);
}

header * {
  font-size: 16px;
  color: #fff;
}

.logo {
  position: absolute;
}

.logo img {
  max-width: 48px;
  height: auto;

  border-radius: 4px;
}

.menu {
  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.menu-mobile-icon {
  display: none;
  height: 32px;
  width: 32px;

  margin-left: auto;

  cursor: pointer;
}

.menu-mobile {
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100 - 64px);
  padding: 16px 24px;

  display: none;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  top: 64px;
  left: 0px;
  background-color: var(--main-dark-color);

  border-top: 1px solid #fff;

  z-index: 3;
}

.menu ul,
.menu-mobile ul {
  list-style: none;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.menu-mobile ul {
  flex-direction: column;
  gap: 16px;
}

.menu ul li a,
.menu-mobile ul li a {
  padding: 8px;

  color: #fff;
  text-decoration: none;
  text-transform: uppercase;

  border-radius: 8px;

  cursor: pointer;
}

.menu ul li a:hover,
.menu-mobile ul li a:hover {
  background-color: var(--accent-dark-color);
}

.menu ul li .selected,
.menu-mobile ul li .selected {
  background-color: var(--accent-dark-color);
}

.divider {
  width: 160px;
  margin: 0 24px;
  background: #fff;
  height: 1px;
}

.header-info {
  margin-left: auto;

  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main */

main {
  flex: 1;
  overflow-y: auto;
}

.main {
  min-height: calc(var(--vh, 1vh) * 100 - 64px - 48px);
  padding: 24px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.main-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  object-fit: cover;

  /* opacity: 0.4; */
  opacity: 0.5;
  filter: brightness(85%) blur(1px);

  z-index: -10;
}

.center-vertical {
  justify-content: center;
}

.page-title {
  font-size: 36px;
  font-weight: bold;
}

.block-title {
  font-size: 20px;
  font-weight: bold;
}

/* Login */

.register {
  display: none;
}

.login-container {
  width: 400px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-container form {
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* Index */

.slider-wrapper {
  position: relative;
  width: 100%; /* Установите на 100% */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 1200px; /* Добавьте максимальную ширину для больших экранов */
  margin: 0 auto; /* Центрируйте слайдер на странице */
}

.slider {
  width: 100%;
  min-width: 100%;
  max-width: 1200px;
  position: relative;
}

.slide {
  width: 100%;
  min-width: 100%;
  max-width: 1200px;
  display: none;
}

.slide img {
  width: 100%;
  min-width: 100%;
  max-width: 1200px;

  vertical-align: middle;
  aspect-ratio: 25 / 9;

  object-fit: cover;

  border-radius: 16px;
  box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.1);
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -22px;
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  transition: 0.3s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.text {
  color: #fff;
  font-size: 15px;
  padding: 8px 12px;
  position: absolute;
  bottom: 8px;
  width: 100%;
  text-align: center;
}

.dots {
  position: absolute;
  bottom: 8px;

  background: #f2f2f2;
  padding: 3px;
  border-radius: 12px;

  display: flex;
  flex-direction: row;
  gap: 6px;
}

.dot {
  height: 12px;
  width: 12px;

  background-color: #aaa;
  border-radius: 50%;

  cursor: pointer;
  transition: background-color 0.3s ease;

  cursor: auto;

  /* box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); */
}

.dot.active {
  background-color: #5d5d5d;
}

/* .dot:hover {
  background-color: #717171;
} */

.fade {
  -webkit-animation-name: fade;
  -webkit-animation-duration: 1.5s;
  animation-name: fade;
  animation-duration: 1.5s;
}

@-webkit-keyframes fade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

.info-container {
  width: 100%;
  max-width: 1200px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;

  line-height: 18px;
}

.block-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.block-text p,
.block-text li {
  text-indent: 20px;
  font-size: 16px;
}

.block-text span {
  font-weight: bold;
  font-size: 16px;
}

.block-text ul {
  list-style: none;
}

.block-text sup {
  font-size: 12px;
}

.photo {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.1);
}

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));

  justify-content: space-between;
  justify-content: center;
  justify-items: center;
  gap: 24px;
}

/* News */

.add-new-container {
  width: 400px;

  display: flex;
  flex-direction: column;

  align-items: center;
  gap: 16px;
}

.add-new-form {
  width: 100%;
  display: flex;
  flex-direction: column;

  align-items: center;
  gap: 12px;
}

.add-new-field {
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 4px;
}

.add-new-field label {
  margin-left: 2px;
  font-weight: bold;
}

.new-container {
  width: 320px;
  height: auto;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.new {
  width: 320px;
  height: 100%;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-image img {
  width: 288px;
  height: 162px;
  object-fit: cover;
  object-position: center;

  border-radius: 8px;
}

/* Admin panel */

.admin-container {
  width: 400px;

  display: flex;
  flex-direction: column;

  align-items: center;
  gap: 16px;
}

.admin-container form,
.users,
.user,
.user form {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.user-info {
  font-weight: bold;
}

/* Training */

.training-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.training-container form {
  width: 374px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flex {
  width: fit-content;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.checkbox input {
  margin: 0;
  cursor: pointer;
}

/* Profile */

.profile-container {
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 0;
  /* border-radius: 0; */
  /* border: none; */
}

.tabs {
  width: 100%;
  display: flex;
  justify-content: space-around;
  overflow: hidden;

  border-bottom: 1px solid #ccc;
}

.tab-button {
  height: 32px;
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  text-align: center;

  background: inherit;
  border: none;
  border-left: 1px solid #ccc;
  /* border-radius: 8px; */
  cursor: pointer;
}

.tab-button:first-child {
  border-top-left-radius: 14px;
  border: none;
}

.tab-button:last-child {
  border-top-right-radius: 14px;
}

.tab-button.active {
  background: #ccc;
  font-weight: bold;
}
.tab-button:hover {
  background: #ccc;
}

.tab-content-container {
  width: 100%;
}

.tab-content {
  width: 100%;
  padding: 16px;

  /* background: #f5f5f5;
  color: #444; */

  flex-direction: column;

  display: none;
}

.tab-content.active {
  display: flex;
}

.tab {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.profile-tab-main {
  width: 100%;

  display: flex;
  flex-direction: row;
  gap: 16px;
}

.left-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.right-side {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#edit-profile-button {
  width: 100%;
}

.profile-container form {
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.profile-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* border-radius: 50%; */

  object-fit: cover;
  object-position: center;
}

.profile-field {
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-field label {
  margin-left: 2px;
  font-weight: bold;
}

.profile-field input,
.profile-field select {
  display: none;
}

.profile-field.enable input,
.profile-field.enable select {
  display: block;
  pointer-events: visible;
}

.profile-field.enable input[name="photo"],
.profile-field.enable input[name="background"] {
  display: none;
}

.profile-field label span {
  display: inline;
  font-weight: 400;
}

.profile-field.enable label span {
  display: none;
}

.only-edit {
  display: none;
}

.only-edit.enable {
  display: flex;
}

.file-input {
  display: none;
}

.fake-file-input {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-field .file-input-container .fake-file-input,
.add-new-field .fake-file-input {
  margin: 0;
  font-weight: normal;

  cursor: pointer;
}

.statistics-container {
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-container {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.progress-container img {
  width: 80%;
  max-width: 80%;
  min-width: 80%;
}

.video-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-comment {
  display: none;

  line-height: 16px;
  text-align: center;
}

.video-container video {
  width: 100%;
}

.logout-button {
  width: 100%;
}

.commands-container {
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Partners */

.partners-container {
  width: 80%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
}

.our-partners {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  /* align-items: center; */
  gap: 16px;
}

.partner {
  max-height: 200px;
}

.partner-table td {
  padding: 4px 8px;
}

/* Footer */

footer {
  height: 48px;
  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;

  background-color: var(--main-dark-color);
  padding-bottom: env(safe-area-inset-bottom);
  margin-bottom: env(safe-area-inset-bottom, 40px); /* Еще больше увеличенный отступ для iOS safe area */
}

footer * {
  color: #fff;
}

.footer-layer {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer-layer a {
  height: 16px;

  display: flex;
  flex-direction: row;
  align-items: center;
}

.footer-icon {
  width: 16px;
  max-width: 16px;
  height: 16px;
  max-height: 16px;
}

@media (max-width: 1400px) {
  .menu {
    display: none;
  }

  .menu-mobile-icon {
    display: block;
  }

  footer {
    height: 64px;
    flex-direction: column;
    margin-bottom: 55px; /* Еще больше увеличенный отступ снизу для планшетов */
  }

  .main {
    min-height: calc(var(--vh, 1vh) * 100 - 64px - 64px);
    padding-bottom: 65px; /* Еще больше увеличенный отступ для контента */
  }

  #footer-divider {
    display: none;
  }
}

@media (max-width: 1200px) {
  .main {
    padding: 16px;
  }
  
  .white-block {
    max-width: 100%;
  }
  
  .filter-block {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-item {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
}

@media (max-width: 800px) {
  .profile-container {
    background-color: inherit;
    backdrop-filter: unset;

    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .tab-content-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .tabs {
    display: none;
  }

  .tab-content {
    display: flex;

    padding: 16px;

    background-color: rgba(238, 238, 238, 0.6);
    backdrop-filter: blur(1px);

    border: solid #ccc 1px;
    border-radius: 16px;
    box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.1);
  }

  .profile-tab-main {
    flex-direction: column-reverse;
    align-items: center;
  }

  .right-side, .left-side {
    width: 100%;
  }

  .profile-photo {
    width: 100%;
  }

  .progress-container img {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
  }
  
  .booking-type-options {
    flex-direction: column;
  }
  
  .slots-grid-vertical {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 600px) {
  .page-title {
    font-size: 30px;
  }

  .block-title {
    font-size: 20px;
  }

  .login-container,
  .info-container,
  .partners-container,
  .profile-container,
  .logout-button,
  .training-container form,
  .admin-container,
  #edit-profile-button {
    width: 100%;
  }

  .partner {
    max-height: 160px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .prev,
  .next {
    font-size: 14px;
  }

  footer {
    height: 104px;
    margin-bottom: 75px; /* Максимальный отступ снизу для мобильных */
  }

  .main {
    min-height: calc(var(--vh, 1vh) * 100 - 64px - 104px);
    padding-bottom: 85px; /* Максимальный отступ для контента */
  }

  .footer-layer:first-child {
    flex-direction: column;
  }

  .footer-divider {
    display: none;
  }
}

.training-table {
  width: 100%;
  border-collapse: collapse;
}
.training-table th,
.training-table td {
  padding: 8px;
  border: 1px solid #ccc;
  text-align: center;
}
.training-table tr.booked {
  /* «горящая» зелёнrgb(0, 255, 13)синяя — на вкус */
  background-color: #00f044; /* var(--main-dark-color) */
  color: #fff;
}
.training-table tr.booked .button-blue {
  background-color: #0d1b2a; /* var(--accent-dark-color) */
}

.date-place-card {
  padding: 16px;
  background-color: rgba(252, 252, 252, 0.6); /* как .white-block */
  backdrop-filter: blur(1px);

  border: 1px solid #ccc;
  border-radius: 16px;
  box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.1);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  width: 100%;
  max-width: 400px; /* можно уменьшить или увеличить */
  text-align: center;
}

.date-place-card .date {
  font-size: 18px;
  font-weight: bold;
  color: var(--main-dark-color);
}

.date-place-card .place {
  font-size: 14px;
  color: #555;
}


.filter-block {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}
.filter-item { display: flex; align-items: center; gap: 5px; }
.filter-block label { font-weight: bold; margin-right: 5px; }

/* Кастомный select */
.custom-select-wrapper {
  position: relative;
  display: inline-block;
  width: 200px;
}
.custom-select {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  user-select: none;
}
.custom-select::after {
  content: '▼';
  position: absolute;
  right: 15px;
  font-size: 12px;
  color: #555;
}
.custom-options {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 5;
}
.custom-option {
  padding: 10px;
  cursor: pointer;
  transition: background 0.3s;
}
.custom-option:hover { background: #f0f0f0; }

/* Таблица тренировок */
.training-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
.training-table th, .training-table td {
  padding: 8px;
  border: 1px solid #ccc;
  text-align: center;
}
.training-table tr.booked {
  background-color: #00f044;
  color: #fff;
}
.training-table tr.booked .button-blue {
  background-color: var(--accent-dark-color);
}

.book-arena-button {
  display: block;
  margin: 30px auto 0;
  padding: 12px 24px;
  background-color: var(--main-dark-color);
  color: #fff;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  width: fit-content;
}
.book-arena-button:hover { background-color: var(--accent-dark-color); }

.flatpickr-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

.flatpickr-input {
  border: 1px solid #ccc;    
  border-radius: 8px;         
  padding: 8px 12px;          
  background-color: #fff;     
  height: 32px;                
  font-size: 14px;             
  line-height: 1.4;
  transition: border-color .2s, box-shadow .2s;
}

.flatpickr-input:focus {
  outline: none;
  border-color: #888;        
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2);
}

.flatpickr-input::-webkit-inner-spin-button,
.flatpickr-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.flatpickr-input::-ms-clear {
  display: none;
}

.flatpickr-calendar {
  position: relative;
  padding: 0;
  background: rgba(238, 238, 238, 0.6);
  backdrop-filter: blur(1px);
  border: 1px solid #ccc;
  border-radius: 16px;
  box-shadow: 8px 8px 10px rgba(0,0,0,0.1);
  
  border-radius: 16px !important;   
  overflow: hidden !important;   
}

.flatpickr-months {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background-color: #fff !important;
  background-image: none !important;
  backdrop-filter: none !important;

  padding: 8px 12px;
  margin: 8px;
  box-shadow: none !important;
}

.flatpickr-calendar,
.flatpickr-calendar .flatpickr-months,
.flatpickr-calendar .flatpickr-innerContainer,
.flatpickr-calendar .flatpickr-rContainer {
  background-color: #fff !important; 
  background-image: none !important;   
  backdrop-filter: none !important;   
}


.flatpickr-prev-month,
.flatpickr-next-month {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  background: #ccc;
  color: #555;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.flatpickr-prev-month {
  transform: translateY(50%) translateX(50%);
}

.flatpickr-next-month {
  transform: translateY(50%) translateX(-50%);
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  background: var(--accent-dark-color);
  color: #fff;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .numInputWrapper.cur-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  padding: 4px 8px;
  margin: 0 4px;
  height: 32px;
  cursor: pointer;
  transition: border-color .2s;
  transform: translateX(-5%);
}

.flatpickr-current-month .flatpickr-monthDropdown-months select,
.flatpickr-current-month .numInputWrapper.cur-year input {
  border: none;
  background: transparent;
  width: auto;        
  padding: 0;
  margin: 0;
  font-size: 14px;  
  color: inherit;
  cursor: pointer;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month .numInputWrapper.cur-year:hover {
  border-color: #888;
}

.flatpickr-day.selected {
  background-color: var(--main-dark-color) !important;
  color: #fff !important;
}
.flatpickr-day:hover,
.flatpickr-day:focus {
  background-color: var(--accent-dark-color) !important;
  color: #fff !important;
}

.flatpickr-day {
  cursor: pointer;
}


.flatpickr-current-month .numInputWrapper {
  width: 50px !important;     
  min-width: 50px !important;
  box-sizing: border-box !important;
}

.flatpickr-current-month .numInputWrapper input.numInput.cur-year {
  width: 100% !important;
  text-align: left;
  background: transparent;      
  border: none;                 
  font-size: 14px;            
  padding: 4px 0;         
  cursor: text;
}


.slots-grid-vertical {
  display: flex;
  flex-direction: column;
  max-height: 500px; /* ограничение по высоте */
  overflow-y: auto;
  gap: 6px;
}

.slot-label {
  display: block;
  cursor: pointer;
}
.slot-label span {
  display: block;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: background 0.2s;
}
.slot-label:hover span {
  background: #f5f5f5;
}
.slot-label.booked span {
  background: #e0f0e0;
  color: #666;
  cursor: not-allowed;
}
.slot-label input {
  display: none;
}
.slot-label input:checked + span {
  background: #cce5ff;
  border-color: #66b0ff;
}
.folders {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Делаем ровно по 2 папки в ряд (можешь подправить min-width) */
.folder {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 300px;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
}

/* сам заголовок */
summary.folder-title {
  display: block;
  width: 100%;
  height: 250px;
  position: relative;
  margin: 0;
  padding: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  
  /* Включаем скрытие выступающих частей псевдоэлемента */
  overflow: hidden;
  border-radius: 8px;       /* скругление повторяем */
}

summary.folder-title::before {
  content: "";
  position: absolute;
  /* чуть выходим за границы, чтобы blur не обрезался */
  top: -15px;
  right: -15px;
  bottom: -15px;
  left: -15px;

  /* берём только картинку, а не все background-шпаргалки */
  background-image: inherit;
  background-size: cover;
  background-position: center;

  filter: blur(12px);
  z-index: 0;
}

summary.folder-title .title-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: #fff;
  font-size: 2.5rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* скрываем контент по умолчанию */
.folder .folder-content {
  display: none;
  padding: 1rem;
}

/* показываем при открытии */
.folder.open .folder-content {
  display: block;
}

/* галерея внутри */
.folder-content.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

/* Cancellation Rules */
.cancellation-rules {
  margin-top: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: rgba(238, 238, 238, 0.6);
  backdrop-filter: blur(1px);
  width: 100%;
  box-sizing: border-box;
}

.rules-toggle {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(238, 238, 238, 0.8);
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.rules-toggle:hover {
  background-color: rgba(238, 238, 238, 1);
}

.rules-toggle span {
  font-weight: bold;
  font-size: 14px;
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 16px;
  user-select: none;
}

.rules-content {
  padding: 16px;
  border-top: 1px solid #ddd;
  overflow: hidden;
  transition: opacity 0.3s ease-in-out;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.rules-content h4 {
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--main-dark-color);
}

.rules-content ul {
  margin-left: 20px;
  margin-bottom: 10px;
}

.rules-content li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.rules-content ul ul {
  margin-top: 5px;
  margin-bottom: 5px;
}

.rules-content strong {
  color: var(--main-dark-color);
  font-weight: bold;
}

.rules-content a {
  color: var(--main-dark-color);
  text-decoration: underline;
}

.rules-content a:hover {
  color: #0d1b2a;
}

/* Ensure booking form elements don't expand container */
.white-block form {
  width: 100%;
  box-sizing: border-box;
}

.white-block form * {
  box-sizing: border-box;
}

.booking-options,
.filter-block,
.slots-section {
  width: 100%;
  box-sizing: border-box;
}

/* User background styles */
.main-bg.user-background {
  filter: blur(2px) brightness(0.7) contrast(0.8);
  opacity: 0.9;
}

/* AI Analysis Styles */
.ai-analysis-container,
.admin-ai-analysis-container {
  padding: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
}

.ai-analysis-section,
.admin-ai-analysis-section {
  text-align: center;
}

.ai-description {
  font-size: 16px;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 25px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.ai-analysis-btn {
  font-size: 18px;
  padding: 12px 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.ai-analysis-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Loading Spinner */
.ai-loading {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-subtext {
  color: #6c757d;
  font-size: 14px;
  margin-top: 10px;
}

/* AI Result */
.ai-result {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.ai-result-header h3 {
  margin: 0;
  color: #343a40;
  font-size: 20px;
}

.button-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

.button-secondary:hover {
  background: #5a6268;
}

/* Markdown Content Styling */
.markdown-content {
  text-align: left;
  line-height: 1.6;
}

.markdown-content h1 {
  color: #2c3e50;
  font-size: 28px;
  margin-bottom: 20px;
  border-bottom: 3px solid #3498db;
  padding-bottom: 10px;
}

.markdown-content h2 {
  color: #34495e;
  font-size: 22px;
  margin-top: 30px;
  margin-bottom: 15px;
  border-left: 4px solid #3498db;
  padding-left: 15px;
}

.markdown-content h3 {
  color: #2c3e50;
  font-size: 18px;
  margin-top: 25px;
  margin-bottom: 12px;
}

.markdown-content li {
  margin-bottom: 8px;
  padding-left: 5px;
}

.markdown-content strong {
  color: #2c3e50;
  font-weight: 600;
}

.markdown-content em {
  color: #7f8c8d;
  font-style: italic;
}

.markdown-content ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.markdown-content p {
  margin-bottom: 15px;
  color: #34495e;
}

/* AI Error */
.ai-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}

.ai-error h3 {
  color: #721c24;
  margin-bottom: 10px;
}

.ai-error p {
  color: #721c24;
  margin-bottom: 15px;
}

/* Responsive Design for AI Analysis */
@media (max-width: 800px) {
  .ai-result-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .ai-analysis-btn {
    font-size: 16px;
    padding: 10px 25px;
  }
  
  .markdown-content h1 {
    font-size: 24px;
  }
  
  .markdown-content h2 {
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  .ai-analysis-container,
  .admin-ai-analysis-container {
    padding: 15px;
  }
  
  .ai-description {
    font-size: 14px;
  }
  
  .ai-analysis-btn {
    font-size: 14px;
    padding: 8px 20px;
  }
  
  .markdown-content h1 {
    font-size: 20px;
  }
  
  .markdown-content h2 {
    font-size: 18px;
  }
}

