/* 웹앱 스타일 게시판 CSS */

/* 앱 전체 레이아웃 */
.app-body {
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding-bottom: 70px; /* 하단 네비게이션 바 공간 */
}

/* 앱 헤더 */
.app-header {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
    padding: 0;
}

.app-header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

/* 플로팅 액션 버튼 (FAB) */
.btn-fab {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-fab span {
    font-size: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.btn-fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* 앱 컨테이너 */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* 통계 카드 */
.app-stats {
    background: white;
    padding: 16px 20px;
    margin: 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.app-stats strong {
    color: #4CAF50;
    font-weight: 600;
}

/* 콘텐츠 영역 */
.app-content {
    padding: 12px;
}

/* 게시글 카드 리스트 */
.post-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 게시글 카드 */
.post-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    display: block;
    border: 1px solid #f0f0f0;
}

.post-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.post-number {
    font-size: 12px;
    color: #999;
    font-weight: 600;
}

.member-badge, .guest-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.member-badge {
    background: #E3F2FD;
    color: #1976D2;
}

.guest-badge {
    background: #FFF3E0;
    color: #F57C00;
}

.post-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f5f5f5;
}

.post-author {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.post-meta-info {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.post-time {
    color: #999;
}

.post-views {
    color: #999;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    color: #999;
    margin-bottom: 24px;
}

.btn-primary-large {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.btn-primary-large:active {
    transform: scale(0.98);
}

/* 페이지네이션 */
.app-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    gap: 12px;
}

.page-btn-nav {
    padding: 10px 16px;
    background: white;
    color: #4CAF50;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.page-btn-nav:active {
    background: #f5f5f5;
}

.page-numbers {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.page-number.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.page-number:active {
    background: #f5f5f5;
}

.page-number.active:active {
    background: #45a049;
}

/* 하단 네비게이션 바 (모바일 앱 스타일) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    padding: 8px;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    color: #4CAF50;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

.nav-item.write-nav {
    color: #4CAF50;
}

/* 글쓰기/수정/보기 페이지 스타일 */
.write-container, .view-container {
    background: #f5f7fa;
    min-height: calc(100vh - 70px);
    padding: 0;
    padding-bottom: 70px;
}

.write-header, .view-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.write-header h1, .view-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 1;
    text-align: center;
}

.write-header .btn-back, .view-header .btn-back {
    flex: 0 0 auto;
    min-width: 60px;
    text-align: left;
}

.write-header span, .view-header span {
    flex: 0 0 auto;
    min-width: 60px;
}

.btn-back {
    padding: 8px 16px;
    background: transparent;
    color: #4CAF50;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.btn-back:active {
    background: #f5f5f5;
}

.write-form {
    background: white;
    margin: 12px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.write-form .form-group {
    margin-bottom: 20px;
}

.write-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.write-form input[type="text"],
.write-form input[type="password"],
.write-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fafafa;
    transition: all 0.2s ease;
}

.write-form input:focus,
.write-form textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.write-form textarea {
    resize: vertical;
    min-height: 300px;
    line-height: 1.6;
}

.guest-info {
    background: #FFF9E6;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #FFC107;
    margin: 20px 0;
}

.guest-info h3 {
    margin: 0 0 12px 0;
    color: #F57C00;
    font-size: 15px;
}

.guest-info small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

.member-info {
    background: #E8F5E9;
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    margin: 20px 0;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.btn-submit {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-cancel:active {
    background: #f5f5f5;
}

/* 게시글 보기 */
.post-view {
    background: white;
    margin: 12px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.post-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.post-header h1 {
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 700;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #666;
    font-size: 13px;
}

.post-meta .author {
    font-weight: 600;
}

.post-content {
    padding: 20px 0;
    line-height: 1.8;
    color: #333;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.post-actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #2196F3;
    color: white;
}

.btn-edit:active {
    background: #1976D2;
    transform: scale(0.98);
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:active {
    background: #d32f2f;
    transform: scale(0.98);
}

.btn-list {
    padding: 10px 18px;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.btn-list:active {
    background: #f5f5f5;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin: 0 0 16px 0;
    color: #1a1a1a;
    font-size: 18px;
}

.modal-content input {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    margin: 12px 0;
    box-sizing: border-box;
    background: #fafafa;
}

.modal-content input:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.error-message, .success-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.error-message {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.success-message {
    background: #D1FAE5;
    color: #059669;
    border: 1px solid #6EE7B7;
}

/* 반응형 (태블릿 이상) */
@media (min-width: 769px) {
    .bottom-nav {
        display: none; /* 데스크톱에서는 하단 네비게이션 숨김 */
    }
    
    .app-body {
        padding-bottom: 0;
    }
    
    .write-container, .view-container {
        padding-bottom: 0;
    }
    
    .app-header {
        position: static;
    }
    
    .write-header, .view-header {
        position: static;
    }
}

/* 데스크톱 추가 스타일 */
@media (min-width: 769px) {
    .post-card {
        cursor: pointer;
    }
    
    .post-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }
    
    .btn-fab:hover {
        box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
        transform: translateY(-2px);
    }
}
