/* Горизонтальный скролл при необходимости */
html {
  overflow-x: auto;
}

/* Подключение обычного переменного шрифта Inter */
@font-face {
    font-family: 'Inter Variable';
    src: url('/static/fonts/InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}

/* Подключение курсивного переменного шрифта Inter */
@font-face {
    font-family: 'Inter Variable';
    src: url('/static/fonts/InterVariable-Italic.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
    font-style: italic;
}


body {
  min-width: 540px;
  font-family: 'Inter Variable', 'Segoe UI', system-ui, -apple-system, 'Roboto', sans-serif; 
  background-color: #F8F9FA;
}

/* Header styles */
#header {
  background-image: url(../image/head3.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding-top: 1rem;
  padding-bottom: 0;
}

#main_content {
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 20px;
  color: #212529;
}

.device-description {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Offcanvas styles */
.offcanvas-body .nav-link {
  padding: 1rem 1.5rem;
  border-left: 3px solid transparent;
}

.offcanvas-body .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-left: 3px solid white;
}

/* User menu positioning */
.dropdown-toggle {
  padding: 0.5rem 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .dropdown-toggle span {
    display: none;
  }
}

.card {
  /* background-color: #E9ECEF; */
  border-radius: 12px;
}

.card-header {
  background-image: url(../image/head3.jpg);
  /* color: white; */
}


.card-body,
.input-group-text,
.input-date:not(:disabled),
.input-time:not(:disabled),
.input-combobox:not(:disabled) {
  background-color: rgba(100, 168, 250, 0.5);
}
.input-combobox:disabled,
.input-date:disabled,
.input-time:disabled {
  background-color: #b0c4de;
  opacity: 0.7;
  cursor: not-allowed;
}

.Errors_data {
  color: red;
}


@media (min-width: 576px) {
  .min-width-container {
    min-width: 540px; /* sm в Bootstrap */
  }
}

@media (min-width: 768px) {
  .min-width-container {
    min-width: 720px; /* md в Bootstrap */
  }
}

@media (min-width: 992px) {
  .min-width-container {
    min-width: 960px; /* lg в Bootstrap */
  }
}

@media (min-width: 1200px) {
  .min-width-container {
    min-width: 1140px; /* xl в Bootstrap */
  }
}

@media (min-width: 1400px) {
  .min-width-container {
    min-width: 1320px; /* xxl в Bootstrap */
  }
}

select.form-select:focus {
  background-color: #e0f0ff !important; /* Очень нежный голубой (цвет подсветки) */
}

.input-group.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.input-group.disabled .input-group-text,
.input-group.disabled .form-control {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.input-group.disabled .bi-calendar3 {
  color: #6c757d !important;
}

/* ==========СТИЛИ ДЛЯ ГРУПП УСТРОЙСТВ ========== */

/* Оформление кнопок групп */
.nav .nav-link.dropdown-toggle {
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
    color: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav .nav-link.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Активная группа */
.nav .nav-link.dropdown-toggle.active-group {
    background-color: rgba(255, 255, 255, 0.25);
    border-bottom: none;
    font-weight: 500;
    border-radius: 4px;
}

/* Выпадающее меню */
.nav .dropdown-menu {
    background-color: #2c3e50;
    border: none;
    border-radius: 0 0 8px 8px;
    margin-top: 0;
    padding: 0;
    min-width: 100%;
    width: auto;
}

/* Пункты выпадающего меню */
.nav .dropdown-item {
    color: white;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.nav .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Активное устройство в выпадающем меню */
.nav .dropdown-item.active {
    background-color: #0d6efd;
    color: white;
    font-weight: 500;
}

/* Стрелка dropdown */
.nav .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.5em;
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Открытое меню */
.nav .dropdown.show .dropdown-menu {
    display: block;
}

/* Чтобы меню было привязано к левому краю вкладки */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .dropdown-menu {
    left: 0;
    right: auto;
}

/* Обычные пункты навигации (без dropdown) — например, «Мероприятия» */
#main-nav .nav-link:not(.dropdown-toggle) {
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
    color: white;
    transition: all 0.2s ease;
}

#main-nav .nav-link:not(.dropdown-toggle):hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ========== ПОЛНОЕ УДАЛЕНИЕ ЗАЗОРА МЕЖДУ КНОПКОЙ И МЕНЮ ========== */

/* Принудительно убираем отступы у всех выпадающих меню */
.dropdown-menu {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Для навигации */
.nav .dropdown-menu {
    margin-top: 0 !important;
}

/* Для конкретных элементов */
.nav-item.dropdown .dropdown-menu {
    margin-top: 0 !important;
    top: 100% !important;
}

/* Удаляем любые псевдоэлементы, которые могут создавать зазор */
.nav-item.dropdown .dropdown-menu::before,
.nav-item.dropdown .dropdown-menu::after {
    display: none !important;
    content: none !important;
}

/* Убираем возможный отступ у кнопки */
.nav-item.dropdown .nav-link {
    margin-bottom: 0 !important;
}

/* Для меню пользователя */
.flex-shrink-0 .dropdown-menu {
    margin-top: 0 !important;
}

/* Полностью переопределяем позиционирование для открытого меню */
.dropdown-menu.show {
    margin-top: 0 !important;
    transform: translateY(0) !important;
}

footer {
    height: 100px;
    background-image: url(../image/head3.jpg);
}

/* ========== COOKIE УВЕДОМЛЕНИЕ ========== */

.cookie-consent {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background-color: rgba(100, 168, 250);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: cookieSlideUp 0.3s ease-out;
}

@keyframes cookieSlideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.cookie-consent-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    flex: 1;
}

.cookie-consent-text a {
    color: #ffc107;
    text-decoration: underline;
}

.cookie-consent-text a:hover {
    color: #1cf895;
    text-decoration: underline;
    font-weight: bold;
}

.cookie-consent .btn-dark {
    background-color: #212529;
    border: none;
    padding: 6px 20px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.cookie-consent .btn-dark:hover {
    background-color: #000;
    transform: scale(1.02);
}

/* ========== УВЕДОМЛЕНИЯ (TOAST) ========== */

.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 90%;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
    max-width: 800px;
    min-width: 600px;
    margin: 0 auto 8px auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: opacity 0.8s ease, transform 0.8s ease;
    opacity: 1;
    transform: translateY(0);
    background-color: rgba(233, 236, 239, 0.7) !important;
    backdrop-filter: blur(4px);
}

.toast-container .toast.hiding {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
}

.toast-container .toast .toast-body {
    font-size: 1rem;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    color: black;
}

.toast-container .toast .btn-close {
    opacity: 0.5;
}

.toast-container .toast .btn-close:hover {
    opacity: 1;
}

/* ========== КАСКАДНОЕ МЕНЮ "ДАННЫЕ ИЗМЕРЕНИЙ" ========== */

.cascade-dropdown .dropdown-submenu {
    position: relative;
}

.cascade-dropdown .dropdown-toggle-submenu {
    position: relative;
    padding-right: 2rem;
}

.cascade-dropdown .dropdown-toggle-submenu::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Подменю каскадного меню — принудительно справа от группы */
.nav-item.dropdown .dropdown-submenu > .dropdown-menu.submenu {
    position: absolute;
    top: 0 !important;
    left: 100% !important;
    right: auto !important;
    margin: 0;
    display: none;
    min-width: 200px;
    background-color: #3d566e;
    border-radius: 0 8px 8px 0px;
}

.nav-item.dropdown .dropdown-submenu > .dropdown-menu.submenu.show {
    display: block;
}

/* Активный пункт «Мероприятия» (без dropdown) */
#main-nav .nav-link.active-group {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 500;
    border-radius: 4px;
}