/*
# Copyright (c) 2018 Grigoriy Ermolaev (igflocal@gmail.com)
# Calendar for MantisBT is free software: 
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, 
# either version 2 of the License, or (at your option) any later version.
#
# Calendar plugin for for MantisBT is distributed in the hope 
# that it will be useful, but WITHOUT ANY WARRANTY; without even the 
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Customer management plugin for MantisBT.  
# If not, see <http://www.gnu.org/licenses/>.
*/

.calendar-user {
    border-collapse: collapse;
    width: calc(100%);
    box-shadow: 0 0 7px #CACACA;
}

.calendar-user td {
    border: 1px solid #E0E0E0;
    vertical-align: top;
    padding: 0;
    height: 140px;
    position: relative;
}

td.column-time-td {
    width: 65px;
    min-width: 65px;
}

td.column-day-td,
td.column-this-day-td {
    min-width: 140px;
}

td.column-this-day-td {
    background: rgba(3, 169, 244, 0.13);
}

ul.column-header-day {
    background: #F1EFDE;
    padding: 10px;
    margin: 0;
    font-weight: bold;
    text-align: center;
    position: relative;
}

ul.hour {
    border-bottom: 1px solid #E0E0E0;
    position: relative;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

ul.hour li {
    height: 19.5px;
    text-align: center;
    font-weight: bold;
    color: #80808B;
}

ul.hour li:last-child {
    border-top: 1px solid #F1EFDE;
    border-top-style: dashed;
}

.hour.last-row,
.hour.last-row li {
    border-bottom: none;
    background: #F1F5F7;
}

/* Общие стили для событий недельного вида */
a#event_week,
a#event_week_expired {
    overflow: hidden;
    position: absolute;
    left: -1px;
    right: -1px;
    box-sizing: border-box;
    border: 1px solid rgb(206, 230, 105);
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 0 4px #90A53B;
    text-decoration: none;
    color: #535c69;
    font-weight: bold;
    padding-left: 5px;
    padding-top: 1px;
}

a#event_week {
    background: rgba(215, 232, 143, 1);
}

a#event_week_expired {
    background: rgba(232, 232, 226, 1);
    cursor: pointer;
    text-align: left;
}

a#event_week:hover,
a#event_week_expired:hover {
    z-index: 999999 !important;
}

/* Стили для списка задач */
.tasks-list {
    margin: 0;
    overflow-y: scroll;
}

.tasks-list a {
    display: block;
    margin: 3px 3px;
    padding: 7px;
    font-size: 12px;
    text-decoration: none;
    color: inherit;
    border-radius: 3px;
}

.tasks-list-area {
    height: 350px;
    overflow-y: scroll;	
}

.task-area {
    margin: 4px 4px;
    border-radius: 2px;
    position: relative;
    font-size: 12px;
}

.task-area label {
    cursor: pointer;
    display: block;
    padding: 7px;
}

.task-area b {
    padding: 7px;
}

/* Стили для месячного вида */
.calendar-cell {
    height: 120px;
    width: 14.28%;
    padding: 5px;
    position: relative;
    background-color: #ffffff;
    vertical-align: top;
}

.calendar-cell.other-month {
    background-color: #f5f5f5;
}

.calendar-cell.other-month .calendar-day-number {
    color: #999;
}

.calendar-cell.other-month .calendar-event {
    opacity: 0.8;
    background: #e9ecef;
}

.calendar-cell.other-month .calendar-event-empty {
    opacity: 0.8;
}

.calendar-cell.clickable,
.calendar-event-empty.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-cell.clickable:hover {
    background-color: rgba(33, 150, 243, 0.05);
}

.calendar-cell.active,
.calendar-event-empty.active,
.calendar-event-empty.selected,
.calendar-day-header.active {
    background-color: rgba(33, 150, 243, 0.1);
    border: 1px dashed #2196f3;
}

.calendar-cell.active::after,
.calendar-day-header.active::after {
    content: "+";
    position: absolute;
    color: #2196f3;
    font-size: 20px;
    font-weight: bold;
}

.calendar-cell.active::after {
    right: 10px;
    top: 10px;
}

.calendar-day-header.active::after {
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
}

.calendar-day-number {
    font-weight: bold;
    margin-bottom: 5px;
    color: #000000;
    padding: 2px 8px;
    position: relative;
    display: inline-block;
}

.calendar-today .calendar-day-number {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    border: none;
}

/* Стили для событий */
.calendar-event {
    background: #e9ecef;
    padding: 2px 5px;
    margin: 2px 0;
    border-radius: 3px;
    font-size: 12px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 20px;
    line-height: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    position: relative;
}

.calendar-event:hover {
    background: #dee2e6;
}

.calendar-event.active {
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px dashed #28a745;
}

.calendar-event.active:hover {
    background-color: rgba(40, 167, 69, 0.3);
}

.calendar-event a {
    color: #495057;
    text-decoration: none;
    display: block;
    pointer-events: none;
    position: absolute;
    white-space: nowrap;
}

.calendar-event a:hover {
    text-decoration: none;
    color: #000;
}

.calendar-event-empty {
    height: 20px;
    margin: 2px 0;
    border-radius: 3px;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event-empty.active::after,
.calendar-event-empty.selected::after {
    content: "+";
    color: #2196f3;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.event-time {
    font-weight: bold;
    color: #495057;
    margin-right: 5px;
}

.event-duration {
    color: #6c757d;
    font-size: 11px;
    margin-right: 5px;
}

/* Стили для дополнительных событий */
.calendar-more-events {
    color: #2196f3;
}

.calendar-more-events:hover {
    text-decoration: underline;
}

.calendar-more-events .fa {
    white-space: nowrap;
    position: absolute;
    margin: inherit;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    /*z-index: 1000;*/
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    /* margin: 15% auto; */
    /* padding: 0; */
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    /* max-height: calc(100vh - 40px); */
    /* display: flex; */
    /* flex-direction: column; */
    /* position: relative; */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    /*background: #fefefe;*/
    z-index: 1;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #495057;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover {
    color: black;
}

.modal-body {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(100vh - 120px);
}

.modal-events-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.modal-event {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.modal-event:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.modal-event .event-time {
    font-weight: bold;
    color: #495057;
    margin-right: 10px;
    min-width: 45px;
}

.modal-event .event-duration {
    color: #6c757d;
    font-size: 12px;
    margin-right: 10px;
    min-width: 45px;
}

.modal-event .event-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-event .event-project {
    color: #6c757d;
    font-size: 12px;
    margin-left: 10px;
    min-width: 100px;
}

.modal-event.expired {
    opacity: 0.7;
    background-color: #f8f9fa;
}

.modal-event.expired .event-name a {
    color: #6c757d;
}

.modal-event.expired .event-time,
.modal-event.expired .event-duration {
    color: #6c757d;
}

.modal-empty {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* Стили для форм */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: .5rem;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Стили для заголовка дня */
.calendar-day-header {
    display: flex;
    align-items: center;
    padding: 2px 5px;
    cursor: default;
    min-height: 24px;
    position: relative;
    justify-content: center;
}

.calendar-day-header.clickable {
    cursor: pointer;
}

/* Стили для номера недели */
.calendar-week-number {
    background-color: #f5f5f5;
    text-align: center;
    font-weight: bold;
    border-right: 2px solid #ddd;
    width: 40px;
    vertical-align: middle !important;
    color: #999;
} 

.btn-toolbar {
    display: flex;
    /*width: 100%;*/
}

#select_date_form {
    width: 100%;
}

#nav-button {
    display: flex;
    margin-left: auto;
    /*overflow-x: auto;*/
}

#nav-button-current-period {
    width: 100%;
}

.modal-create-event {
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}

.modal-create-event button {
    margin: 0;
}

.modal-create-event button i {
    margin-right: 5px;
}

#createEventForm {
    background: #fff;
    position: relative;
    z-index: 1;
    text-align: center;
}

#createEventForm h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #495057;
}

#createEventForm .form-control-static {
    display: inline-block;
    margin-left: 5px;
    color: #495057;
    font-weight: normal;
}

#createEventForm label {
    display: block;
    margin-bottom: .5rem;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    text-align: left;
}

#createEventForm .form-group {
    text-align: left;
}

#createEventForm button {
    margin: 10px auto;
    display: block;
}