/**
 * ========================================
 * TODO List Styles (Horizontal Scroll)
 * ========================================
 */

/* ================================
   페이지 스크롤 제어
================================ */
html,
body {
    overflow: hidden; /* 페이지 스크롤 제거 */
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ================================
   컨테이너
================================ */
.container {
    max-width: 100%;
    /* margin: 40px auto; */
    /* padding: 20px; */
    position: relative;
}

/* ================================
   헤더
================================ */
.todo-header {
    display: flex;
    flex-direction: row ;
    /* justify-content: flex-end; */
    align-items: center;
    gap: 25px;
    /* margin-bottom: 30px; */
    /* padding: 0 20px; */
}

.todo-header-item {
    /* margin-right: auto; */
}

.todo-header-item h1 {
    display: inline-block;
}

.todo-title {
    /* font-size: 32px; */
    /* font-weight: 600; */
    /* color: #333; */
    margin: 0;
}

.todo-count {
    /* font-size: 24px; */
    /* color: #999; */
}

/* ================================
   TODO 리스트 (가로 스크롤)
================================ */
.todo-list {
    display: flex;
    flex-direction: row;
    gap: 15px;
    /* margin-bottom: 30px; */
    padding-top: 6px;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-behavior: smooth;
    /* 스크롤바 스타일링 */
    scrollbar-width: thin;
    scrollbar-color: #ffd700 #f0f0f0;
}

/* 웹킷 브라우저 스크롤바 */
.todo-list::-webkit-scrollbar {
    height: 8px;
}

.todo-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background: #ffa500;
}

/* ================================
   TODO 아이템
================================ */
/* .todo-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-radius: 25px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-width: 280px;
    max-width: 280px;
    min-height: 180px;
    transition: all 0.4s ease;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
} */

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    position: relative;
    z-index: 0; /* ai-options-list보다 확실히 아래로 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 200px;
    /* min-height: 180px; */
    height: 85px;
    gap: 10px;
    box-sizing: border-box;
    transition: all 0.4s ease;
    position: relative;
    flex-shrink: 0; /* 크기 고정 */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
}

.todo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 언체크 상태 배경 (주황색) */
.todo-item[data-completed="false"] {
    background-image: url("../img/to_do_list/todo_background_uncked.png");
}

/* 체크 상태 배경 (갈색) */
.todo-item[data-completed="true"] {
    background-image: url("../img/to_do_list/todo_background_cked.png");
    opacity: 0.8;
}

.todo-item[data-completed="true"] .todo-content {
    opacity: 0.7;
}

/* TODO 내용 */
.todo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.todo-task-title {
    font-size: 18px;
    /* font-weight: 600; */
    color: #ffffff !important; /* 흰색 강제 */
    margin: 0;
    /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); */
    word-break: break-word;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 최대 2줄 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 체크 버튼 */
.todo-check-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
    margin-top: 10px;
    align-self: flex-end;
}

.todo-check-btn:hover {
    transform: scale(1.15);
}

.todo-check-btn:active {
    transform: scale(0.95);
}

.todo-check-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ================================
   추가 버튼 영역 (오른쪽 위 고정)
================================ */
/* .add-section {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 100;
} */


/* 입력창 컨테이너 */
.add-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    /* height: 60px; */
    height: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 원형 상태 (기본) */
.add-input-container.circle {
    width: 60px;
    border-radius: 50%;
    background: transparent;
    padding: 0;
}

/* 확장 상태 (입력 모드) */
.add-input-container.expanded {
    /* width: 550px; */
    border-radius: 30px;
    background-color: #ffffff; /* 흰색 배경 */
    padding: 0px 10px;
    /* padding: 10px 20px; */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid #e0e0e0;
}

/* AI 추천 버튼 */
.ai-recommend-btn {
    /* width: 50px;
    height: 50px; */
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0;
    flex-shrink: 0;
}

.ai-recommend-btn.show {
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

.ai-recommend-btn:hover {
    transform: scale(1.1);
}

.ai-recommend-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 입력창 */
.add-input {
    flex: 1;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: #333;
    outline: none;
    padding: 0 10px;
}

.add-input::placeholder {
    color: #999;
}

/* + 버튼 (원형) / X 버튼 (확장) */
.add-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

/* 확장 상태일 때 + 버튼을 45도 회전 (X 모양) */
.add-input-container.expanded .add-btn {
    transform: rotate(45deg);
}

.add-btn:hover {
    transform: scale(1.1);
}

.add-input-container.expanded .add-btn:hover {
    transform: rotate(45deg) scale(1.1);
}

.add-btn:active {
    transform: scale(0.95);
}

.add-input-container.expanded .add-btn:active {
    transform: rotate(45deg) scale(0.95);
}

.add-btn img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* ================================
   AI 추천 옵션 영역
================================ */
.ai-options-container {
    margin-top: 15px;                                                                                           
    width: 600px;
    max-height: 0;
    overflow: visible;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    position: fixed; /* 화면에 고정 */
    top: 53%; /* 더 아래로 이동 */
    left: 45%; /* 왼쪽으로 이동 */
    transform: translate(-50%, -50%); /* 중앙 정렬 */
    z-index: 9999; /* 최고 우선순위 */
    pointer-events: none; /* 컨테이너는 클릭 불가 */
}

.ai-options-container.show {
    max-height: 400px;
    opacity: 1;
}

.ai-options-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border-radius: 15px; /* 25px에서 15px로 줄임 */
    padding: 10px 15px; /* 20px 25px에서 10px 15px로 줄임 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInContainer 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(-10px);
    font-size: 0.8em; /* 전체 폰트 크기 줄임 */
    position: relative;
    z-index: 10000; /* 최고 우선순위 */
    pointer-events: auto; /* 클릭 가능 */
}

.ai-option-item {
    padding: 12px 0; /* 18px에서 12px로 줄임 */
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    color: #333333;
    font-size: 0.9em; /* 폰트 크기 줄임 */
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: opacity 0.3s ease, color 0.3s ease;
    opacity: 1;
    position: relative;
    z-index: 3; /* todo-item보다 위로 올라가도록 */
}

.ai-option-item:last-child {
    border-bottom: none;
}

.ai-option-item:hover {
    color: #ffa500;
}

.ai-option-item.selected {
    opacity: 0.4;
    color: #999999;
    cursor: default;
}

.ai-option-item.selected:hover {
    color: #999999;
}

@keyframes slideInContainer {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   애니메이션
================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-10px);
    }
}

/* 삭제/이동 애니메이션 */
.todo-item.moving {
    animation: moveToEnd 0.5s ease forwards;
}

@keyframes moveToEnd {
    to {
        transform: translateX(200px);
        opacity: 0.5;
    }
}

/* 추가 애니메이션 (맨 앞에서 등장) */
.todo-item.adding {
    animation: slideInFromLeft 0.4s ease forwards;
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* ================================
   반응형 (모바일)
================================ */
@media (max-width: 768px) {
    .add-section {
        top: 20px;
        right: 20px;
    }

    .todo-item {
        min-width: 240px;
        max-width: 240px;
        min-height: 160px;
        padding: 20px 25px;
    }

    .todo-task-title {
        font-size: 22px;
    }

    .add-input-container.expanded {
        width: 400px;
    }

    .ai-options-container {
        width: 400px;
    }

    .ai-option-item {
        font-size: 16px;
        padding: 15px 0;
    }

}

.effect_f{height: 85px; position: fixed; top: 46px; left: 882px; z-index: 10;}