html, body {
    font-family: 'Jost', Arial, sans-serif;
    background: #f6f4ff; /* Светлый фон */
    color: #9a9a9a;
    font-size: clamp(12px, 1.5vw, 16px);
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: manipulation; /* Запрещает зум при касании */
}

body {
    display: flex;
    flex-direction: column;
}


/* Начиная с ширины 375px (iPhone 6/7/8 и аналогичные) */
@media (min-width: 375px) {
  html {
    font-size: 16px; /* 1rem = 14px */
  }
}

/* Начиная с ширины 768px (планшеты и крупные смартфоны) */
@media (min-width: 768px) {
  html {
    font-size: 18px; /* 1rem = 16px */
  }
}

/* И дальше по необходимости, например для десктопов */
@media (min-width: 1024px) {
  html {
    font-size: 20px;
  }
}

/*ВСПЛЫВАЮЩЕЕ УВЕДОМЛЕНИЕ*/
.notification {
    position: fixed;
    top: -50px; /* Скрыто за верхней границей */
    left: 50%;
    width: 15rem;
    transform: translateX(-50%);
    background-color: #ece2ff;
    color: rgb(40, 40, 40);
    padding: 10px 30px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: top 0.3s ease; /* Плавное появление/исчезновение */
    z-index: 1000000; /* Поверх всего */
    display: none; /* По умолчанию скрыто */
    text-align: center;
    border: 0.5px solid #a680e8;
}

.notification.error {
  background-color: #e985c3; /* Красный для ошибок */
}

.notification.show {
    top: 30px; /* Появляется сверху */
    display: block;
}

/*ЗАГОЛОВКИ и ТЕКСТА*/

h1 {
    margin-left: 1rem;
    margin-top: 0rem;
    margin-bottom: 0rem;
    color: rgb(25, 25, 25);
    text-align: left;
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
    color: #2c2c2c;
    margin: 1rem;
    margin-top: 0rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
}

h3 {
    font-size: 0.85rem;
    color: #7a7a7a;
    margin: 1rem;
    margin-top: 0rem;
    font-weight: 300;
    margin-bottom: 1rem;
    text-align: left;
}
  
h4 {
    font-size: 1rem;
    color: #bebebe;
    margin-left: 1rem;
    margin-top: 2rem;
    font-weight: 300;
    margin-bottom: 0;
}

h5{
    font-size: 1rem;
    color: #818181;
    margin: 0.3rem;
    font-weight: 300;
}

h5b{
    font-size: 1rem;
    color: white;
    margin: 0.3rem;
    font-weight: 500;
}

.loading{
    font-size: 1rem;
    color: white;
    text-align: center;
    margin-top: 3rem;
}

.version {
    font-size: 0.5rem;
    color: #818181;
    margin: 0.3rem;
    font-weight: 300;
}
  





/*ВКЛАДКА №1 СПИСОК ФУНКЦИЙ*/

#tab-functions {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.header {
    flex-shrink: 0;
}

.all-functions {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 60px; /* Учитываем высоту футера */
}


.function-container {
    overflow: hidden;
    max-width: 400px;
    max-height: 250px;
    width: 100%;
    margin-bottom: 1rem;
    margin-right: 1rem;
    margin-left: 1rem;
    cursor: pointer;
    border-radius: 15px;
    
    /*flex: 1 1 400px;align-items: flex-start;box-sizing: border-box;*/
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    
    background-color: white;
    border: 1px solid #e6e6e6;
}

.function-container-picture {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 15px;
    padding-top: 45%; /* было 62.5% - 16/10 = 1.6 → 1.6 * 100 = 160% → чтобы получилось 16:10 */
    width: 100%;
    max-width: none; 
    margin-bottom: 0.5rem;
}





/*МОДАЛЬНОЕ ОКНО*/


.h1-modal {
    margin: 0.25rem 0;
    margin-top: 1.5rem;
    color: rgb(41, 12, 72);
    text-align: left;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.h2-modal {
    margin: 0.25rem 0;
    color: rgb(184, 169, 199);
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 1rem;
    margin-bottom: 1rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  display: none;
  z-index: 2000;
  transition: background 0.3s ease;
  margin: 0; /* Убираем возможные отступы */
  padding: 0;
}
  
  .modal.open {
    background: rgba(0, 0, 0, 0.5); /* Полное затемнение при открытии */
  }

  .modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: rgb(191, 191, 191);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
  }
  
.modal-content {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 0; /* Убираем скругления */
  padding: 1.5rem;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

  .modal.open .modal-content {
      opacity: 1;
    }
  
  .modal-content h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    text-align: center;
  }
  
  .modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgb(81, 81, 81);
    font-size: 1rem;
    font-weight: 500;
  }
  
  .modal-content input,
  .modal-content textarea,
  .modal-content select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #e6e6e6;
    border-radius: 15px;
    font-size: 0.9rem;
    box-sizing: border-box;
    height: 3rem;
    font-family: 'Jost', Arial, sans-serif;
  }

  .modal-content input:focus,
  .modal-content textarea:focus,
  .modal-content select:focus {
    outline: none; /* Убираем стандартную оранжевую рамку */
    border-color: #cba1ff; /* Задаем свою рамку, например, в цвет кнопки */
    touch-action: manipulation;
  }
  
  .modal-content textarea {
    resize: vertical; /* Только вертикальное изменение размера */
    min-height: 100px;
  }
  
  .modal-submit {
    width: 100%;
    padding: 0.75rem;
    background: #ece2ff;
    color: rgb(30, 30, 30);
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    height: 4rem;
    font-family: 'Jost', Arial, sans-serif;
    margin-top: auto;
  }

  
  /* Адаптивность для узких экранов */
  @media (max-width: 500px) {
    .modal-content {
      width: 100%;
    }
  }





.h1-function {
    color: rgb(41, 12, 72);
    text-align: left;
    font-size: 1.3rem;
    font-weight: 700;
    margin-left: 1rem;
}

.h2-function {
    margin: 0.25rem 0;
    color: rgb(184, 169, 199);
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 1rem;
    margin-bottom: 1rem;
}

.filter-wrapper {
  padding: 1rem;
}
#category-filter {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e6e6e6;
  border-radius: 15px;
  font-size: 1rem;
  font-family: 'Jost', Arial, sans-serif;
}
.function-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: scale(1);
}

.function-container.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}






/*ВКЛАДКА №2 ПРОФИЛЬ*/
#tab-profile {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8f6ff;
    border-radius: 15px;
    margin: 1rem;
    box-sizing: border-box;
    margin-bottom: 0rem;
    margin-top: 0rem;
  }
  
  .profile-info {
    flex: 1;
  }
  
  .profile-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: rgb(30, 30, 30);
    font-family: 'Jost', Arial, sans-serif;
    margin-bottom: 0.5rem;
  }

  .profile-block {
    margin-bottom: 1rem;
    margin-right: 1rem;
    margin-left: 1rem;
    border-radius: 15px;

    display: flex;
    flex-direction: column;
    

    background-color: white;

    padding-bottom: 1rem;

    border: 1px solid #e6e6e6;

    padding: 1rem;
}

.profile-photo{
    width: 100%; /* Компактный размер */
    height: 15rem;
    align-self: center;
    border-radius: 12.5px;
    object-fit: cover;
    flex-shrink: 0;
    object-position: top; /* Прижимает изображение к верхней границе */
    margin-bottom: 1rem;
}
  
  
  .profile-block h4 {
    color: rgb(41, 12, 72);
    text-align: left;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Jost', Arial, sans-serif;
    margin: 0 0 1rem;
  }
  
  .profile-block p {
    font-size: 1rem;
    color: #9a9a9a;
    font-family: 'Jost', Arial, sans-serif;
    line-height: 1.4;
    margin: 0;
  }
  
  .profile-block p span {
    display: block;
    margin-bottom: 0.25rem;
    display: inline;
  }

  .profile-block p .label {
    font-weight: 500; /* Жирный шрифт для меток */
    color: rgb(104, 104, 104); /* Темный цвет */
  }
  
  .profile-block p .value {
    font-weight: 400; /* Обычный шрифт для значений */
    color: #9a9a9a; /* Серый цвет, как в текущих стилях */
  }





/*НАСТРОЙКА ВКЛАДОК*/

.footer-tabs {
    height: 60px;
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #ccc;
}

.tabs {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border-top: 1px solid #f3f3f3;
    
}
  
.tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    line-height: 2rem;
    font-size: 1rem;
    font-weight: 500;
    flex-direction: column;
    color: rgb(164, 164, 164);
}
  
.tab.active {
    color: rgb(37, 37, 37);
    background: #edddff;
    border-radius: 15px;
}