/* static/css/calendar_schedule_line_modal.css */

.schedule-line-open-button {
    display: inline-block;
}

.schedule-line-open-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.schedule-line-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    font-family: 'M PLUS 1p', sans-serif;
}

.schedule-line-modal.is-open {
    display: block;
}

.schedule-line-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.schedule-line-modal__dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 680px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.schedule-line-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: move;
    user-select: none;
}

.schedule-line-modal__header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.schedule-line-modal__close {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #111827;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.schedule-line-modal__close:hover {
    background: #e5e7eb;
}

.schedule-line-modal__body {
    flex: 1;
    padding: 1.25rem;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: auto;
    scrollbar-color: #06c755 #e5f8ec;
}

.schedule-line-modal__body::-webkit-scrollbar {
    width: 0.75rem;
}

.schedule-line-modal__body::-webkit-scrollbar-track {
    background: #e5f8ec;
}

.schedule-line-modal__body::-webkit-scrollbar-thumb {
    background: #06c755;
    border-radius: 0.5rem;
}

.schedule-line-modal__body::-webkit-scrollbar-thumb:hover {
    background: #05a648;
}

.schedule-line-modal__notice {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.45rem;
    background: #f9fafb;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.6;
}

.schedule-line-modal__field {
    margin-bottom: 1rem;
}

.schedule-line-modal__field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: bold;
}

.schedule-line-modal__field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.schedule-line-modal__help {
    margin: 0.35rem 0 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

.schedule-line-modal__contacts-list {
    max-height: 7.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 0.45rem;
    padding: 0.4rem 0.6rem;
    background: #f9fafb;
    margin-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #06c755 #e5f8ec;
}

.schedule-line-modal__contacts-list::-webkit-scrollbar {
    width: 0.5rem;
}

.schedule-line-modal__contacts-list::-webkit-scrollbar-track {
    background: #e5f8ec;
}

.schedule-line-modal__contacts-list::-webkit-scrollbar-thumb {
    background: #06c755;
    border-radius: 0.5rem;
}

.schedule-line-modal__contacts-empty {
    margin: 0.3rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.schedule-line-modal__contact-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #eceef1;
}

.schedule-line-modal__contact-item:last-child {
    border-bottom: none;
}

.schedule-line-modal__contact-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.schedule-line-modal__contact-name {
    font-weight: bold;
}

.schedule-line-modal__contacts-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.schedule-line-modal__contacts-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.4rem;
    background: #ffffff;
    color: #111827;
    font-size: 0.85rem;
    cursor: pointer;
}

.schedule-line-modal__contacts-btn:hover {
    opacity: 0.85;
}

.schedule-line-modal__contacts-btn--primary {
    border-color: #06c755;
    background: #06c755;
    color: #ffffff;
}

.schedule-line-modal__recipients {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.schedule-line-modal__recipient-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.schedule-line-modal__recipient-row input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    font-size: 0.95rem;
    font-family: inherit;
}

.schedule-line-modal__remove-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #f9fafb;
    color: #b00020;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.schedule-line-modal__remove-btn:hover {
    background: #fdecec;
}

.schedule-line-modal__add-btn {
    padding: 0.5rem 0.9rem;
    border: 1px dashed #06c755;
    border-radius: 0.45rem;
    background: #e9fbf1;
    color: #05a648;
    font-weight: bold;
    cursor: pointer;
}

.schedule-line-modal__add-btn:hover {
    background: #d9f7e6;
}

.schedule-line-modal__add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.schedule-line-modal__result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 0.75rem;
}

.schedule-line-modal__card {
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    padding: 0.9rem;
    background: #fafafa;
    text-align: center;
}

.schedule-line-modal__card-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
    margin-bottom: 0.5rem;
}

.schedule-line-modal__badge {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #06c755;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-line-modal__card-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.schedule-line-modal__card-preview {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.4rem;
    background: #f1f2f4;
    color: #374151;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: left;
    white-space: pre-wrap;
}

.schedule-line-modal__qr {
    width: 13rem;
    height: 13rem;
    display: block;
    margin: 0 auto 0.6rem;
    border-radius: 0.4rem;
    image-rendering: pixelated;
}

.schedule-line-modal__line-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #05a648;
    text-decoration: none;
    font-weight: bold;
}

.schedule-line-modal__line-link:hover {
    text-decoration: underline;
}

.schedule-line-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: move;
    user-select: none;
}

.schedule-line-modal__footer-group {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.schedule-line-modal__button {
    min-width: 8rem;
    padding: 0.7rem 1rem;
    border-radius: 0.45rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}

.schedule-line-modal__button--secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
}

.schedule-line-modal__button--primary {
    border: 1px solid #06c755;
    background: #06c755;
    color: #ffffff;
}

.schedule-line-modal__button--secondary:hover,
.schedule-line-modal__button--primary:hover {
    opacity: 0.9;
}

.schedule-line-modal__resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    z-index: 10;
}

.schedule-line-modal__resize-handle--nw {
    top: 0; left: 0;
    cursor: nw-resize;
    border-top: 3px solid #aaaaaa;
    border-left: 3px solid #aaaaaa;
    border-radius: 0.4rem 0 0 0;
}

.schedule-line-modal__resize-handle--ne {
    top: 0; right: 0;
    cursor: ne-resize;
    border-top: 3px solid #aaaaaa;
    border-right: 3px solid #aaaaaa;
    border-radius: 0 0.4rem 0 0;
}

.schedule-line-modal__resize-handle--sw {
    bottom: 0; left: 0;
    cursor: sw-resize;
    border-bottom: 3px solid #aaaaaa;
    border-left: 3px solid #aaaaaa;
    border-radius: 0 0 0 0.4rem;
}

.schedule-line-modal__resize-handle--se {
    bottom: 0; right: 0;
    cursor: se-resize;
    border-bottom: 3px solid #aaaaaa;
    border-right: 3px solid #aaaaaa;
    border-radius: 0 0 0.4rem 0;
}

@media only screen and (max-width: 768px) {
    .schedule-line-modal__dialog {
        left: 8px;
        top: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        max-width: none;
        max-height: none;
        transform: none;
        border-radius: 10px;
    }

    .schedule-line-modal__header {
        cursor: default;
    }

    .schedule-line-modal__footer {
        cursor: default;
    }

    .schedule-line-modal__footer-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .schedule-line-modal__button {
        width: 100%;
        min-width: unset;
    }

    .schedule-line-modal__result-list {
        grid-template-columns: 1fr;
    }

    .schedule-line-modal__resize-handle {
        display: none;
    }
}
