/* 메모 컨테이너 레이아웃 */
.memo-container {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

/* 사이드바 스타일 */
.memo-sidebar {
    width: 250px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#currentGroupName {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 500;
    color: #495057;
    text-align: center;
}

.group-list {
    flex: 1;
    overflow-y: auto;
    border-radius: 6px;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.group-item.active {
    background: #4C6EF5;
    color: white;
}

.group-item-controls {
    display: flex;
    gap: 5px;
}

.group-item-controls button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.group-item-controls button:hover {
    opacity: 1;
}

/* 메인 영역 스타일 */
.memo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0; /* 오버플로우 방지 */
}

.memo-header {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.memo-search {
    flex: 1;
    min-width: 0; /* 검색창이 찌그러지지 않도록 */
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4C6EF5;
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.1);
}

/* 메모 리스트 스타일 */
.memo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 10px;
    overflow-y: auto;
}

.memo {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 280px;
}

.memo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.memo-title {
    width: 100%;
    border: none;
    font-size: 1.1em;
    font-weight: 500;
    padding: 5px;
    border-radius: 4px;
}

.memo-title:focus {
    outline: none;
    background: #f8f9fa;
}

.memo-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto; /* 내용이 많을 경우 스크롤 */
}

.memo-content textarea {
    width: 100%;
    height: 120px;
    border: none;
    resize: none;
    font-size: 0.95em;
    line-height: 1.5;
    background: white;
    padding: 10px;
    border-radius: 4px;
}

.memo-content textarea:focus {
    outline: none;
}

.memo-preview {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.5;
}

.memo-footer {
    padding: 12px 15px;
    border-top: 1px solid #f1f3f5;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

/* 푸터 버튼 스타일 수정 */
.memo-footer .btn {
    padding: 6px 12px;
    min-width: 60px;
    font-size: 0.85em;
}

.memo-footer .btn-primary {
    min-width: 50px;
}

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .memo-content textarea {
        background: #fff;
        color: #333;
    }
}

/* 버튼 스타일 개선 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.btn-primary {
    background: #4C6EF5;
    color: white;
    box-shadow: 0 2px 4px rgba(76,110,245,0.2);
}

.btn-primary:hover {
    background: #4263eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(76,110,245,0.25);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(76,110,245,0.2);
}

.btn-secondary {
    background: #f1f3f5;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 알림 메시지 스타일 */
.memo-notice {
    background: #fff3bf;
    border-left: 4px solid #ffd43b;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    color: #664d03;
    font-size: 0.95em;
    line-height: 1.5;
}

/* CSV 컨트롤 스타일 수정 */
.memo-csv-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.memo-csv-controls button,
.memo-csv-controls label {
    width: 100%;
    text-align: center;
    padding: 10px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;  /* 글자 크기 통일 */
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* CSV 내보내기 버튼 */
#exportMemos {
    background-color: #37B24D;  /* 초록색 계열 */
    color: white;
    border: none;
}

#exportMemos:hover {
    background-color: #2F9E44;
}

/* CSV 가져오기 버튼 */
#importLabel {
    background-color: #845EF7;  /* 보라색 계열 */
    color: white;
    border: none;
}

#importLabel:hover {
    background-color: #7048E8;
}

/* 파일 입력 숨기기 */
#importMemos {
    display: none;
}

/* 반응형 디자인 */
@media screen and (max-width: 1024px) {
    .memo-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .memo {
        height: 250px;
    }
}

@media screen and (max-width: 768px) {
    .memo-container {
        flex-direction: column;
        gap: 15px;
    }

    .memo-sidebar {
        width: 100%;
        padding: 15px;
    }

    #currentGroupName {
        font-size: 0.95em;
    }

    .group-item {
        padding: 8px;
        font-size: 0.9em;
    }

    .memo-header {
        flex-direction: column-reverse; /* 새 메모 버튼을 위로 */
        padding: 12px;
        gap: 8px;
    }

    .memo-search {
        width: 100%;
    }

    #addMemo {
        width: 100%;
        height: 40px;
    }

    .search-input {
        width: 100%;
        padding: 10px;
        font-size: 0.9em;
        height: 40px;
    }

    .memo-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
        padding: 8px;
    }

    .memo {
        height: 230px;
    }

    .memo-title {
        font-size: 1em;
        padding: 8px;
    }

    .memo-content textarea {
        font-size: 0.9em;
        padding: 8px;
    }

    .memo-footer .memo-btn {
        padding: 6px 10px;
        font-size: 0.85em;
    }
}

@media screen and (max-width: 480px) {
    .memo-container {
        gap: 12px;
    }

    .memo-sidebar {
        padding: 12px;
    }

    .memo-csv-controls {
        gap: 6px;
    }

    .memo-csv-controls button,
    .memo-csv-controls label {
        padding: 8px;
        height: 36px;
        font-size: 0.85em;
    }

    .memo-list {
        grid-template-columns: 1fr; /* 한 열로 변경 */
        gap: 10px;
        padding: 6px;
    }

    .memo {
        height: auto;
        min-height: 200px;
    }

    .memo-title {
        font-size: 0.95em;
        padding: 6px;
    }

    .memo-content {
        padding: 10px;
    }

    .memo-content textarea {
        font-size: 0.85em;
        padding: 6px;
        height: 100px;
    }

    .memo-footer {
        padding: 8px;
        gap: 6px;
    }

    .memo-footer .memo-btn {
        padding: 5px 8px;
        font-size: 0.8em;
        min-width: 50px;
    }

    .group-item {
        padding: 6px;
        font-size: 0.85em;
    }

    .memo-header {
        padding: 10px;
        gap: 6px;
    }

    #addMemo {
        height: 36px;
        font-size: 0.9em;
    }

    .search-input {
        height: 36px;
        font-size: 0.85em;
        padding: 8px;
    }
}

/* 메모 전용 버튼 스타일 */
.memo-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-btn-primary {
    background: #4C6EF5;
    color: white;
}

.memo-btn-danger {
    background: #FA5252;
    color: white;
}

#addMemo {
    min-width: 90px; /* 새 메모 버튼 최소 너비 */
} 