/* ============================================================
   메모 체크리스트 스타일 (memo-checklist.css) v1.1
   - memo- 접두사로 기존 예약관리 CSS와 충돌 방지
   - 기존 header-btn, date-nav-btn 클래스 재활용
   ============================================================ */

/* ----------------------------------------------------------
   1. 월메모 버튼 배지
   ---------------------------------------------------------- */
.memo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    margin-left: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    border-radius: 9px;
    line-height: 1;
    vertical-align: middle;
}

/* ----------------------------------------------------------
   2. 일별 할일 버튼 (date-nav-btn 확장)
   ---------------------------------------------------------- */
.memo-daily-btn {
    margin-left: 8px !important;
    font-size: 13px !important;
}

.memo-daily-btn-active {
    color: #2563eb !important;
    border-color: #93c5fd !important;
    background: #eff6ff !important;
}

/* ----------------------------------------------------------
   3. 일별 체크리스트 컨테이너 (인라인)
   ---------------------------------------------------------- */
.memo-daily-container {
    padding: 10px 14px;
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   4. 체크리스트 공통
   ---------------------------------------------------------- */
.memo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.memo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    transition: background 0.1s;
}

.memo-item:hover {
    background: #f1f5f9;
}

.memo-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.memo-item-text {
    flex: 1;
    font-size: 13px;
    color: #1f2937;
    line-height: 1.4;
    word-break: break-word;
    cursor: text;
}

.memo-item-checked .memo-item-text {
    text-decoration: line-through;
    color: #9ca3af;
}

.memo-btn-delete {
    display: none;
    padding: 2px 8px;
    font-size: 11px;
    color: #9ca3af;
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.memo-item:hover .memo-btn-delete {
    display: inline-block;
}

.memo-btn-delete:hover {
    color: #ef4444;
    background: #fee2e2;
    border-color: #fecaca;
}

/* 인라인 편집 인풋 */
.memo-edit-input {
    flex: 1;
    min-width: 0;
    padding: 3px 8px;
    font-size: 13px;
    color: #1f2937;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ----------------------------------------------------------
   5. 입력 폼
   ---------------------------------------------------------- */
.memo-add-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.memo-add-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.15s;
}

.memo-add-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.memo-add-input::placeholder {
    color: #9ca3af;
}

.memo-add-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.memo-add-btn:hover {
    background: #1d4ed8;
}

/* ----------------------------------------------------------
   6. 빈 상태
   ---------------------------------------------------------- */
.memo-empty {
    text-align: center;
    padding: 14px 0 6px;
    font-size: 13px;
    color: #9ca3af;
}

/* ----------------------------------------------------------
   7. 어제 미완료 배너
   ---------------------------------------------------------- */
.memo-yesterday-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    margin-bottom: 8px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
}

.memo-banner-copy {
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #92400e;
    background: #fde68a;
    border: 1px solid #fbbf24;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.memo-banner-copy:hover {
    background: #fcd34d;
}

.memo-banner-close {
    background: none;
    border: none;
    color: #92400e;
    font-size: 15px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    opacity: 0.6;
    line-height: 1;
}

.memo-banner-close:hover {
    opacity: 1;
}

/* ----------------------------------------------------------
   8. 월별 모달
   ---------------------------------------------------------- */
.memo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.memo-modal-overlay.open {
    display: flex;
}

.memo-modal {
    background: #fff;
    border-radius: 12px;
    width: 460px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: memoSlideUp 0.2s ease;
}

@keyframes memoSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.memo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.memo-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.memo-modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6b7280;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.memo-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.memo-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    min-height: 60px;
}

.memo-modal-footer {
    padding: 10px 20px 14px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   9. 드래그 정렬 (월별)
   ---------------------------------------------------------- */
.memo-drag-handle {
    cursor: grab;
    color: #d1d5db;
    font-size: 16px;
    font-weight: 700;
    padding: 0 2px;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
    letter-spacing: 1px;
}

.memo-drag-handle:active {
    cursor: grabbing;
}

.memo-drag-handle:hover {
    color: #9ca3af;
}

.memo-dragging {
    opacity: 0.4;
    background: #e0e7ff !important;
}

.memo-drag-over {
    border-top: 2px solid #2563eb;
}

/* ----------------------------------------------------------
   10. 모바일 반응형
   ---------------------------------------------------------- */
@media (max-width: 768px) {

    /* 월메모 버튼 - 축소 */
    #btnMonthlyMemo {
        padding: 4px 8px !important;
        font-size: 11px !important;
        min-height: 28px !important;
        height: 28px !important;
        line-height: 1 !important;
    }

    .memo-badge {
        min-width: 15px;
        height: 15px;
        font-size: 10px;
        margin-left: 2px;
    }

    /* 할일 버튼 - 이전 버튼과 좌측 정렬 */
    .memo-daily-btn {
        margin-left: 0 !important;
        font-size: 12px !important;
        padding: 4px 10px !important;
        min-height: 28px !important;
        height: 28px !important;
    }

    /* 일별 컨테이너 */
    .memo-daily-container {
        padding: 8px 10px;
        margin-top: 6px;
    }

    /* 전체 펼치기 버튼 - 높이 축소 */
    .filter-toggle-btn {
        padding: 3px 10px !important;
        height: 28px !important;
        min-height: 28px !important;
        font-size: 11px !important;
    }

    /* 모달 하단 정렬 */
    .memo-modal {
        width: 100%;
        max-width: 100vw;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
        margin-top: auto;
    }

    /* 모바일 삭제 버튼 항상 표시 */
    .memo-btn-delete {
        display: inline-block;
        font-size: 10px;
        padding: 2px 6px;
    }
}
