/* Write your custom CSS here */
/* Локальные шрифты (self-hosted — отказ от Google Fonts CDN) */
@import url('../fonts/golos-text/golos-text.css');
@import url('../fonts/ubuntu/ubuntu.css');

/* Базовые стили для всего документа */
body {
    font-family: 'Golos Text', sans-serif;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Разрешаем вертикальную прокрутку на touch-устройствах,
       предотвращая предупреждения о passive event listeners */
    touch-action: pan-y;
}

/* Стили для всех заголовков */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Ubuntu', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem 0;
}

/* Дополнительные элементы для единообразия */
button,
input,
textarea,
select {
    font-family: inherit;
}

/* Опциональные стили для специфических элементов */
article p {
    margin-bottom: 1.5em;
}

body {
    overflow-x: hidden;
}

@media screen and (max-width: 480px) {
    .sidebar-hidden .main-wrapper {
        overflow: hidden !important;
        display: none;
    }
}

@media (max-width: 1350px) {
    .page-sidebar {
        z-index: 0
    }
}

html[dir="rtl"] ul.accordion-menu svg {
    margin-left: 10px;
}

html[dir="rtl"] body {
    overflow-y: visible;
}

html[dir="rtl"] .tr-text {
    margin-right: 20px;
}

html[dir="rtl"] .page-sidebar {
    position: absolute;
    left: 0;
    margin-left: 10px;
    height: auto;
    height: -webkit-fill-available;
}

@media screen and (max-width: 480px) {
    html[dir="rtl"] .page-sidebar {
        margin-left: 5.5vw
    }
}

.accordion-menu {
    z-index: 100000;
}

tr.calendar.day {
    background-color: #0090ff !important;
    --bs-table-striped-bg: #0090ff !important;
    color: white !important;
    text-align: center !important;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-miltistring {
    --max-lines: 3;
    max-height: calc(1.5rem * 3);
    overflow: hidden;
}

.pair {
    text-align: center;
    min-width: 50px;
    max-width: 50px
}

.rounded-circle {
    border-radius: 30rem
}

div.col-xl-2>div>span.video_type {
    position: absolute;
    top: 115px;
    left: 30px;
}

div.col-xl-3>div>span.video_type {
    position: absolute;
    top: 165px;
    left: 30px;
}

div.col-xl-2>div>img {
    height: 125px;
}

div.col-xl-3>div>img {
    height: 175px;
}

/* Мессенджер */
div.mail-text {
    overflow-y: auto;
}

.open-email-content {
    overflow-y: hidden !important;
}

ul.messenger-dialog {
    margin-left: 0;
    /* Отступ слева в браузере IE и Opera */
    padding-left: 0;
    /* Отступ слева в браузере Firefox, Safari, Chrome */
    max-height: calc(100vh - 520px);
}

.mail-info .mail-author img.online {
    width: 50px;
    border-radius: 50px;
    border: 4px solid rgb(0, 144, 255);
    float: left;
}

ul.messenger-dialog>li {
    list-style-type: none;
}

ul.messenger-dialog>li>p {
    margin: 0;
}

ul.messenger-dialog>li>time {
    font-size: 10px;
}

ul.messenger-dialog>li>div.btn-group {
    margin-top: 20px;
    margin-bottom: -10px;
    margin-left: -20px;
    margin-right: -10px;
    width: 110%;
}

ul.messenger-dialog>li>div.btn-group>.btn {
    border-radius: 0px !important;
}

ul.messenger-dialog>li>div.btn-group>.btn:last-child {
    border-bottom-right-radius: 30px !important;
}

/* Messenger - новые стили */
.messenger-dialog {
    display: flex;
    flex-direction: column-reverse;
    padding: 10px;
    max-height: calc(100vh - 430px);
    overflow-y: auto;
}

.msg-date-divider {
    text-align: center;
    margin: 16px 0;
}

.msg-date-divider span {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #6c757d;
}

.msg-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    max-width: 75%;
    width: fit-content;
}

.msg-wrapper.msg-in {
    align-self: flex-start;
}

.msg-wrapper.msg-out {
    align-self: flex-end;
}

.msg-author {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    padding-left: 14px;
}

.msg-in .msg-author {
    color: #6c757d;
}

.msg-out .msg-author {
    color: #0090ff;
    text-align: right;
    padding-left: 0;
    padding-right: 14px;
}

.msg-bubble {
    padding: 8px 14px;
    border-radius: 18px;
}

.msg-in .msg-bubble {
    background: #f0f0f0;
    border-bottom-left-radius: 4px;
}

.msg-out .msg-bubble {
    background: rgba(0, 144, 255, 0.1);
    border-bottom-right-radius: 4px;
}

.msg-out .msg-time {
    text-align: right;
}

.msg-text {
    word-wrap: break-word;
    line-height: 1.4;
    white-space: pre-wrap;
}

.msg-time {
    display: block;
    font-size: 10px;
    color: #adb5bd;
    margin-top: 4px;
}

.msg-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.msg-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.msg-attachment:hover {
    background: rgba(0,0,0,0.08);
}

.msg-attachment i {
    font-size: 18px;
    color: #0090ff;
}

.msg-attachment small {
    color: #6c757d;
}

.mail-text::-webkit-scrollbar {
    width: 12px;
    /* ширина scrollbar */
}

.mail-text::-webkit-scrollbar-thumb {
    background-color: rgba(238, 238, 238, 1);
    display: none;
    background: linear-gradient(52deg, rgba(238, 238, 238, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(242, 242, 242, 1) 100%);
    /* цвет плашки */
    border-radius: 20px;
    /* закругления плашки */
    border: 3px solid white;
    /* padding вокруг плашки */
}

.mail-answer {
    background-color: white;
    padding: 30px;
}

#button-send {
    height: 50px;
}

.card-body .counter-center {
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: center;
}

.card-body .counter-left {
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: left;
}

.card-body .counter-right {
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: right;
}

.card-danger {
    color: white;
    background: rgb(255, 149, 149);
    background: linear-gradient(321deg, rgba(255, 149, 149, 1) 0%, rgba(221, 44, 44, 1) 100%);
}


.card-warning {
    color: white;
    background: rgb(255, 223, 149);
    background: linear-gradient(321deg, rgb(255, 209, 149) 0%, rgb(228, 151, 28) 100%);
}

.card-info {
    color: white;
    background: rgb(149, 221, 255);
    background: linear-gradient(321deg, rgb(149, 204, 255) 0%, rgb(28, 115, 228) 100%);
}

.card-success {
    color: white;
    background: rgb(161, 255, 149);
    background: linear-gradient(321deg, rgb(149, 255, 167) 0%, rgb(22, 185, 58) 100%);
}

.select-picture {
    position: absolute;
    color: white;
    background: #00000063;
    border-radius: 150px;
    display: none;
}

.schedule-program {
    padding: 0;
    margin: 0;
}

.schedule-add-button {
    margin-top: 14px;
    margin-left: 14px;
    margin-right: 14px;
    width: 20%;
    float: center;
}

.loader .hints {
    top: 60%;
    position: absolute;
    width: 100%;
    height: 40px;
}

ul.messenger-dialog-attachments {
    list-style: none;
    padding: 0;
}

ul.messenger-dialog-attachments>li {
    margin-top: 5px;
    margin-bottom: 5px;
}

ul.messenger-dialog-attachments>li>a {
    display: flex;
    flex-flow: row;
    gap: 10px;
}

ul.messenger-dialog-attachments>li>a>div.attachment-icon {
    padding: 15px;
    width: 50px;
    height: 50px;
    border-radius: 17px;
    display: flex;
    justify-content: center;
    align-items: center;
}

ul.messenger-dialog-attachments>li>a>div.attachment-file {
    display: flex;
    flex-flow: column;
}

ul.messenger-dialog-attachments>li>a>div.attachment-file>p {
    margin-bottom: 0;
}

.alert-card {
    background-color: #ffffff;
}

/* ========================================
   Global Search Component
   ======================================== */
.global-search-dropdown {
    width: 400px;
    max-width: calc(100vw - 2rem);
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background: #fff;
}

.global-search-dropdown.show {
    display: block;
}

.search-input-wrapper {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8f9fa;
}

.search-input-wrapper .form-control {
    padding-right: 4rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: #212529;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.search-spinner {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.search-clear-btn {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #343a40;
}

.search-clear-btn svg {
    width: 16px;
    height: 16px;
}

.search-suggestions {
    max-height: 400px;
    overflow-y: auto;
}

.search-message {
    padding: 2rem 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.search-results {
    padding: 0.5rem 0;
}

.search-category {
    padding: 0.5rem 0;
}

.search-category:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-category-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-category-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
    cursor: pointer;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background-color: rgba(0, 123, 255, 0.08);
}

.search-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-item-icon-bg {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.search-item-icon svg {
    color: #6c757d;
    width: 18px;
    height: 18px;
}

.search-item-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e9ecef;
}

.search-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.search-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-description {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-show-all {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.search-show-all-link {
    font-size: 0.875rem;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.search-show-all-link:hover {
    text-decoration: underline;
}

.search-hint {
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.search-hint kbd {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-family: inherit;
    color: #212529;
}

/* Category colors */
.search-category[data-category="services"] .search-category-title { color: #37C4D8; }
.search-category[data-category="news"] .search-category-title { color: #F97316; }
.search-category[data-category="teachers"] .search-category-title { color: #8B5CF6; }
.search-category[data-category="groups"] .search-category-title { color: #22C55E; }
.search-category[data-category="contacts"] .search-category-title { color: #3B82F6; }
.search-category[data-category="documents"] .search-category-title { color: #EF4444; }

@media (max-width: 576px) {
    .global-search-dropdown {
        width: calc(100vw - 1rem);
        right: 0.5rem;
        left: 0.5rem;
        position: fixed;
        top: 60px;
    }
    .search-suggestions {
        max-height: calc(100vh - 200px);
    }
}

/* Компактные стили для расписания преподавателя */
.teacher-info.teacher-schedule {
    padding-top: 10px;
    padding-bottom: 15px;
}

.teacher-schedule-programs {
    max-height: calc(100vh - 280px);
}

.open-schedule-content {
    height: auto;
    max-height: calc(100vh - 150px);
}

.teacher-schedule-card {
    overflow: hidden;
}

@media (max-width: 768px) {
    .teacher-schedule-programs {
        max-height: calc(100vh - 320px);
    }
    .open-schedule-content {
        max-height: calc(100vh - 180px);
    }
}
