/* =======================================================
   🥭 에이블망고 통합 스타일시트
   style.css ← (구) style.css + navibar.css + board.css + calc.css 통합
   ======================================================= */

/* -------------------------------------------------------
   🎨 0. CSS 변수 (디자인 토큰)
   ------------------------------------------------------- */
:root {
    --color-primary:     #ffb703;  /* 망고 주황 */
    --color-primary-h:   #fb8500;  /* 망고 주황 hover */
    --color-primary-glow: rgba(251, 191, 36, 0.12);

    --color-border:      #e2e8f0;  /* 기본 테두리 */
    --color-border-md:   #cbd5e1;  /* 중간 테두리 */

    --color-bg:          #f8f9fa;  /* 페이지 배경 */
    --color-bg-soft:     #f1f5f9;  /* 연한 배경 */
    --color-surface:     #ffffff;  /* 카드/박스 배경 */

    --color-text-main:   #1e293b;  /* 본문 진한 글씨 */
    --color-text-body:   #334155;  /* 본문 기본 */
    --color-text-sub:    #475569;  /* 보조 글씨 */
    --color-text-muted:  #94a3b8;  /* 흐린 글씨 */
    --color-text-mid:    #64748b;  /* 중간 글씨 */

    --radius-sm:  6px;
    --radius-md:  8px;
    --radius-lg:  12px;

    --shadow-card:   0 2px 5px rgba(0,0,0,0.04);
    --shadow-popup:  0 8px 24px rgba(0,0,0,0.10);
    --shadow-glow:   0 2px 8px var(--color-primary-glow);

    --font-base: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", helvetica, sans-serif;
}

/* -------------------------------------------------------
   📦 1. 기본 초기화 & 전역
   ------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-base); background-color: var(--color-bg); color: #212529; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

.inner-box { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* -------------------------------------------------------
   🔝 2. 헤더 & 상단 바
   ------------------------------------------------------- */
.header-bar { background-color: var(--color-surface); border-bottom: 1px solid #dee2e6; padding: 12px 0; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: bold; color: #6c757d; font-size: 1.1rem; }

.header-buttons { display: flex; gap: 8px; align-items: center; position: relative; }
.icon-btn-round {
    background: none;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    color: #6c757d;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.icon-btn-round:hover { background-color: var(--color-bg-soft); color: #212529; }

/* 팝업 메뉴 */
.menu-popup {
    display: none;
    position: absolute;
    top: 42px; right: 0;
    background-color: var(--color-surface);
    border: 1px solid #dee2e6;
    border-radius: var(--radius-md);
    width: 160px;
    box-shadow: var(--shadow-popup);
    z-index: 1000;
    padding: 6px 0;
}
.menu-popup.active { display: block; }
.menu-popup a { display: block; padding: 10px 16px; color: #495057; font-size: 0.88rem; transition: background-color 0.15s ease; }
.menu-popup a:hover { background-color: var(--color-bg); color: var(--color-primary); }

/* -------------------------------------------------------
   🧭 3. 내비게이션 바
   ------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');

.minimal-nav-wrap { width: 100%; padding: 10px 0; text-align: center; }
.minimal-nav-inside { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.minimal-logo a {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: var(--color-primary);
    text-decoration: none;
}
.minimal-tabs { display: flex; justify-content: center; gap: 20px; width: 100%; }
.nav-tab-item {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-mid);
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}
.nav-tab-item.active-tab { color: #212529; background: var(--color-primary); }

/* -------------------------------------------------------
   🟡 4. 메인 배너 & 주소창 & 레이아웃
   ------------------------------------------------------- */
.yellow-banner { background: linear-gradient(135deg, #ffb703, #fcbf49); border-bottom: 2px solid #e0a100; padding: 30px 0; }
.yellow-banner h1 { font-size: 1.8rem; margin-bottom: 8px; font-weight: bold; }
.yellow-banner p { opacity: 0.8; font-size: 1rem; }

.address-bar {
    background-color: var(--color-surface);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 0;
    margin-top: 15px;
    font-size: 8px;
    letter-spacing: 0.02em;
}
.address-bar .inner-box { color: #adb5bd; }
.address-bar a { color: #6c757d; font-weight: bold; }
.address-bar a:hover { color: #212529; }
.address-bar span { color: #212529; font-weight: bold; }

/* 메인 그리드 */
.board-container { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; margin-bottom: 40px; }
.board-box {
    background-color: var(--color-surface);
    border: 1px solid #dee2e6;
    border-radius: var(--radius-md);
    padding: 20px;
    flex: 1 1 calc(50% - 10px);
    min-width: 300px;
}
.board-box h3 { font-size: 1rem; color: #6c757d; border-left: 3px solid #6c757d; padding-left: 8px; margin-bottom: 15px; }
.board-box ul { list-style: none; }
.board-box li { margin-bottom: 10px; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-box li a:hover { color: var(--color-primary); }


/* -------------------------------------------------------
   📢 광고 영역
   ------------------------------------------------------- */
.ad-box {
    width: 100%;
    min-height: 90px;
    background: var(--color-bg-soft);
    border: 1px dashed var(--color-border-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* -------------------------------------------------------
   🔍 5. 게시판 상단 툴바 (검색 + 글쓰기 버튼)
   ------------------------------------------------------- */
.board-top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 15px;
    padding: 0 4px;
}

.search-form-wrap {
    display: flex;
    flex: 1;
    max-width: 500px;
    height: 38px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.search-form-wrap input { flex: 1; border: none; padding: 0 12px; font-size: 0.9rem; outline: none; }
.search-submit-btn {
    border: none;
    background: var(--color-bg-soft);
    color: var(--color-text-sub);
    padding: 0 16px;
    font-size: 0.85rem; font-weight: bold;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 1px solid var(--color-border-md);
}
.search-submit-btn:hover { background: var(--color-border); }

.write-btn-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background: var(--color-primary);
    color: #212529;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: bold;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
    border: none;
}
.write-btn-top:hover { background: var(--color-primary-h); color: #212529; }
.write-btn-top:active { transform: scale(0.96); }

/* -------------------------------------------------------
   📋 6. 게시판 목록
   ------------------------------------------------------- */
.list-container {
    background-color: var(--color-surface);
    border: 1px solid #dee2e6;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.list-header {
    font-size: 1.1rem;
    color: #495057;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
}
.board-card-list { display: flex; flex-direction: column; gap: 12px; }

.board-card-item {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.board-card-item:hover {
    border-color: #fbbf24;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.card-id { font-family: monospace; font-weight: bold; color: var(--color-text-mid); }
.card-nick { font-weight: 600; color: var(--color-text-sub); }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--color-text-main); line-height: 1.4; word-break: break-all; }

.empty-board-msg {
    text-align: center;
    color: var(--color-text-muted);
    padding: 60px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.9rem;
}

/* -------------------------------------------------------
   🔢 7. 페이지네이션
   ------------------------------------------------------- */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    padding-bottom: 10px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-sub);
    font-size: 0.85rem; font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.page-link:hover { border-color: var(--color-border-md); background: #f8fafc; color: var(--color-text-main); }
.page-link.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #212529;
    font-weight: bold;
    box-shadow: var(--shadow-glow);
}
.page-link.prev, .page-link.next { background: var(--color-bg-soft); font-size: 0.75rem; }
.page-link.prev:hover, .page-link.next:hover { background: var(--color-border); }

/* 뷰어 페이지 main 여백 */
.main-view { margin-top: 20px; margin-bottom: 60px; }

/* -------------------------------------------------------
   📖 8. 본문 뷰어
   ------------------------------------------------------- */
.view-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}
.view-title {
    font-size: 1.35rem; font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin: 0 0 12px 0;
    word-break: break-all;
}
.view-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-border);
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.view-id { font-family: monospace; font-weight: bold; color: var(--color-text-mid); }
.view-nick { color: var(--color-text-body); font-weight: 600; }
.view-content {
    font-size: 1rem;
    color: var(--color-text-body);
    line-height: 1.6;
    min-height: 120px;
    word-break: break-all;
    white-space: pre-wrap;
    text-indent: 0;
    margin-top: 0;
    padding-top: 0;
}
.view-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--color-bg-soft);
}
.right-actions { display: flex; gap: 8px; }

/* -------------------------------------------------------
   🔘 9. 공통 액션 버튼
      (뷰어 btn-action + 글쓰기 btn-action-patch 통합)
   ------------------------------------------------------- */
.btn-action {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-base);
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease-in-out;
    border: none;
}

/* 색상 변형 */
.btn-action.list   { background: var(--color-bg-soft); color: var(--color-text-sub); border: 1px solid var(--color-border-md); }
.btn-action.list:hover  { background: var(--color-border); color: var(--color-text-main); }

.btn-action.edit   { background: #e0f2fe; color: #0369a1; }
.btn-action.edit:hover  { background: #bae6fd; }

.btn-action.delete { background: #fee2e2; color: #b91c1c; }
.btn-action.delete:hover { background: #fecaca; }

.btn-action.cancel { background: var(--color-bg-soft); color: var(--color-text-sub); border: 1px solid var(--color-border-md); min-width: 80px; }
.btn-action.cancel:hover { background: var(--color-border); color: var(--color-text-main); }

.btn-action.submit { background: var(--color-primary); color: #212529; border: 1px solid var(--color-primary); min-width: 110px; }
.btn-action.submit:hover { background: var(--color-primary-h); border-color: var(--color-primary-h); }

/* -------------------------------------------------------
   🔒 10. 비밀번호 확인 폼 (수정/삭제 공용)
   ------------------------------------------------------- */
.verify-container {
    text-align: center;
    padding: 30px 20px;
    max-width: 450px;
    margin: 0 auto;
}
.verify-heading {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}
.verify-heading.blue { color: #0369a1; }
.verify-heading.red  { color: #b91c1c; }
.verify-desc {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 20px;
}
.verify-input-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.verify-input {
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 4px;
    width: 80%;
    max-width: 250px;
}
.verify-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}
.verify-actions .btn-action { flex: 0 1 120px; }

/* -------------------------------------------------------
   📝 11. 글쓰기 폼
   ------------------------------------------------------- */
.write-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}
.write-heading { font-size: 1.2rem; font-weight: 800; color: var(--color-text-main); margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.85rem; font-weight: 700; color: var(--color-text-sub); }

.form-row-flex { display: flex; gap: 12px; width: 100%; }
.flex-1 { flex: 1; }

.input-field {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-base);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.input-field:focus { border-color: var(--color-primary); }
.input-field--readonly {
    background: var(--color-bg-soft);
    color: var(--color-text-mid);
    cursor: not-allowed;
}


.textarea-field {
    min-height: 180px;
    padding: 12px;
    border: 1px solid var(--color-border-md);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-base);
    line-height: 1.6;
    outline: none;
    resize: none;
    box-sizing: border-box;
}
.textarea-field:focus { border-color: var(--color-primary); }

.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* -------------------------------------------------------
   🧮 11. 미니 계산기 팝업
   ------------------------------------------------------- */
.calc-popup {
    display: none;
    position: absolute;
    top: 50px; right: 0;
    width: 220px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popup);
    padding: 12px;
    z-index: 1000;
}
.calc-popup.show { display: block; }

.calc-screen input {
    width: 100%;
    height: 40px;
    background: #f8fafc;
    border: 1px solid var(--color-border-md);
    border-radius: var(--radius-sm);
    text-align: right;
    padding: 0 10px;
    font-size: 18px; font-weight: bold;
    color: var(--color-text-main);
    box-sizing: border-box;
    margin-bottom: 8px;
    font-family: var(--font-base);
}
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-btn {
    height: 38px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-soft);
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    font-family: var(--font-base);
    cursor: pointer;
    transition: background 0.15s;
}
.calc-btn:hover  { background: var(--color-border); }
.calc-btn.op     { background: #fef08a; color: #854d0e; }
.calc-btn.op:hover { background: #fde047; }
.calc-btn.clear  { background: #fca5a5; color: #991b1b; }
.calc-btn.clear:hover { background: #f87171; }
.calc-btn.equal  { grid-row: span 2; height: 82px; background: #fbbf24; color: #ffffff; font-size: 18px; }
.calc-btn.equal:hover { background: #f59e0b; }
.calc-btn.zero   { grid-column: span 2; }

/* -------------------------------------------------------
   🦶 12. 푸터
   ------------------------------------------------------- */
.footer-bar { text-align: center; padding: 20px 0; background-color: var(--color-surface); border-top: 1px solid #dee2e6; color: #6c757d; font-size: 0.85rem; }

/* -------------------------------------------------------
   📱 13. 반응형 (모바일 ≤ 480px)
   ------------------------------------------------------- */
@media screen and (max-width: 480px) {
    .form-row-flex { flex-direction: column; gap: 12px; }
    .input-field, .textarea-field { width: 100%; max-width: 100%; }
    .form-actions { width: 100%; }
    .form-actions .btn-action { flex: 1; }

    /* 뷰어 하단 목록/수정/삭제 버튼 모바일 대응
       목록: 위 전체 너비 / 수정·삭제: 아래 나란히 */
    .view-actions {
        flex-direction: column;
        gap: 10px;
    }
    .view-actions > .btn-action.list {
        width: 100%;
        height: 52px;
        order: 1;
    }
    .right-actions {
        width: 100%;
        order: 2;
        display: flex;
        gap: 8px;
    }
    .right-actions .btn-action { flex: 1; }

    /* 모바일 버튼 높이 키우기 */
    .view-actions .btn-action {
        flex: 1;
        height: 52px;
        font-size: 0.95rem;
    }
}