html, body {
    height: 100%;
}

 

#calendar {
    height: 100%;
    margin-top: 100px;
    max-width: 900px;
    margin: 40px auto;
}

/* МОДАЛКА */
#modal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-content {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    width: 300px;
}

 

.modal-content.view {
    max-width: 300px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
}

.modal-action {
    width: 100%;
    padding: 10px;
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;

    width: auto;        /* важно */
    padding: 0;         /* важно */
}

.modal-content {
    position: relative;
     animation: fadeIn 0.2s ease;
}

.modal-action {
    width: 100%;
    padding: 10px;
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Основная кнопка */
.btn-primary {
    width: 100%;
    padding: 10px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    margin: 0 auto;
    max-width: 300px;
}

.btn-primary:hover {
    background: #1765cc;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Удаление */
.btn-danger {
    width: 100%;
    margin: 6px auto 0;
    max-width: 300px;
    padding: 10px;
    background: #fce8e6;
    color: #d93025;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger:hover {
    background: #fad2cf;
}

@keyframes fadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 📱 АДАПТИВ */
@media (max-width: 600px) {

    #calendar {
        margin: 10px;
    }

    .modal-content {
        width: 90%;
        padding: 16px;
        border-radius: 10px;
        max-height: 90vh;
    overflow-y: auto;

    }

    .modal-content input,
    .modal-content select {
        font-size: 16px;
    }

    .modal-action {
        padding: 12px;
        font-size: 16px;
    }

    .modal-close {
        font-size: 24px;
    }
}

#authWrapper {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

#customPasswordForm {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 320px;
    text-align: center;
}

#customPasswordForm input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 6px;
}
.password-error {
    background: #fdecea;
    color: #d93025;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
    animation: shake 0.3s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Общий контейнер */
.fc {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
}

/* Убираем жирные рамки */
.fc-theme-standard td,
.fc-theme-standard th {
    border: 1px solid #f1f3f4;
}

/* Заголовок (месяц) */
.fc-toolbar-title {
    font-size: 20px;
    font-weight: 500;
    color: #202124;
}

/* Ячейки */
.fc-daygrid-day {
    transition: background 0.2s ease;
}

/* Hover */
.fc-daygrid-day:hover {
    background: #f8f9fa;
}

/* Сегодня */
.fc-day-today {
    background: #e8f0fe !important;
}

/* Номер дня */
.fc-daygrid-day-number {
    color: #5f6368;
    font-size: 14px;
    padding: 6px;
}

/* Основной стиль события */
.fc-event {
    height: 16px;
    display: flex;
    align-items: center;
    border: none;
    border-radius: 6px;
    padding: 0 4px;          /* было больше → уменьшаем */
    font-size: 11px;         /* компактнее */
    line-height: 1.2;        /* уменьшает высоту */
    min-height: 16px;        /* фиксируем минимальную высоту */
}

/* Внутренний контейнер */
.fc-event-main {
    padding: 0 !important;
}

/* Hover эффект */
.fc-event:hover {
    filter: brightness(0.95);
}

.fc-daygrid-event {
    margin-top: 2px;         /* меньше расстояние между событиями */
}

.fc-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-daygrid-day-frame {
    padding: 2px !important;
}

.fc-button {
    background: #fff !important;
    border: 1px solid #dadce0 !important;
    color: #3c4043 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
}

.fc-button:hover {
    background: #f1f3f4 !important;
}

.fc-button-active {
    background: #e8f0fe !important;
    border-color: #d2e3fc !important;
}

.fc-today-button {
    font-weight: 500;
}

.fc-daygrid-more-link {
    font-size: 11px;
    color: #1a73e8;
    cursor: pointer;
}

.fc .fc-popover {
    z-index: 1;
    }

@media (max-width: 600px) {

    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc-toolbar-title {
        font-size: 16px;
    }

      .fc-event {
        font-size: 10px;
        padding: 0 3px;
    }

    .fc-daygrid-event {
        margin-top: 1px;
    }
}

.fc-daygrid-day {
    transition: background 0.15s ease;
}

.fc-event {
    transition: transform 0.1s ease;
}

.fc-event:active {
    transform: scale(0.97);
}

@media (max-width: 600px) {

    #calendar {
        height: auto;
        min-height: 80vh;
    }

    .fc {
        height: auto !important;
    }

    .fc-view-harness {
        height: auto !important;
    }
}

.event-tooltip {
    position: fixed;
    background: #202124;
    color: #fff;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    z-index: 9999;
    white-space: nowrap;
    pointer-events: none;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f3f4;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #e0e0e0;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    width: 100%;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

#comment {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 14px;
    color: #202124;
    line-height: 1.4;
    min-height: 400px;
}

.event-list {
    margin-top: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.list-item {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 14px;
}

.list-item:hover {
    background: #f8f9fa;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    max-width: 900px;

    margin: 0 auto 12px;
    padding: 10px 14px;

    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-secondary {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #d2e3fc;
}

.btn-secondary:hover {
    background: #d2e3fc;
}

.btn-ghost {
    background: transparent;
    color: #5f6368;
}

.btn-ghost:hover {
    background: #f1f3f4;
}

.role-indicator {
    font-size: 13px;
    color: #5f6368;
    padding: 4px 8px;
    background: #f1f3f4;
    border-radius: 6px;
}

@media (max-width: 600px) {

    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: space-between;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}