@font-face {
    font-family: 'main';
    src: url('../font/main.otf') format('opentype');
}

/* @font-face {
    font-family: 'main';
    src: url('../font/main2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-017F, U+0180-024F;} */

body {
    background-color: rgb(233, 245, 243);
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    font-family: 'main', sans-serif;
    background-size: cover;
    margin: 0;
    padding: 0;
}

.panel {
    background-color: rgba(250, 250, 250, 0.7);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    display: flex;
    position: fixed;
    width: 60%;
    height: 50px;
    top: 2%;
    left: 20%;
    z-index: 1000;
    align-items: center;
    border-radius: 18px;
}

/* Для телефонов (до 768px) */
@media (max-width: 768px) {
    .panel {
        width: 95% !important;          /* Почти на всю ширину */
        left: 0% !important;          /* Центрируем: (100% - 95%) / 2 */
        height: 60px !important;        /* Выше для удобства касания */
        top: 1% !important;             /* Чуть ближе к краю */
        border-radius: 15px !important; /* Меньше скругление */
        padding: 0 15px !important;     /* Отступы по бокам */
    }
}

/* Для очень маленьких телефонов (до 480px) */
@media (max-width: 480px) {
    .panel {
        width: 98% !important;    
        height: 55px !important;        /* Чуть меньше */
        top: 0.5% !important;
        border-radius: 12px !important;
        padding: 0 10px !important;
    }
}

/* Для планшетов (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .panel {
        width: 80% !important;
        left: 10% !important;
    }
}

.menu {
    background-color: rgba(250, 250, 250, 0.7);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    border-radius: 50px;
    margin-top: 20px;
    padding-left: 20px;
    padding-top: 20px;
    width: 20%;
}

.end {
    background-color: rgb(19, 19, 19);
    box-shadow: 0 4px 12px rgb(0, 0, 0);
    width: 100%;
    height: 100px;
    z-index: 1000;
}

input {
    transition-duration: 300ms;
    border-radius: 10px;
    border-color: #00000050;
    background-color: rgb(255, 255, 255);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    width: 100%;
    height: 25px;
    font-size: 18px;
    padding-left: 15px;
    margin-top: 10px;
}

input:hover {
    transition-duration: 300ms;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.207);
    background-color: rgb(233, 245, 243);
    border-color: #000;
}

button {
    transition-duration: 300ms;
    border-color: #00000050;
    background-color: rgb(233, 245, 243);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    height: 25px;
    padding-top: 0px;
    padding-left: 15px;
    margin-top: 10px;
    min-width: 20%;
    min-height: 10%;
    border: none;
    font-family: 'main', sans-serif;
}

button:hover {
    transition-duration: 300ms;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.207);
    border-color: #000;
}

.post {
    background-color: rgba(250, 250, 250,0.7);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    border-radius: 50px;
    margin-top: 20px;
    padding-left: 40px;
    padding-top: 20px;
}

.profile_direct {
    transition-duration: 300ms;
    width: 80%;
}
.profile_direct:hover {
    transition-duration: 300ms;
    background-color: rgb(233, 245, 243);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.207);
    border-radius: 50px;
    padding-left: 30px;
    padding: 10px 15px;
    width: 80%;
}

button {border-radius:50px;border-color:#000;background-color:rgba(255, 255, 255, 0.27);}

.content {
    padding-top: 60px; /* высота панели + небольшой зазор */
    padding-left: 20px;
    padding-right: 20px;
}

h1,h2,h3,h4,h5,h6 {
   font-family: "main" 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
   color: #000;
   margin: 0;
   padding: 0;
}

/* Стилизация всей полосы прокрутки */
::-webkit-scrollbar {
    width: 12px; /* Ширина вертикального скроллбара */
    height: 12px; /* Высота горизонтального скроллбара */
}

/* Стилизация дорожки (фона) */
::-webkit-scrollbar-track {
    background-color: rgb(233, 245, 243);
    border-radius: 10px;
}

/* Стилизация бегунка (ползунка) */
::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.267);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.267);
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

/* Стилизация при наведении */
::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

html {
    scrollbar-width: thin; /* auto | thin | none */
    scrollbar-color: rgba(0, 0, 0, 0.267) rgb(233, 245, 243); /* ползунок фон */
}

.menu_post {
    background-color: rgba(250, 250, 250, 0.7);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    border-radius: 50px;
    margin-top: 20px;
    padding-left: 40px;
    padding-top: 20px;
    padding-right: 60px;
}

.menu_profile {
    background-color: rgba(250, 250, 250, 0.7);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    border-radius: 50px;
    margin-top: 20px;
    padding-left: 40px;
    padding-top: 20px;
    padding-right: 60px;
}

.content_profile {padding-top:5%; width: 50%;padding-left:25%;}

@media (max-width: 768px) {
.content_profile {
    width: 100% !important;
    padding-left:0% !important;
}}

.content_settings {
    border-radius: 50px;
    margin-top: 100px;
    padding-left: 40px;
    padding-top: 20px;
    padding-right: 60px;}

@media (max-width: 768px) {
.content_settings {
    padding-left:7% !important;
}}

.switch {
  position: relative;
  display: inline-block;
  width: 60px; /* Ширина тумблера */
  height: 34px; /* Высота тумблера */
}

/* Скрываем сам checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Ползунок (слайдер) */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* Цвет в выключенном состоянии */
  transition: .4s; /* Плавность анимации */
  border-radius: 34px;
}

/* Передвигаем ползунок при активном состоянии (checked) */
.switch input:checked + .slider {
  background-color: #2196F3; /* Цвет в включенном состоянии */
}

/* Круглый элемент внутри ползунка */
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: rgb(233, 245, 243);
  transition: .4s;
  border-radius: 50%;
}

/* Перемещение кругляшка при checked */
input:checked + .slider:before {
  transform: translateX(26px);
}

/* Стили для круглого тумблера */
.slider.round {
  border-radius: 34px;
}

/* Основной контейнер чата — как наша сакля: прочная и уютная */
.chat_direct {
    background-color: rgba(250, 250, 250, 0.7);
    box-shadow: 0 8px 12px rgba(231, 231, 231, 0.7);
    border-radius: 30px; /* Скругление как камни в горной реке */
    margin-top: 20px;
    width: 70%;
    height: 80%;
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 25px;
    left: 23%;
    top: 13%;
    box-sizing: border-box; /* Чтобы ничего не вываливалось как пересоленный суп */
}

/* Шапка чата — как папаха: должна сидеть идеально */
.chat_header {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    flex-wrap: nowrap; /* Запрещаем перенос, как запрещаем опаздывать на застолье */
}

/* Аватар — как лицо горца: всегда в центре внимания */
.chat_avatar {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid rgba(0, 0, 0, 0.1); /* Рамка как узор на кинжале */
    flex-shrink: 0; /* Не даём сжиматься, как не даём обидеть сестру */
}

/* Имя пользователя — как фамилия: гордо и нерушимо */
.chat_name {
    margin-left: 15px;
    margin-top: 0;
    color: #000;
    font-size: 1.5em;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Контейнер для иконок — как стойка с оружием: всё под рукой */
.chat_icons {
    display: flex;
    gap: 15px; /* Расстояние как между домами в ауле */
    flex-shrink: 0; /* Не даём съёживаться */
}

/* Ссылки иконок — как кинжалы на поясе: всегда наготове */
.icon_link {
    display: inline-block;
    transition: transform 0.2s; /* Плавность как у лезгинки */
}

/* Сами иконки — как орлы: чёткие и ясные */
.icon {
    width: 40px; /* Немного уменьшил, чтобы не жирно было */
    height: 40px;
    padding: 5px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2)); /* Тень для объёма */
}

/* Разделители — как горные хребты: чёткие линии */
.chat_divider {
    width: 100%;
    height: 1px;
    border: none;
    background-color: rgba(0,0,0,0.12);
    margin: 10px 0 20px 0;
}

/* Контейнер сообщений — как долина: просторная и вместительная */
.messages_direct {
    width: 100%;
    height: 65%;
    overflow-y: auto; /* Скролл как горная дорога — можно прокатиться */
    flex-grow: 1;
    padding: 10px;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.3); /* Лёгкая дымка как утром в горах */
    border-radius: 15px;
    margin-bottom: 15px;
}

/* Область ввода — как очаг: сердце дома */
.message_input_area {
    width: 100%;
    margin-top: auto; /* Прижимаем вниз как гость после третьего тоста */
}

.input_divider {
    width: 100%;
    height: 1px;
    border: none;
    background-color: rgba(0,0,0,0.08);
    margin: 15px 0;
}

/* Обёртка для инпута и кнопки — как лепёшка с сыром: неразлучны */
.input_wrapper {
    display: flex;
    gap: 15px; /* Промежуток как между тостами */
    align-items: center;
    width: 100%;
}

/* Поле ввода — как гостеприимный дом: всегда открыто */
.message_input {
    flex-grow: 1;
    padding: 15px 20px;
    border-radius: 25px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

/* Кнопка отправки — как джигит: смелый и заметный */
.send_button {
    padding: 0px 30px;
    border-radius: 25px;
    border: none;
    background-color: rgb(233, 245, 243);
    border-color: #000;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0; /* Не даём сжаться */
    min-width: 120px; /* Минимальная ширина как минимальное уважение */
}

.send_button:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.267);
}

.send_button:active {
    transform: translateY(0); /* При нажатии как приземлившийся орёл */
}

/* ===== АДАПТАЦИЯ ДЛЯ ТЕЛЕФОНОВ ===== */
/* Для телефонов (до 768px) — как для узких горных троп */
@media (max-width: 768px) {
    .chat_direct {
        margin-top: 15px !important;
        width: 76% !important; /* Шире, чтобы использовать пространство */
        height: 86% !important; /* Выше, чтобы не скрючивался */
        left: 22% !important; /* Центрируем по-братски */
        top: 9% !important;
        padding: 20px 15px; /* Меньше отступы, но не как в тесной маршрутке */
        border-radius: 20px; /* Чуть менее кругло */
    }
    
    .hide-on-mobile {
        display: none !important; /* Прячем лишнее как старый ковёр на лето */
    }
    
    .chat_avatar {
        width: 50px; /* Чуть меньше, но всё ещё достойно */
        height: 50px;
    }
    
    .chat_name {
        font-size: 1.2em; /* Имя как отцовский наказ — короче, но весомее */
        margin-left: 10px;
    }
    
    .chat_icons {
        gap: 10px; /* Иконки ближе, как соседи в горах */
    }
    
    .icon {
        width: 35px; /* Компактнее, но всё ещё читаемо */
        height: 35px;
    }
    
    .messages_direct {
        height: 70%; /* Больше места для сообщений */
        padding: 8px;
    }
    
    .input_wrapper {
        flex-direction: column; /* Ставим в столбик как бутылки на столе */
        gap: 12px;
    }
    
    .message_input {
        width: 100%;
        padding: 12px 18px;
    }
    
    .send_button {
        width: 100%; /* Кнопка во всю ширину как гостеприимство */
        min-width: auto;
    }
    
    .menu {
        width: 15% !important;
    }
}

/* Для очень маленьких телефонов (до 480px) — как для карманного кинжала */
@media (max-width: 480px) {
    .chat_direct {
        width: 96% !important;
        left: 2% !important;
        padding: 15px 12px;
        border-radius: 18px;
    }
    
    .chat_header {
        flex-wrap: wrap; /* Разрешаем перенос в крайнем случае */
        justify-content: space-between;
    }
    
    .chat_name {
        font-size: 1.1em;
        order: 3; /* Имя переносим вниз если не влезает */
        width: 100%;
        margin-top: 10px;
        margin-left: 0;
        text-align: center;
    }
    
    .chat_icons {
        order: 2; /* Иконки после аватарки */
    }
}