@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&display=swap');

@keyframes fadeIn{
  from{
    opacity: 0;
  }
  to{
    opacity: 1;
  }
}

:root{
  --primary: #8bb1ff;
  --primary-background: #f0f0f0;
  --primary-hover-background: #f0f0f0;
  --secondary-background: #ffffff;
  --secondary-hover-background: #f0f0f0;
  --primary-text: #333;
  --secondary-text: #666;
  --border: #ccc;
  --border-hover: #ddd;
  --button-background: #fff;
  --button-background-blue: #4576d9;
  --button-background-red: #da5c63;
  --button-background-green: #4caf50;
  --button-hover-background: #e4e4e4;
  --button-hover-background-blue: #275bc3;
  --button-hover-background-red: #d0323b;
  --button-hover-background-green: #458d47;
  --button-text: #ffffff;
}

body{
  font-family: Nunito;
  background-color: var(--primary-background);
  color: var(--primary-text);
  text-decoration: none;
  text-align: center;
  padding: 0;
  margin: 0;
  transition: color 0.5s ease, background-color 0.5s ease;
}

body.dark-theme{
  --primary-background: #151515;
  --secondary-background: #202020;
  --secondary-hover-background: #151515;
  --primary-text: #f0f0f0;
  --secondary-text: #666;
  --border: #505050;
  --border-hover: #858585;
  --button-background: #202020;
  --button-background-blue: #4576d9;
  --button-background-red: #da5c63;
  --button-background-green: #4caf50;
  --button-hover-background: #151515;
  --button-hover-background-blue: #275bc3;
  --button-hover-background-red: #d0323b;
  --button-hover-background-green: #458d47;
  --button-text: #f0f0f0;
}

@media (prefers-color-scheme: dark){
  body:not(.light-theme){
    --primary-background: #151515;
    --secondary-background: #202020;
    --secondary-hover-background: #151515;
    --primary-text: #f0f0f0;
    --secondary-text: #666;
    --border: #505050;
    --border-hover: #858585;
    --button-background: #202020;
    --button-background-blue: #4576d9;
    --button-background-red: #da5c63;
    --button-background-green: #4caf50;
    --button-hover-background: #151515;
    --button-hover-background-blue: #275bc3;
    --button-hover-background-red: #d0323b;
    --button-hover-background-green: #458d47;
    --button-text: #f0f0f0;
  }
}

.content{
  width: 90%;
  margin: 20px auto 80px auto;
  animation: fadeIn 0.5s;
  transition: 0.5s;
}

@media(min-aspect-ratio: 1/3){
  .content, .modal-content{
    width: 90%;
  }
}

@media(min-aspect-ratio: 10/25){
  .content, .modal-content{
    width: 90%;
  }
}

@media(min-aspect-ratio: 1/3){
  .content, .modal-content{
    width: 80%;
  }
}

@media(min-aspect-ratio: 1/1){
  .content, .modal-content{
    width: 40%;
  }
}

@media(min-aspect-ratio: 12/9){
  .content, .modal-content{
    width: 35%;
  }
}

@media(min-aspect-ratio: 14/9){
  .content, .modal-content{
    width: 30%;
  }
}

@media(min-aspect-ratio: 16/9){
  .content, .modal-content{
    width: 25%;
  }
}

@media(min-aspect-ratio: 20/9){
  .content, .modal-content{
    width: 20%;
  }
}

body.mobile .content{
  width: 90%;
}

body.mobile .modal-content{
  width: 80%;
}

.toolbar{
  color: var(--primary-text);
  background-color: var(--secondary-background);
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
  margin-left: 10px;
  margin-right: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  align-items: center;
  transition: color 0.5s ease, background-color 0.5s ease;
}

.toolbar-logo{
  display: flex;
  float: left;
  margin-right: 10px;
  height: 26px;
  width: auto;
}

.toolbar-right{
  display: flex;
  align-items: center;
  float: right;
}

.toolbar-name{
  margin-right: 10px;
}

.toolbar-logout{
  font-family: Nunito;
  margin-right: 10px;
  color: var(--button-text);
  background-color: var(--button-background-blue);
  border: none;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 3px;
  padding-bottom: 3px;
  border-radius: 15px;
  font-size: 16px;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  transition: 0.5s;
}

.toolbar-logout:hover{
  background-color: var(--button-hover-background-blue);
}

.navbar{
  background-color: var(--secondary-background);
  position: fixed;
  width: 100%;
  bottom: 0;
  left: 0;
  height: 50px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1;
  transition: color 0.5s ease, background-color 0.5s ease;
}

.navbar-items{
  display: flex;
  justify-content: space-between;
  list-style-type: none;
  margin: 0;
  padding: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: flex-end;
}

.navbar-item{
  flex: 1;
  height: 100%;
  margin-bottom: 0px;
}

.navbar-link{
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #76787a;
  transition: 0.25s linear;
}

.navbar-link:hover, .navbar-link.selected{
  color: var(--primary);
}

.dark-theme .navbar-link:hover, .dark-theme .navbar-link.selected{
  color: var(--primary-text);
}

.navbar-item-icon{
  margin-top: 5px;
  height: 25px;
  width: auto;
  image-rendering: crisp-edges;
  transition: 0.25s linear;
}

::-webkit-scrollbar{
  width: 5px;
}

::-webkit-scrollbar-track{
  background: #00000000;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb{
  background: var(--border);
  border-radius: 5px;
  transition: 0.25s linear;
}

a, div, button, select, input, label{
  font-family: Nunito;
  text-decoration: none;
  outline: none;
  border: none;
  -webkit-tap-highlight-color: #00000000;
}

input{
  display: block;
  font-size: 16px;
  text-align: center;
  padding: 10px;
  background-color: var(--secondary-background);
  color: var(--primary-text);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: 0.3s linear;
}

input:hover{
  border: 1px solid var(--primary);
}

input:focus{
  border: 1px solid var(--primary);
  outline: none;
}

button{
  display: block;
  font-size: 16px;
  margin: 0 auto 0 auto;
  text-align: center;
  padding: 10px;
  background-color: var(--button-background-blue);
  color: #fff;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.25s linear;
}

button:hover, button:focus{
  background-color: var(--button-hover-background-blue);
}

input[type="checkbox"]{
  appearance: none;
  background-color: var(--secondary-background);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  position: relative;
  transition: 0.25s linear;
}

input[type="checkbox"]:hover{
  border: 1px solid var(--primary);
}

input[type="checkbox"]:checked{
  background-color: var(--primary);
  box-shadow: inset 0 0 0 3px var(--secondary-background);
}

select{
  box-sizing: border-box;
  font-family: Nunito;
  font-weight: 700;
  width: 80%;
  color: var(--primary-text);
  outline: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  appearance: none;
  background-color: var(--button-background);
  background-repeat: no-repeat;
  background-position: 95% center;
  cursor: pointer;
  font-size: 14px;
  margin: 5px 0;
  padding: 10px;
  transition: 0.25s linear;
}

select:hover:enabled{
  background-color: var(--secondary-hover-background);
  border: 1px solid var(--border-hover);
}

select:disabled{
  opacity: 0.5;
  cursor: default;
}

.modal{
  display: none;
  opacity: 0;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: 0.25s;
  z-index: 999;
}

.modal-content {
  position: relative;
  display: flex;
  min-width: 15%;
  max-width: 90%;
  max-height: 90%;
  justify-content: flex-start;
  flex-direction: column;
  align-items: center;
  background-color: var(--secondary-background);
  padding: 20px;
  margin: auto;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 2;
  overflow: auto;
}

.loading {
  position: relative;
  border-radius: 15px; /* Скругление углов, подстрой под свой дизайн */
  animation: pulse 2s ease-in-out infinite;
  overflow: hidden;
}

.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.modal-header{
  font-size: 14pt;
  font-weight: 700;
  color: var(--primary-text);
  margin: 0 0 15px 0;
}

.modal-button{
  margin: 10px 0 0 0;
  width: 80%;
  border-radius: 15px;
}

.modal-button:disabled{
  background: #759ceb;
  cursor: wait;
}

.modal-button:hover:disabled{
  background: #759ceb;
  cursor: wait;
}

.modal-input{
  margin: 10px 0 0 0;
  width: 75%;
}

.modal-textarea{
  font-family: Nunito;
  background-color: var(--secondary-background);
  color: var(--primary-text);
  display: block;
  width: 80%;
  height: 44px;
  min-height: 44px;
  text-align: left;
  margin: 10px auto 15px auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 16px;
  box-sizing: border-box;
  outline:none;
  resize: none;
  overflow: hidden;
  transition: 0.25s linear;
}

.modal-textarea:hover{
  box-shadow: 0 0 2px rgba(0, 255, 0, 0.2);
}

.modal-textarea:focus{
  box-shadow: 0 0 3px rgba(139, 177, 255, 0.5);
  border: 1px solid #8bb1ff;
}

.modal-text{
  font-size: 10pt;
  white-space: pre-wrap;
}

.modal-image{
  border-radius: 10px;
  max-width: 100%;
  max-height: 60vh;
}

.modal-checkbox-label{
  display: flex;
  width: 80%;
  color: var(--primary-text);
  align-items: center;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-top: 10px;
  padding: 10px;
  transition: 0.25s;
}

.modal-checkbox-label:hover{
  border: 1px solid var(--primary);
}

.modal-checkbox{
  border-radius: 10px;
  margin-right: 10px;
  background-color: var(--button-background);
}

.modal-item{
  width: 90%;
  display: flex;
  align-items: center;
  justify-content: left;
  margin: 0 auto 10px auto;
  background-color: var(--secondary-background);
  border-radius: 25px;
  padding: 10px;
  border: 1px solid var(--border);
  transition: 0.5s linear;
}

.modal-item-icon{
  flex-shrink: 0;
  color: #8bb1ff;
  width: 20px;
  text-align: center;
  float: left;
  image-rendering: crisp-edges;
}

.modal-item-text{
  flex-grow: 1;
  text-align: left;
  font-size: 11pt;
  margin-left: 10px;
  color: var(--primary-text);
  font-weight: 600;
}

.modal-item-text a{
  color: #778fdd;
}

.modal-item-button{
  font-family: Nunito;
  flex-shrink: 0;
  float: right;
  display: inline;
  box-sizing: border-box;
  padding: 3px 5px 3px 5px;
  margin-left: 5px;
  color: var(--button-background-blue);
  font-size: 15pt;
  border: 1px solid var(--button-background-blue);
  background-color: var(--secondary-background);
  border-radius: 15px;
  font-size: 10pt;
  cursor: pointer;
  transition: 0.25s linear;
}

.modal-item-button:hover{
  outline: none;
  background-color: var(--button-hover-background-blue);
  transition: 0.25s linear;
}

.modal-item-button:hover .modal-item-button-icon{
  color: var(--secondary-background);
  transition: 0.25s linear;
}

.modal-item-button-icon{
  flex-shrink: 0;
  color: #4576d9;
  width: 20px;
  text-align: center;
  float: left;
}

/* Контейнер для уведомлений */
.notify-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 1000;
}

/* Общие стили для уведомлений */
.notify {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.5s;
  padding: 15px 20px;
  border-radius: 15px;
  color: white;
  font-size: 16px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 300px;
  word-wrap: break-word;
}

/* Видимое состояние */
.notify.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Типы уведомлений */
.notify.info {
  background-color: rgba(0, 123, 255, 0.75); /* Синий */
}

.notify.success {
  background-color: rgba(40, 167, 69, 0.75); /* Зеленый */
}

.notify.error {
  background-color: rgba(220, 53, 69, 0.75); /* Красный */
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

/* Красная рамка при ошибке */
.input-error {
  border: 1px solid var(--button-background-red) !important;
  animation: shake 0.3s ease-in-out;
}

/* Зелёная рамка при успешном поиске */
.input-success {
  border: 1px solid var(--button-background-green) !important;
}