/* 🌐 Модный шрифт */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body, button, .header-bar, .profile-dropdown {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 500; /* чуть жирнее для UI */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.btn-teal {
  background-color: #14b8a6; /* бирюзовый */
}
.btn-teal:hover {
  background-color: #0d9488;
}

.btn-cyan {
  background-color: #06b6d4; /* голубой */
  color: #fff;
}
.btn-cyan:hover {
  background-color: #0891b2;
}
/* Тёмная тема — цвета сохраняются */

html.dark .btn-teal{
  background-color: #14b8a6; /* бирюзовый */
  color: #fff;
  }
html.dark .btn-cyan
 {
  background-color: #06b6d4; /* голубой */
  color: #fff;
}
.btn-red {
  background-color: #ef4444; /* красная */
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-red:hover {
  background-color: #dc2626;
}

html.dark .btn-red {
  background-color: #ef4444;
  color: #fff;
}

/* Фиолетовая */
.btn-purple {
  background-color: #8b5cf6; /* фиолетовая */
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
 
  border: none;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-purple:hover {
  background-color: #7c3aed;
}

html.dark .btn-purple {
  background-color: #8b5cf6;
  color: #fff;
}


/* Сброс стандартных отступов */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html{
  margin: 0;
  padding: 0;

}
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
  font-family: 'Poppins', sans-serif;
  background-color: #f9fafb; /* светлая тема фон */
  color: #111827;            /* светлая тема текст */

  min-height: 100vh;
  margin: 0;
}

/* 🌙 Тёмная тема */
html.dark body {
  background-color: #111827; /* тёмная тема фон */
  color: #f9fafb;            /* тёмная тема текст */
}
html.dark .tasks{
  background-color: #111827; /* тёмная тема фон */
  color: #f9fafb;            /* тёмная тема текст */
}
#saveAvatar {
  display: block;
  width: 100%;
  margin-top: 1rem;
}

header {
  display: flex;
  justify-content: space-between; /* Левый элемент слева, правый — справа */
  align-items: center;            /* Вертикальное выравнивание по центру */
  padding: 1rem;
  background-color:inherit;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  
  font-size: 0.75rem;
}

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

 

.header-avatar:hover {
  transform: scale(1.1);
  border-color: #4cafef;
}

.header-actions {
  top: 10px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  min-width: 120px;
  
  position: fixed;
  z-index: 10000;
}
/* Общий стиль кнопок */
.header-actions button {
  background: #f5f5f7;
  border: 1px solid #ccc;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Эффекты наведения */
.header-actions button:hover {
  background-color: #e3e3e6;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

/* Фокус */
.header-actions button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.5);
}
/* Скругления у кнопок для совмещения в группу */
.btn-theme {
  border-radius: 8px 0 0 8px;
  border-right: none;
}
/* FOOTER всегда внизу */
footer {
  padding: 1rem;
  text-align: center;
  background-color: inherit;
  color: #111827;
  border-top: 1px solid #e5e7eb;
}



html.dark header,
html.dark footer {
  background-color: #1f2937;
  color: #f9fafb;
  border-color: #374151;
}

/* Buttons */
button, .button {
  border: none;
  border-radius: 0.45rem; /* скругление */
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  background-color: #606c68; 
  color: #fff;
}
button:active{
  transform: scale(0.95);
}

html.dark button, html.dark .button.dark{
  background-color: #dedede; 
  color: #000;
}

html.dark button:hover, html.dark .button:hover{
   background-color: #606c68; 
  color: #fff;
}

button:hover, .button:hover {
  background-color: #dedede; 
  color: #000;
  transform: scale(1.05);
}



/* Форма */
form {
  width: 100%;
  /*max-width: 400px;*/
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
   margin: 2rem auto;
   text-align: center;
}


html.dark form {
  background-color: #1f2937; /* тёмный фон формы */
  color: #f9fafb;            /* светлый текст */
}
input {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #fff;
  color: #111827;
  outline-offset: 2px;
  transition: border-color 0.2s;
}
select {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: #ffffff;
  color: #111827;
}

html.dark input, html.dark select {
  background-color: #374151;
  color: #f9fafb;
  border-color: #4b5563;
}
/* Центрируем main */
main {
  
  text-align: center;
  /*flex-direction: column;
  justify-content: center;    /* вертикальное центрирование */
  align-items: center;        /* горизонтальное центрирование */
  padding: 1rem;
  gap: 1.5rem;                /* расстояние между элементами внутри main */
}
.mainall {
  flex: 1;               /* main занимает всё доступное пространство */
  display: flex;
  flex-direction: column;
}

/* Заголовок */
main h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}



/* Метки и инпуты */
label {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  color: #111827;
}



input:focus {
  border-color: #3b82f6;
}
a {
  color: #3b82f6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


html.dark form label {
  color: #f9fafb;            /* лейблы светлые */
}



/* Welcome section */
.welcome {
  max-width: 600px;
}

/* Заголовок */
.welcome h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Описание */
.welcome p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #6b7280; /* сероватый */
}

html.dark .welcome p {
  color: #d1d5db; /* светлый в тёмной теме */
}

/* Группа кнопок */
.button-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Общие стили кнопок */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, background-color 0.3s ease;
  margin-top: 1.5rem;
  background-color: #606c68; 
}






.btn:hover {
  transform: scale(1.05);
}



/* Register section */
.register {
  max-width: 500px;
  width: 100%;
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

html.dark .register {
  background-color: #1f2937;
  color: #f9fafb;
}

/* Заголовок */
.register h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Форма */
#registerForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Метки и поля */
label {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  text-align: left;
}
/* Кнопка */
.btn-green {
  background-color: #10b981;
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
 
  border: none;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-green:hover {
  background-color: #059669;
  transform: scale(1.05);
}

/* Сообщение об ошибке или успехе */

/* Фон в виде школьной доски с формулами в расфокусе */
.banner {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
  padding: 80px 20px;
  border: 4px solid;
  border-radius: 1.5rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('board-blur.jpg') no-repeat center center;
  background-size: cover;
  opacity: 0.5;
  z-index: 1;
}

.banner-text {
  position: relative;
  z-index: 2;
  text-align: center;
}

.banner-text h1,
.banner-text .subtitle,
.banner-text .extra {
  margin: 0 auto 0.75rem;
  max-width: 600px;
  color: #000;
}

.banner-text h1 {
  font-size: 2.0rem;
}

.banner-text .subtitle {
  font-size: 1.75rem;
}

.banner-text .extra {
  font-size: 1rem;
  margin-bottom: 0;
}



/* Тёмная тема */
.dark .banner {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.2);
}
.dark .banner-text h1,
.dark .banner-text .subtitle,
.dark .banner-text .extra {
  color: #fff;
}


.banner-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-color: inherit;
}

.banner-link:hover  {
  transform: scale(1.02);
  transition: transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}






/* === Layout === */
.dashboard {
  display: flex;
  flex: 1;
}





/* Плавное появление всех секций */
.main-content .column,
.main-content section,
.user-info {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

body.loaded .main-content .column,
body.loaded .main-content section,
body.loaded .avatar-container,
body.loaded .user-info {
  opacity: 1;
  transform: translateY(0);
}

/* Подпрыгивание аватарки при наведении */
.avatar-container .avatar {
  transition: transform 0.3s ease;
}

.avatar-container .avatar:hover {
  transform: scale(1.08) rotate(-2deg);
}

/* Пульсация кнопок */

body:not(.mobile) .btn-green:hover,
body:not(.mobile) .btn-blue:hover,
body:not(.mobile) .btn-yellow:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

/* Выезд секций слева направо */
.collection .cards,
.friends,
.leaderboard {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

body.loaded .collection .cards,
body.loaded .friends,
body.loaded .leaderboard {
  opacity: 1;
  transform: translateX(0);
}

.input-3d{
  background: #f3f3f3;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow:
    inset 2px 2px 5px #d1d1d1,
    inset -2px -2px 5px #ffffff;
  translation: all 0.2s ease;
   
}

html.dark .input-3d{
  background: #111827;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  color: #f0f0f0;
  box-shadow:
    inset 2px 2px 4px #1c1c1c,
    inset -2px -2px 4px #3f3f3f;
  translation: all 0.2s ease;
   
}

.column {
  display: block;
  max-width: 100%;
  margin-left: 80px ;
  margin-right: 40px;
  padding: 0 1rem;

 

}
.main-content {
  flex: 1;
  padding: 1rem 2rem;
  margin-left: 72px;
}

.main-content_h {
  
  margin-left: 7px;
}
.center {
  text-align: center;
  margin-top: 1px;
  margin-bottom: 10px;
}
/* === Header Bar === */
.header-bar {
  width: 100%;          /* чтобы занять всю ширину родителя */
  align-items: flex-start; /* вертикально прижать к верху, если нужно */
  justify-content: space-between; /* выровнять контент по левому краю */
  text-align: left;     /* для текста */
  display: flex;        /* если нет, добавь */
  gap: 1rem;            /* если нужно отступы между элементами */
  color: #000;
  margin: 1%;
}
.btn-profile {
  border-radius: 0 8px 8px 0;
  border-left: none;
  padding: 4px 8px;
}

.btn-profile-modal {
  border-radius: 8px 8px 8px 8px;
  margin: 2%;
  padding: 4px 8px;
}




.header-bar button:hover,
.btn-profile:hover {
 
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.header-bar button:active,
.btn-profile:active {
  transform: scale(0.95);
}

.header-bar button:focus,
.btn-profile:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.5);
}


html.dark .header-bar{
  color: #fff;
}
.header-bar:hover{
  text-decoration: none;
}
.logo-container:hover{
  opacity: 0.8;
  
}
.header-bar h2 {
  font-size: 1.75rem;
  margin: 0;
  width: auto;
  text-align: left !important;
  flex-shrink: 0;
}

/* === Кнопки === */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
}

.btn-blue {
  background-color: #3b82f6;
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
html.dark .btn-blue {
  background-color: #3b82f6;
  color: #fff;
}
.btn-blue:hover {
  background-color: #2563eb;
}



html.dark .btn-green {
  background-color: #10b981;
  color: #fff;
}

.btn-green:hover {
  background-color: #059669;
}

.btn-yellow {
  background-color: rgb(234 179 8 / var(--tw-bg-opacity, 1));
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
html.dark .btn-yellow {
  background-color: rgb(234 179 8 / var(--tw-bg-opacity, 1));
  color: #fff;
}

.btn-yellow:hover {
  background-color: #cc9c06;
}

/* === Профиль === */
.profile {
  
 
  background-color: #ffffff;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}




html.dark .profile {
 background-color: #374151;

}
html.dark .header-actions button {
  
  border-color: #555;
  background-color: #1f2937;
}

html.dark .header-actions button:hover {
  background-color: #444;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}



.profile-dropdown {
   position: fixed;
  top: 80px;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  min-width: 180px;
  z-index: 10200;
  animation: fadeInScale 0.2s ease forwards;
  cursor: pointer;
  transform-origin: top right;
  padding: 8px 0;
  overflow: hidden;
}

.profile-dropdown a {
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  display: block;
  transition: background 0.2s ease, transform 0.1s ease;
}

.profile-dropdown a:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}
.profile-dropdown .menu-item-disabled {
  display: block;
  padding: 10px 16px;
  color: #999;
  cursor: default;
}
/* Хвостик бабл-меню */
.profile-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 16px;
  border: 8px solid transparent;
  border-bottom-color: #fff;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
  pointer-events: none;
}



html.dark #profileDropdown {
  background-color:  #374151;
  color: #fff;
}

html.dark #profileDropdown a {
  color: #fff;
}

html.dark #profileDropdown a:hover {
  background-color: #1f2937;
}



.avatar-container {
  position: relative;
  margin-right: 1rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #3b82f6;
  object-fit: cover;
  cursor: pointer;
}

.edit-avatar {
 
  background-color: #3b82f6;
  color: #fff;
  padding: 0.25rem;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;

}

.edit-avatar:hover {
  transform: scale(1.2);
  background-color: #2563eb;
}

/* === Widgets === */
.widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
html.dark .widgets {
  background-color: #374151; /* фон контейнера */
}

html.dark .widget {
  background-color: #1f2937; /* фон карточек */
  color: #f9fafb;           /* светлый текст */
}
.widget {
  background-color: #ffffff;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark .widget {
  background-color: #1f2937;
}

.progress-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 6px solid #3b82f6;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem auto;
  font-weight: 600;
}

/* === Коллекция учёных === */
.collection .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background-color: #ffffff;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark .card {
  background-color: #1f2937;
}

.card img {
  width: 100%;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.card.yellow {
  border: 3px solid #facc15;
}

.card.gray {
  border: 3px solid #9ca3af;
}

.card.purple {
  border: 3px solid #8b5cf6;
}

/* === Друзья === */
.friends .friend {
  background-color: #ffffff;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark .friends .friend {
  background-color: #1f2937;
}

.friend-info {
  display: flex;
  align-items: center;
}

.friend-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.online {
  color: #10b981;
}

.offline {
  color: #9ca3af;
}

/* === Таблица лидеров === */
.leaderboard table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.5rem;
  overflow: hidden;
}

.leaderboard th, .leaderboard td {
  padding: 0.75rem 1rem;
  text-align: left;
}

.leaderboard th {
  background-color: #f3f4f6;
  font-weight: 600;
}

body.dark .leaderboard th {
  background-color: #374151;
}

.leaderboard tr:nth-child(even) {
  background-color: #f9fafb;
}

body.dark .leaderboard tr:nth-child(even) {
  background-color: #1f2937;
}
.hidden{
  display: none;
}
.form-footer {
  display: flex;
  justify-content: space-between; /* кнопки по краям */
  align-items: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #6b7280; /* серый текст */
  text-align: center;
}

.form-footer a {
  color: #3b82f6; /* ссылка синяя */
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

html.dark .form-footer {
  color: #d1d5db; /* светлый текст в тёмной теме */
}

html.dark .form-footer a {
  color: #93c5fd; /* ссылки светлее в тёмной теме */
}




.container {
  text-align: center;
  padding: 4rem 2rem;
}


.tagline {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #555;
}

.btn-primary {
  background-color: #4cafef;
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #2196f3;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  margin-top: 1rem;
  cursor: pointer;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 2rem auto;
  
}

.feature a {
  color: inherit;
  text-decoration: none;
  }
 .feature{
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s, background 0.3s;
  cursor:pointer;
}



.feature h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.feature:hover{
  transform: scale(1.05);
}

/* Темная тема */


html.dark .feature {
  background-color:  #1f2937;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.hero {
  background-color: #e3f2fd; /* Светлый фон для светлой темы */
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 2px solid #ccc;
}

html.dark .hero {
  background-color: #1e1e1e; /* Тёмный фон для тёмной темы */
  border-bottom: 2px solid #444;
}

html.dark .btn-primary {
  background-color: #bb86fc;
}

html.dark .btn-primary:hover {
  background-color: #9a67ea;
}

#cropperImage{
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
/* Скрыта по умолчанию */

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* затемнение */
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: auto;
  align-items: center;
}
.modal.active {
  opacity: 1;
  display: flex;
}
/* Ограничение размеров модалки на мобильных */
.modal-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  max-width: 90vw; /* Не шире 90% экрана */
  max-height: 90vh; /* Не выше 90% экрана */
  overflow-y: auto; /* Прокрутка при переполнении */
  box-sizing: border-box;
  padding: 1rem; /* Уменьшаем отступы */
}

/* Кнопки внутри модалки не прилипают к низу */
.modal-inner button {
  width: 100%; /* Для узких экранов - на всю ширину */
  margin-top: 0.5rem;
}
.modal-inner > div {
  flex: 1;
  overflow: auto;
}

.modal-inner .buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f0f0f0;
  position: sticky;
  bottom: 0;
}

.modal-content {
  background-color: #fff;
  border-radius: 0.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width:400px;
  margin: 5% auto;
  max-height: 80vh;          /* максимум 80% высоты окна */
  overflow-y: auto;          /* скролл, если содержимое больше */
  
  padding: 1rem;
  box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
  animation: fadeInScale 0.4s ease forwards;
  box-sizing: border-box;
}

.modal-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}


.modalpen.hidden { display: none; }
.modalpen {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex; justify-content: center; align-items: center;
  z-index: 999;
}
.modalpen-content {
  background: white; color: #111;
  padding: 2rem; border-radius: 1rem;
  max-width: 400px; text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.modalpen-content h2 {
  margin-top: 0;
}
.modalpen-content button {
  margin-top: 1rem;
  background: #3b82f6; color: white;
  border: none; padding: 0.5rem 1rem;
  border-radius: 5px; cursor: pointer;
}



/* Темная тема */
html.dark .modal-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
}
/* Анимация появления */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
/* Мобильная адаптация */
@media (max-width: 480px) {
  .modal-content {
    padding: 0.5rem;
    transform: translateX(-50%);
    width: 100%;
    max-height: 90vh; /* чуть больше места на мобилках */
    border-radius: 0.25rem;
    margin: 5% auto;
  }
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal img {
  width: 100%;
  height: auto;
  display: block;
}

.close-view, .close-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  color: #333;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
  background: transparent;
  border-radius: 50%;
  padding: 0.2rem 0.4rem;
  border: none;
  z-index: 10;
}

.close-edit:hover, .close-view:hover {
  color: #ff4d4f;
  background: #f2f2f2;

}

.drag-over {
  border: 2px dashed #4cafef;
  background: rgba(76, 175, 239, 0.1);
}

/* Кнопка закрытия */
.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.8rem;
  color: #999;
  cursor: pointer;
}

.close:hover {
  color: #333;
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { bottom: -100%; }
  to { bottom: 0; }
}
.logo-container {
  display: flex;
  align-items: center; /* вертикально центрирует текст и картинку */
  gap: 0.5rem;         /* отступ между логотипом и текстом */
}

.logo {
  width: 48px;         /* размер логотипа */
  height: 48px;
  object-fit: contain; /* сохраняет пропорции */
}







html.dark .sidebar nav a {
  color: #f9fafb; /* светлый текст в тёмной теме */
}

html.dark .sidebar {
  background-color: #1f2937;
  border-color: #374151;
  color: #ffffff;
}

html.dark .sidebar nav a:hover {
  background-color: #374151; /* или другой тёмный цвет */
}



.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 72px;
  background-color: #f3f4f6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1rem 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-x: hidden; /* скрыть лишнее */
  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 999;
}

.sidebar:hover {
  width: 220px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #1f2937;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.sidebar nav a:hover {
  background-color: #e5e7eb;
  color: #2563eb;
}

.sidebar nav a i {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.sidebar nav a span {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.sidebar:hover nav a span {
  opacity: 1;
  transform: translateX(0);
}

html.dark .sidebar {
  background-color: #1f2937;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

html.dark .sidebar nav a {
  color: #f3f4f6;
}

html.dark .sidebar nav a:hover {
  background-color: #374151;
  color: #38bdf8;
}
.sidebar .menu-item {
  display: flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #b9bbbe;
  margin-right: 0;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, color 0.2s;
}

.sidebar .menu-item:hover {
  background-color: #40444b;
  transform: scale(1.1);
  color: #fff;
}
.sidebar .menu-item-disabled {
  opacity: 0.5;
  cursor: default;
}
.sidebar .menu-item-disabled:hover {
  background: transparent;
  transform: none;
  color: #b9bbbe;
}
.sidebar .menu-item i {
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.sidebar .menu-item span {
  opacity: 0; /* скрыто */
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-10px);
}

.sidebar:hover .menu-item span {
  opacity: 1; /* проявляется */
  transform: translateX(0);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
body.menu-open .menu-toggle{
  pointer-events: none;
  opacity: 0;
}
body.menu-open {
  overflow: hidden;
}
.menu-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: transparent;
  color: #374151;
  font-size: 1.3rem;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
}

.menu-btn:hover {
  background-color: #e5e7eb;
  transform: scale(2.1);
  color: #2563eb;
}

body.dark .menu-btn {
  color: #f9fafb;
}

body.dark .menu-btn:hover {
  background-color: #374151;
  color: #38bdf8;
}


.logo1 {
  margin-bottom: 2rem;
}

.sidebar .logo1 {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px; /* высота блока с логотипом */
  transition: all 0.3s ease;
  overflow: hidden;
}

.sidebar .logo {
  width: 40px; /* маленький логотип по умолчанию */
  height: auto;
  transition: all 0.3s ease;
}

.logo-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #3b82f6;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.logo-btn:hover {
  
  background-color: #2563eb;
  transform: scale(1.5);
}
.sidebar:hover .logo1 {
height: 90px; }


.menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: none;
  }

  html.dark .menu-toggle {
    background: #1f2937;
    color: #f3f4f6;
  }


@media (max-width: 768px) {
   .checkbox-wrapper {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    font-size: 12px;
    gap: 8px;
  }
  .checkbox-wrapper input[type="checkbox"] {
    flex-shrink:0;
    width: 18px;
    height: 18px;
    accent-color: #4cafef;
    cursor: pointer;
  }
  
  .greeting {
    display: none !important;
    visibility: hidden;
  }
  .banner {
    padding: 60px 10px;
    margin: 30px auto;
  }
  .banner-text h1 {
    font-size: 2rem;
  }
  .banner-text .subtitle {
    font-size: 1.1rem;
  }
  
  .features {
    display: flex !important;
    flex-direction: column !important; /* секции одна под другой */
    gap: 1rem;
    padding: 1rem;
  }

  .feature {
    width: 100% !important; /* каждая занимает всю ширину */
    cursor: pointer;
  }

 

  .sidebar {
    transform: translateX(-100%);
  
  }
  .main-content{margin-left: 0;}
  .sidebar.active {
    transform: translateX(0);
    width: 220px;
  }
  .sidebar.active .menu-item span {
    opacity: 1;
    transform: none;
  }
  .menu-toggle{
    display: block;
    z-index: 1000;
  }
  .sidebar.active + .menu-toggle {
  display: none;
}
body.menu-open .menu-toggle{
  pointer-events: none;
  opacity: 0;
}
body.menu-open {
  overflow: hidden;
}
 .header-bar {
  padding: 8px;
    flex-wrap: wrap;
  }
  .header-actions{
    left: auto;
    right: 1rem;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 0;
  }

  .profile-dropdown {
    right: -20px; /* Чуть сдвинем чтобы поместилось */
  }
  .column{
    max-width: 100%;
    padding: 0 0.5rem;
    gap: 0.75rem;
    margin-left: 60px;
  }
}
.backdrop {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  -webkit-backdrop-filter: blur(8px);
 backdrop-filter: blur(8px);
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.3);
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 998;

}

.backdrop.active {
  visibility: visible;
  opacity: 1;
  pointer-events: all;
}

.sidebar:hover .logo {
  width: 90px;
  transform: rotate(360deg);
  transition: width 0.3s ease, transform 0.6s ease;
}
.sidebar:hover .logo-btn {
  width: 90px;
  height: 90px;
  
}


/* В светлой теме (по умолчанию) */
#togglePassword i {
  color: #444;
}

/* В тёмной теме */
html.dark #togglePassword i {
  color: #ddd;
}

ul {
  list-style: inside disc;          /* маркеры внутри блока */
  padding-left: 0;                  /* убираем отступ слева */
  margin: 10px 0 15px 0;            /* вертикальные отступы сверху и снизу */
  color: #444;                     /* чуть темнее серый для текста */
  font-size: 14px;                 /* комфортный размер */
  line-height: 1.5;                /* межстрочный интервал */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
html.dark ul{
  color: #ddd;
  }

ul li {
  margin-bottom: 8px;              /* расстояние между пунктами */
  padding-left: 6px;               /* небольшой отступ у текста, чтобы не слипалось с маркером */
}

ul li code {
  background-color: #f0f0f0;      /* светлый фон для кода */
  border-radius: 3px;
  padding: 2px 5px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  color: #c7254e;                 /* красноватый цвет для кода */
}
/* Базовые стили таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
  }

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
  }

/* Адаптация под мобильные экраны */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
      display: block;
    }

  thead tr {
      /* Скрываем заголовок таблицы на маленьких экранах */
      position: absolute;
      top: -9999px;
      left: -9999px;
    }

  tr {
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 8px;
      padding: 10px;
    }

  td {
      /* Выравниваем ячейки по блочно */
      border: none;
      position: relative;
      padding-left: 50%;
      text-align: left;
      white-space: normal;
    }

  td::before {
      /* Добавляем лейблы перед каждым значением ячейки */
      content: attr(data-label);
      position: absolute;
      left: 15px;
      top: 10px;
      font-weight: bold;
      white-space: nowrap;
    }
}
.latex {
             display:none;
             position: absolute;
             top: 35%;
             left: 5%;
             width: 90%;
             height: 90%;
             background: white;
             
             border: 2px solid #333;
             box-shadow: 0 0 15px rgba(0,0,0,0.5);
             overflow-y: auto;
             z-index: 20010;
             padding: 20px;
  }
html.dark .latex {
  background: #1f2937;
  color: white;
}

/* Общие стили для textarea */
textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
  resize: vertical;
  border: 1px solid transparent;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  background-color: #fff;
  color: #000;
  border-color: #ccc;
}



/* Тёмная тема */
html.dark textarea {
  background-color: #1e1e1e;
  color: #f1f1f1;
  border-color: #444;
}

/* При фокусе */
textarea:focus {
  outline: none;
  border-color: #4a90e2;
}

.video-preview {
  position: relative;
  width: 100%;
  max-width: 800px; /* можно ограничить максимальную ширину */
  margin-top: 10px;
}

.video-preview iframe,
.video-preview video {

  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 16 \ 9;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.preview {
    background-color: var(--preview-bg, #f9f9f9); /* светлый фон, меняется для тёмной темы */
    color: var(--preview-color, #111);          /* цвет текста */
    border: 1px solid var(--preview-border, #ccc);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 6px;
    min-height: 40px;
    max-height: 180px;
    overflow-y: auto;       /* скролл, если текст длинный */
    font-family: "Arial", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Тёмная тема */
body.dark .preview {
    background-color: #1e1e1e;
    color: #eee;
    border: 1px solid #555;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Адаптивно для мобильных */
@media (max-width: 600px) {
    .preview {
        font-size: 13px;
        padding: 8px 10px;
        max-height: 150px;
    }
}

/* Общий контейнер для чекбокса с подписью */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px; /* расстояние между чекбоксом и текстом */
  padding: 6px 0;
  cursor: pointer;
  font-size: 16px;
}

/* Стиль самого чекбокса */
.checkbox-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #4cafef; /* цвет галочки в современных браузерах */
  cursor: pointer;
}
.checkbox-wrapper span{
     flex: 1;
  }
/* --- Стили для секции заданий --- */
.tasks {
  margin-top: 2rem;
  background-color: var(--widget-bg-color, #fff); /* Используем переменную, если есть */
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tasks h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5em;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.task-card:hover {
    border-color: #ccc;
}

.task-info h4 {
  margin: 0 0 5px 0;
  font-size: 1.1em;
}

.task-info p {
  margin: 0;
  color: #666;
}

/* Класс для анимации исчезновения */
.task-card.task-disappearing {
  opacity: 0;
  transform: translateX(-20px);
}
.approval-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.approval-tab {
  border: 1px solid #9ca3af;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.approval-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.approval-section[hidden] {
  display: none !important;
}
.moderation-feedback:not(:empty) {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  width: fit-content;
  max-width: 100%;
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid #86cba0;
  border-radius: 8px;
  background: #e9f8ee;
  color: #155c35;
  box-shadow: 0 4px 14px #0002;
}
.moderation-feedback.is-error:not(:empty) {
  border-color: #e5a2a2;
  background: #fff0f0;
  color: #8d2020;
}
.teacher-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
}
.teacher-card .teacher-info {
  flex: 1 1 16rem;
}
.teacher-card button:disabled,
.moderation-actions button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.moderation-card {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
}
.moderation-card h2 {
  margin-top: 0;
}
.moderation-card summary {
  cursor: pointer;
}
.moderation-preview {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}
.moderation-field + .moderation-field {
  margin-top: 1rem;
}
.moderation-field h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.moderation-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.moderation-options {
  margin: 0;
  padding-left: 1.5rem;
}
.moderation-options li + li {
  margin-top: 0.3rem;
}
.moderation-table {
  border-collapse: collapse;
  max-width: 100%;
}
.moderation-table th,
.moderation-table td {
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.6rem;
}
.moderation-image {
  display: inline-block;
  max-width: min(100%, 20rem);
  max-height: 20rem;
  object-fit: contain;
  margin: 0.5rem;
}
.moderation-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
