/* 기본 디자인 */
body { font-family: sans-serif; margin: 0; padding: 0; background: #f4f4f4; }
button { cursor: pointer; border: none; border-radius: 4px; }

/* 상단 바 */
.nav-bar { background: #333; color: white; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; }
.nav-bar .logo { font-size: 1.2rem; font-weight: bold; }
.nav-bar button {
    color: white;
    padding: 0 15px;
    border-radius: 4px;
    font-size: 0.85rem;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.nav-bar .btn-main { background: #007bff; }
.nav-bar .btn-cancel { background: #6c757d; }

.nav-links a {
    color: #eee;
    text-decoration: none;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    padding: 0 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    line-height: 1;
    box-sizing: border-box;
}
.nav-links button {
    color: #eee;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    padding: 0 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    line-height: 1;
    box-sizing: border-box;
}
.nav-links button.active {
    background: #e03131;
    color: #fff;
}
.board-mode-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
}

/* 메인 컨테이너 */
.container { max-width: 900px; margin: 20px auto; background: white; padding: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.board-ctrl { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; }
.board-ctrl input[type="text"] { height: 38px; padding: 0 12px; border: 1px solid #ddd; border-radius: 4px; margin-right: 5px; box-sizing: border-box; vertical-align: middle; font-size: 0.8rem; }
.board-ctrl button { height: 38px; padding: 0 15px; box-sizing: border-box; vertical-align: middle; font-size: 0.8rem; }

/* 게시판 테이블 */
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { border-bottom: 1px solid #ddd; padding: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { color: #000; font-weight: bold; }
.col-title { width: 60%; }
.col-del { width: 6%; text-align: center; overflow: visible; text-overflow: clip; }
.col-nick { width: 12%; color: #666; font-size: 0.9rem; text-align: center; }
.col-time { width: 13%; color: #999; font-size: 0.8rem; text-align: center; }
.col-view { width: 9%; color: #999; font-size: 0.8rem; text-align: center; }
.title-link { text-decoration: none; color: #333; font-weight: 500; }
.title-link:hover { color: #007bff; }
.title-link:visited { color: #888; }

/* 파비콘 아이콘 스타일 */
.favicon { width: 16px; height: 16px; margin-right: 8px; vertical-align: middle; border-radius: 2px; margin-bottom: 2px; }
/* 커스텀 툴팁 스타일 */
.title-link { position: relative; }
.title-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
    transform: translateY(20px);
}

/* 팝업(모달) 공통 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: white; padding: 25px; border-radius: 8px; width: 350px; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.modal-content h3 { margin-top: 0; margin-bottom: 20px; text-align: center; color: #333; }
.modal-content label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.9rem; color: #555; }
.modal-content input { width: calc(100% - 20px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.modal-content select, .modal-content textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: content-box;
}
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    color: #999;
    font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}
.btn-google {
    width: 100%;
    background: #fff;
    color: #333;
    border: 1px solid #dadce0;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}
.btn-google svg { width: 18px; height: 18px; }

.btn-main { background: #007bff; color: white; padding: 8px 15px; }
.btn-cancel { background: #eee; color: #333; padding: 8px 15px; }
.btn-del {
    background: #ff4d4d;
    color: white;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-del svg { width: 12px; height: 12px; stroke-width: 3; }

/* 설정창 전용 회원탈퇴 버튼 */
.btn-settings-del {
    background: #ff4d4d;
    color: white;
    width: 200px;
    padding: 12px;
    margin: 0;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-refresh {
    width: 45px;
    height: 38px;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    border-radius: 4px;
}
.btn-refresh svg { width: 18px; height: 18px; stroke-width: 2.5; }

/* OS별 미세 조정 */
.os-mac .nav-links a { padding-top: 3px; }
.os-mac .nav-bar button { padding-top: 2px; }
.os-mac .favicon { margin-bottom: 3px; }
.os-mac .btn-del svg { transform: translateY(1px); }
.os-mac td.col-title, .os-mac td.col-nick, .os-mac td.col-time { padding-top: 13px; padding-bottom: 11px; }

.os-win .nav-bar button { padding-top: 1px; padding-bottom: 0; }
.os-win .nav-links a { padding-bottom: 2px; }
.os-win .board-ctrl input[type="text"] { padding-bottom: 2px; }
.os-win .board-ctrl button { padding-bottom: 2px; }
.os-win td { padding-top: 11px; padding-bottom: 13px; }
.os-win .favicon { margin-bottom: 3px; }
.os-win #settingsModal button { padding-top: 11px; padding-bottom: 13px; }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; margin-top: 20px; }
.pagination button { background: #007bff; color: white; padding: 8px 12px; margin: 0 5px; border-radius: 4px; }
.pagination button:disabled { background: #cccccc; cursor: not-allowed; }

/* 모바일 최적화 */
@media (max-width: 600px) {
    .container { padding: 10px; margin: 0; border-radius: 0; box-shadow: none; }
    .nav-bar { padding: 10px; }
    .nav-bar .logo { font-size: 1rem; }
    .nav-links { gap: 5px; }
    .nav-links a, .nav-links button { font-size: 0.8rem; padding: 0 8px; height: 30px; }
    .auth-btns button { font-size: 0.8rem; padding: 0 10px; height: 30px; }

    .board-ctrl { flex-direction: column; gap: 10px; align-items: stretch; }
    .board-ctrl div { display: flex; gap: 5px; width: 100%; }
    .board-ctrl input[type="text"] { flex: 1; font-size: 0.9rem; }
    .board-ctrl button { flex: 1; font-size: 0.9rem; }
    .btn-refresh { width: 50px; flex: none !important; }

    .col-nick, .col-time { display: none; }
    .col-view { display: table-cell !important; width: 15% !important; font-size: 0.8rem !important; }
    .col-title { width: 75% !important; }
    .col-del { width: 10% !important; }

    th, td { padding: 10px 5px; }
    .title-link { font-size: 0.95rem; }

    .modal-content { width: 90%; padding: 20px; }
    .modal-content input, .modal-content textarea { font-size: 1rem; }
}
