@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;200;400;700&display=swap');
:root{
    --blue: #519fff;
}
* {
    box-sizing: border-box;
    border: none;
    outline: none;
}
body {
    font-family: 'Roboto', sans-serif;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 10px;
}

button{
    cursor: pointer;
}

.button {
    text-transform: uppercase;
    font-size: 14px;
    padding: 10px;
    margin: 5px;
    cursor: pointer;
    font-weight: 200;
    color: var(--blue);
    background: none;
    border: 1px solid var(--blue);
    transition: all 0.3s linear;
    border-radius: 5px;
}

.button:hover{
    color:white;
    background: var(--blue);
}

/* Экраны */
#screen-faculties,
#screen-groups,
#screen-teachers,
#screen-schedule {
    display: none;
}

/* Факультеты */
.faculties-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    justify-content: space-between;
}
.facultet {
    min-width: 150px;
    width: 30%;
    height: 150px;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    padding: 0;
    flex-direction: column;
    justify-content: space-between;
}
@media (max-width: 830px) {
    .facultet {
        width: 45%;
    }
}
@media (max-width: 530px) {
    .facultet {
        width: 100%;
    }
}
.facultet img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    object-fit: contain;
    width: 100%;
    height: 100%;
    transition: all 0.2s ease;
}
.facultet_name {
    text-shadow: 0px -1px 0px rgb(255, 255, 255);
    width: 100%;
    text-align: center;
    font-weight: 600;
    padding: 5px;
    position: absolute;
    bottom: 0;
    height: auto;
    transition: all 0.5s ease;
}
.facultet-btns {
    position: absolute;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 5px;
    top: 100%;
    left: 0;
    width: 100%;
    height: auto;
    transition: all 0.5s ease;
}
.facultet:hover .facultet-btns {
    transform: translate(0, -100%);
}
.facultet:hover .facultet_name {
    transition: all 0.2s ease;
    transform: translate(0, -100%);
    opacity: 0;
}
.facultet:hover img {
    filter: blur(2px);
}

/* Группы/Преподаватели общий вид */
.item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}
.group,
.teacher {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}
#current-target-name {
    font-weight: 400;
}

/* Расписание */
.grid-wrapper {
    /* margin-top: 20px; */
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 400px; /* Минимальная высота на случай, если таблица ещё не загрузилась */
}
.grid-container {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    grid-template-columns: 0.25fr repeat(6, 1fr);
    gap: 10px;
    grid-auto-flow: column;
    transition: transform 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}
.grid-container.active {
    transform: translateX(0);
    z-index: 1;
}
.grid-container>div {
    transition: height 0.5s ease, opacity 0.5s ease;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.subject, .class>div:first-child {
    overflow: hidden;
    max-width: 96%;
    display: block;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    hyphens: auto;
}
.time,
.day,
.lesson,
.empty {
    border: 1px solid #ebebeb;
    border-radius: 5px;
    padding: 5px;
}
.week {
    font-size: 24px;
    text-align: center;
    font-weight: 700;
}
.date {
    text-align: center;
    font-weight: 400;
    margin-top: 5px;
}
.day,
.time {
    background-color: aliceblue;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    justify-content: center;
    align-items: center;
}
.day.past,
.time.past {
    background-color: #a4ffa4;
}

.lesson.ongoing,
.day.ongoing,
.time.ongoing {
    background-color: #ffbaba;
}
.day.finded {
    background-color: #b7c6ff;
}
.lesson {
    background-color: aliceblue;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.lesson .subject {
    font-weight: 700;
    margin-bottom: 10px;
}
.lesson .class {
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}
.linck img {
    max-width: 12px;
}

.teacher-name{
    margin: 10px 0;
    display: none;
}

.teacher-name img {
    max-width: 22px;
}

.empty {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--blue);
    color: #666;
}
.empty::before {
    content: "пусто";
}
.loader {
    color: transparent;
}
.loader>.subject,
.loader>.class {
    max-width: 100%;
    background: linear-gradient(-45deg, #cdd0d3, #cdd0d3, #cdd0d3, #cdd0d3, #cdd0d3, #ffffff, #cdd0d3, #cdd0d3);
    background-size: 300%;
    animation: gradient-flow 2s linear infinite;
    border-radius: 5px;
}
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 0%;
    }
}

.mobile .grid-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile .grid-container > div:first-child,
.mobile .grid-container > .time {
    display: none;
}

.mobile .day {
    margin-top: 20px;
    font-size: larger;
    border-bottom: 1px solid #ccc;
}

.mobile .lesson,
.mobile .empty {
    padding: 0 ;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid #ebebeb;
    border-radius: 5px;
}
.mobile .lesson .time.past,
.mobile .empty .time.past{
    background-color: #a4ffa4;
}
.mobile .empty .time.ongoing {
    background-color: #ffbaba;
}
.mobile .lesson .time,
.mobile .empty .time {
    box-sizing: content-box;
    padding: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 20%;
    border: none;
    border-radius: 0 0 0 0;
    border-right: 1px dashed #ccc;
    background-color: transparent;
}

.mobile .content {
    flex: 1;
    padding: 5px;
}

.mobile .empty .content::before {
    content: "пусто";
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
}

.mobile .lesson .content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.mobile .empty::before {
    display: none;
}
.mobile .lesson > .subject, .mobile .lesson > .class{
    display: none;
}

input[type="date"]{
    cursor: text;
    border: none;
    font-size: 14px;
}

#resetDateBtn:disabled{
    cursor: not-allowed;
}
#btnBackToChoice{
    border-radius: 5px;
    margin: 0 10px 0 0;
}

#resetDateBtn,#goDateBtn, #prevWeekBtn, #nextWeekBtn, #btnBackToChoice{
    color: var(--blue);
    font-size: 0;
    background-color: white;
}

#resetDateBtn:hover,#goDateBtn:hover, #prevWeekBtn:hover, #nextWeekBtn:hover{
    color: white;
    font-size: 0;
    background-color: var(--blue);
}
#resetDateBtn::after{
    content: "✖";
    font-size: 14px;
}
#goDateBtn::after{
    content: "⌕";
    font-size: 14px;
}

#prevWeekBtn::after{
    content: "<";
    font-size: 14px;
}
#nextWeekBtn::after{
    content: ">";
    font-size: 14px;
}
#btnBackToChoice::after{
    content: "◄-";
    letter-spacing: -3px;
    font-size: 13px;
}

.data-peacker{
    display: inline-block;
    border-top: solid 1px var(--blue);
    border-bottom: solid 1px var(--blue);
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    flex-direction: row;
}
.data-peacker button{
    height: 100%;
}

.header{
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.header_title{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.header_schedule_title{
    margin: 0;
}
.data-peacker_conteiner{
    display: flex;
    flex-wrap: nowrap;
}

.mnage_date{
    width: 30px;
    height: 30px;
    border-radius: 0;
    padding: 0;
    border: solid 1px var(--blue);
}

#prevWeekBtn{   
    border-radius: 5px 0 0 5px;
    border-right: none;
}
#nextWeekBtn{   
    border-radius: 0 5px 5px 0;
    border-left: none;
}
.mnage_date_input{
    display: block;
}
