@font-face {
    font-family: "Tilda Sans";
    src: url("/fonts/TildaSans-VF.woff2") format("woff2"), url("/fonts/TildaSans-VF.ttf") format("ttf"), url("/fonts/TildaSans-VF.woff") format("woff");
}

:root{
    --bs-body-font-family: "Tilda Sans", sans-serif;
    --bs-nav-link-font-size: 20px;
    --btn-verix-bg: linear-gradient(155.16deg, #0000FF 12.31%, #8770FE 95.31%);
    --fc-list-event-hover-bg-color: red;
}

.theme-dark {
    --bs-body-color: #FFFFFF;
    --bs-body-bg: radial-gradient(285.54% 96.22% at 50% 100%, #0F1959 0%, #161C38 100%);
    --input-bg-color: #2D316F;
    --logo-url: url("/img/logo_dark-theme.svg");
    --placeholder-color: rgba(159, 173, 255, 1);
    --theme-btn: url("/img/icon_light-theme.svg");
    --text-tetriary: rgba(175, 182, 255, 1);
    --bs-table-border-color: rgba(131, 135, 199, 1);
    --bs-border-color: var(--bs-table-border-color);
    --bs-emphasis-color: #FFFFFF;
    --bs-emphasis-color-rgb: var(--text-tetriary);
    --btn-outline-hover: #8387C7;
    --btn-outline-color: #9FADFF;
    --btn-outline-hover-color: var(--btn-outline-color);
    --text-muted: var(--btn-outline-color);
    --bs-select-bg: transparent;
    --btn-close: invert(1);
    --select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.theme-light {
    --bs-body-color: #002072;
    --bs-body-bg: radial-gradient(285.54% 96.22% at 50% 100%, #FFFFFF 0%, #F0F9FF 100%);
    --input-bg-color: #e7f4fe;
    --logo-url: url("/img/logo_light-theme.svg");
    --placeholder-color: rgba(166, 186, 217, 1);
    --theme-btn: url("/img/icon_dark-theme.svg");
    --text-tetriary: rgba(0, 0, 255, 1);
    --bs-table-border-color: #C3D2E9;
    --bs-border-color: var(--bs-table-border-color);
    --bs-emphasis-color-rgb: var(--text-tetriary);
    --btn-outline-hover: #C3D2E9;
    --btn-outline-color: #A6BAD9;
    --btn-outline-hover-color: #0000FF;
    --text-muted: var(--btn-outline-color);
    --bs-select-bg: transparent;
    --btn-close: invert(0);
    --select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23002072' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    --bs-badge-color: var(--bs-body-color);
}

.theme-dark .table-teritary a {
    color: var(--text-muted) !important;
}

option {
    background-color: var(--input-bg-color);
}

.form-select {
    --bs-form-select-bg-img: var(--select-bg-img);
}

.form-select.is-invalid:not([multiple]):not([size]) {
    --bs-form-select-bg-icon: url("/img/icon_error.svg");
}

.form-select.is-valid:not([multiple]):not([size]) {
    --bs-form-select-bg-icon: url("/img/icon_success.svg");
}

.navbar {
    --bs-navbar-active-color: var(--bs-emphasis-color-rgb);
}

.btn-close {
    --bs-btn-close-filter: var(--btn-close);
    --bs-btn-close-opacity: 1;
}

.btn-verix-outline {
    border: 1px solid var(--btn-outline-hover);
    color: var(--btn-outline-color);
    border-radius: 8px;
}

.btn-verix-outline:hover {
    color: var(--bs-body-color);
    background-color: var(--btn-outline-hover);
}

.nav-underline .nav-link.active, .nav-underline .show > .nav-link {
    font-weight: inherit;
}

.text-muted {
    color: var(--text-muted) !important;
}

.modal {
    backdrop-filter: blur(3px);
    background-color: rgba(3, 7, 26, 0.4);
}

.tab-header {
    font-size: 30px;
}

.gap-tab {
    gap: 40px
}

.btn-util:hover, .btn-util:active, .btn-util:focus {
    color: var(--btn-outline-hover-color);
}

.modal-content {
    background: var(--bs-body-bg);
}

.pt-xxl-5 {
    padding-top: 64px !important;
}

.table-teritary {
    --bs-table-bg: var(--input-bg-color);
}

.table {
    --bs-table-color-state: var(--bs-body-color);
}

tr.table-teritary th {
    border-bottom-width: 0 !important;
}

tr.table-teritary th:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

tr.table-teritary th:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

body {
    background: var(--bs-body-bg);
}

input::placeholder {
    color: var(--placeholder-color) !important;
}

.text-tetriary {
    color: var(--text-tetriary) !important;
}

.navbar {
    padding: 32px 0;
}

.header-container {
    position: relative;
}

.header-content {
    min-height: 32px;
}

.navbar-brand {
    position: absolute;
    left: -154px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    background: var(--logo-url);
    width: 114px;
    height: 32px;
    background-size: cover;
}

@media (max-width: 1640px) {
    .navbar-brand {
        left: -128px;
    }
}

@media (max-width: 991.98px) {
    .navbar-brand {
        position: static;
        transform: none;
        flex: 0 0 114px;
        margin-right: 24px;
    }

    .header-container {
        display: flex;
        align-items: center;
    }
}

.invalid-feedback {
    color: #F3548E;
    text-align: center !important;
}

.form-control {
    color: inherit !important;
}

.form-label {
    display: none;
}

.form-control.is-invalid {
    border-color: #F3548E;
}

.alert {
    position: fixed;
    top: 10%;
    max-width: 80%;
    left: 50%;
    transform: translateX(-50%);
}

.toast-top-right {
    top: 20px; /* Основной сдвиг */
    right: 20px;
    transform: translateY(20px); /* Дополнительный сдвиг */
    margin-top: 20px; /* Альтернативный способ */
    padding-top: 20px; /* Для внутреннего отступа */
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.screenshot-date {
    font-size: 12px;
    color: #6c757d;
}

.screenshot-modal .modal-dialog {
    max-width: 90%;
    max-height: 90vh;
}

.screenshot-modal img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.calendar-day.has-events {
    background-color: var(--input-bg-color);
    font-weight: bold;
}

.history-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

.calendar-card, .screenshots-card {
    overflow: hidden;
}

.card-header {
    padding: 12px 15px;
}

.calendar-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.calendar-nav {
    display: flex;
    gap: 15px;
    min-width: 240px;
    justify-content: space-between;
}

.calendar-view-buttons {
    display: flex;
    gap: 5px;
}

.calendar-container {
    padding: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    color: var(--btn-outline-color);
    padding: 5px 0;
    font-size: 0.9em;
}

.calendar-day {
    text-align: center;
    padding: 8px 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.calendar-day:hover {
    background-color: var(--input-bg-color);
}

.event-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #F3548E;
    color: white;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshots-container {
    padding: 15px;
    min-height: 300px;
    max-height: 70vh;
    overflow-x: auto;
}

.screenshot-item {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: var(--input-bg-color);
    cursor: pointer;
}

.screenshot-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.screenshot-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 1px solid #e0e0e0;
}

.screenshot-info {
    padding: 10px;
}

.screenshot-time {
    font-size: 0.85em;
}

.screenshot-diff {
    font-weight: 600;
    color: #F3548E;
    font-size: 0.95em;
}

.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input {
    flex: 1;
    cursor: pointer;
}

.events-count-badge {
    background: var(--btn-verix-bg);
    color: white;
    padding: 3px 10px;
    border-radius: 7px;
    font-size: 0.9em;
    font-weight: 500;
}

.calendar-day.today {
    background-color: var(--input-bg-color);
    border: 2px solid var(--bs-border-color);
}

.calendar-day.active {
    background: var(--btn-verix-bg);
    color: white;
}

#selected-date {
    font-size: 0.9em;
    font-weight: 500;
    padding: 6px 10px;
}

#modal-channel-title, #modal-history-title {
    width: 100%;
}

input {
    background-color: var(--input-bg-color) !important;
    border-radius: 12px !important;
    border: none !important;
    min-height: 40px;
}

#login-form {
    min-width: 320px;
}

.invalid-feedback {
    min-height: 16px;
    display: block;
    line-height: 16px !important;
}

.form-control.is-invalid {
    background-image: url("/img/icon_error.svg");
}

.form-control.is-valid {
    background-image: url("/img/icon_success.svg");
}

.btn-verix {
    background: var(--btn-verix-bg);
    color: rgba(255, 255, 255, 1);
    border: none;
    padding: 10px 12px;
    line-height: 20px;
    border-radius: 8px;
}

.btn-verix.btn-sm {
    font-size: 16px;
}

.btn-verix:hover {
    background: linear-gradient(335.16deg, #0000FF 9.31%, #8770FE 92.32%);
    color: #ffffff !important;
}

.btn-verix:focus, .btn-verix:active {
    background: rgba(31, 26, 222, 1) !important;
}

.btn-theme {
    background: var(--theme-btn);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    width: 32px;
    height: 32px;
}

.nav-tabs {
    --bs-nav-tabs-border-width: 0;
}

#channel-form .form-label {
    display: inline-block;
}

.input[type=hidden] .invalid-feedback {
    display: none;
}

#channel-form .invalid-feedback {
    text-align: left !important;
}

.col-md-3 {
    min-width: 265px;
}

.col.filters-card {
    max-width: 290px;
}

.col.me-4 {
    max-width: 127px;
}

textarea, select {
    background-color: var(--input-bg-color) !important;
}

.panel-form .form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.required-field {
    border-color: #c50e29 !important;
    box-shadow: 0 0 0 0.15rem #c50e29;
}

.required-label::after {
    content: " *";
    color: #c50e29;
    font-weight: 700;
}

.monitoring-filter-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px;
}

.monitoring-multi-select {
    min-height: 112px;
}

.monitoring-organization-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 0 18px;
}

.monitoring-organization-title {
    font-size: 18px;
    line-height: 1.25;
}

.monitoring-channel-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
}

.monitoring-channel-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex: 0 0 220px;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    scroll-snap-align: start;
    text-align: left;
}

.monitoring-channel-card:hover {
    border-color: rgba(255, 255, 255, 0.32);
}

.monitoring-thumb-wrap {
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.04);
    display: block;
    width: 100%;
}

.monitoring-thumb {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.monitoring-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 78px;
    padding: 10px;
}

.monitoring-channel-name {
    font-weight: 600;
    line-height: 1.25;
}

.monitoring-time-badge {
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    padding: 6px 8px;
}

.monitoring-modal-layout {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) 280px;
}

.monitoring-modal-image-wrap {
    align-items: center;
    background: #111;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 360px;
    overflow: hidden;
}

.monitoring-modal-image {
    display: block;
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
}

.channel-activity-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.channel-activity-dot-active {
    background: #198754;
}

.channel-activity-dot-warn {
    background: #ffc107;
}

.channel-activity-dot-down {
    background: #dc3545;
}

@media (max-width: 768px) {
    .monitoring-modal-layout {
        grid-template-columns: 1fr;
    }

    .monitoring-channel-card {
        flex-basis: 190px;
    }
}

@media (min-width: 1200px) {
    .modal-xl {
        --bs-modal-width: calc(100% - 100px);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .channel-history .row {
        flex-direction: column;
    }

    .channel-history .col-md-5,
    .channel-history .col-md-7 {
        width: 100%;
        max-width: 100%;
    }

    .screenshot-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media( max-width:767px ) {
    #login-form {
        width: 75% !important;
        padding: 1rem !important;
    }

    #content-body {
        justify-content: center;
        padding: 1px !important;
    }

    #content-body .row, #content-body .row .col {
        padding: 1px !important;
    }

    .data .btn.btn-success,.data .btn-group {
        width: 45% !important;
    }
}
