/* 1. 기본 배경 및 폰트 */
body {
    margin: 0;
    padding: 0;
    background-color: #fdf6e3;
    font-family: 'Malgun Gothic', sans-serif;
}

/* 2. 헤더 고정 (제목 겹침 방지) */
header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background-color: white !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 20px !important;
    z-index: 2000 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    box-sizing: border-box !important;
}

header h1 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

/* 3. 보드 영역 (여백 제거 핵심 설정) */
#board {
    padding: 80px 15px 100px 15px !important; /* 헤더 여백 */
    
    /* [핵심] flex를 끄고 다단 레이아웃 적용 */
    display: block !important; 
    column-count: 5 !important; /* PC 기준 5줄 배치 */
    column-gap: 15px !important;   /* 카드 사이 좌우 간격 */
    
    width: 100% !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* 화면 크기에 따라 줄 수 조절 (반응형) */
@media (max-width: 1400px) { #board { column-count: 4 !important; } }
@media (max-width: 1100px) { #board { column-count: 3 !important; } }
@media (max-width: 800px) { #board { column-count: 2 !important; } }
@media (max-width: 500px) { #board { column-count: 1 !important; } }

/* 4. 포스트잇(post-it) 스타일 (따닥따닥 붙이기) */
.post-it {
    /* [핵심] inline-block과 break-inside 설정이 있어야 카드가 안 겹치고 위로 붙음 */
    display: inline-block !important; 
    break-inside: avoid !important; 
    
    width: 100% !important; 
    margin-bottom: 15px !important; /* 아래 카드와의 간격 */
    
    position: relative !important;
    background: #fff;
    padding: 20px !important;
    border-radius: 8px !important;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.1) !important;
    box-sizing: border-box !important;
    
    /* 글자 줄바꿈 설정 */
    word-break: break-all !important;
    white-space: pre-wrap !important;
    line-height: 1.6 !important;
}

/* 포스트잇 내부 요소 */
.post-it img {
    width: 100% !important;
    height: auto !important;
    border-radius: 5px;
    margin-bottom: 10px;
}

.post-it h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.post-it p {
    margin: 0;
    font-size: 15px;
    color: #444;
}

/* 5. 삭제 버튼(x) */
.del-btn {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    color: #ddd !important;
}
.del-btn:hover { color: #ff5252 !important; }

/* 6. 추가 버튼 및 모달 */
#add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ff5252;
    color: white;
    font-size: 30px;
    border: none;
    cursor: pointer;
    z-index: 2500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.modal-overlay, .black-confirm-overlay { 
    z-index: 3000;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-window, .black-confirm-window {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
}
