/* 🎨 Modern Board Design - 노트북/다이어리 스타일 */

/* CSS 변수 정의 */
:root {
    /* 브랜드 컬러 */
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    
    /* 노트북 스타일 컬러 */
    --notebook-bg: #f8f9fa;
    --notebook-border: #e9ecef;
    --notebook-shadow: rgba(0, 0, 0, 0.1);
    --paper-bg: #ffffff;
    --paper-shadow: rgba(0, 0, 0, 0.08);
    
    /* 사이드바 컬러 */
    --sidebar-bg: #2d3748;
    --sidebar-hover: #4a5568;
    --sidebar-active: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-text: #e2e8f0;
    --sidebar-active-text: #ffffff;
    
    /* 텍스트 컬러 */
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    
    /* 크기 변수 - 헤더에서 제어됨 */
    /* --sidebar-width: 240px; 제거하여 improved_header.css의 설정 사용 */
    /* --header-height: 70px; 제거하여 improved_header.css의 설정 사용 */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    
    /* 애니메이션 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

/* 기본 스타일 */
body.board-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

/* 메인 콘텐츠 레이아웃 */
.main-content {
    margin-top: 50px;
    min-height: calc(100vh - var(--header-height));
}

/* ==============================================
   히어로 섹션
   ============================================== */

/* 히어로 섹션 */
.hero-section {
    padding: 20px 0 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 2;
}

.hero-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-badge i {
    color: #667eea;
}

.hero-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    line-height: 1.1;
    margin-top: 5px;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    line-height: 1.4;
}

.notice-author::before {
    content: "👤 ";
}

.notice-date::before {
    content: "📅 ";
}

/* 게시판 레이아웃 - 자연스러운 세로 확장을 위한 수정 */
.board-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    min-height: auto; /* 최소 높이 제거하여 자연스러운 세로 확장 */
}

/* 좌측 사이드바 - 스크롤 시 따라오도록 수정 
   🚨 --sidebar-width, --header-height는 improved_header.css에서 제어됨 */
.board-sidebar {
    width: var(--sidebar-width);
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: sticky; /* sticky 복원하여 스크롤 시 따라오도록 */
    top: calc(var(--header-height) + 20px); /* 헤더 아래에 고정 */
    height: fit-content; /* 내용에 맞는 높이 */
    max-height: calc(100vh - var(--header-height) - 40px); /* 최대 높이 제한 */
    overflow-y: auto; /* 필요 시 스크롤 */
    border: 1px solid var(--notebook-border);
}

/* 사이드바 헤더 - 좌측 보드 사이드바 전용 */
.board-sidebar .sidebar-header {
    padding: 20px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--notebook-border);
}

.board-sidebar .sidebar-header i {
    font-size: 18px;
    color: var(--primary-color);
    opacity: 0.8;
}

.board-sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* 사이드바 네비게이션 - 좌측 보드 사이드바 전용 */
.board-sidebar .sidebar-nav {
    padding: 6px 0;
    border-bottom: 1px solid var(--notebook-border);
    margin-bottom: 20px;
}

.board-sidebar .sidebar-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.board-sidebar .sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.board-sidebar .sidebar-item:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary-color);
}

.board-sidebar .sidebar-item:hover::before {
    width: 4px;
}

.board-sidebar .sidebar-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.board-sidebar .sidebar-item.active::before {
    width: 4px;
    background: var(--primary-color);
}

.board-sidebar .sidebar-item i:first-child {
    width: 18px;
    text-align: center;
    margin-right: 10px;
    font-size: 15px;
    color: var(--text-secondary);
}

.board-sidebar .sidebar-item span {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.board-sidebar .sidebar-item i:last-child {
    font-size: 12px;
    opacity: 0.6;
    color: var(--text-secondary);
}

.board-sidebar .sidebar-item:hover i:first-child,
.board-sidebar .sidebar-item.active i:first-child {
    color: var(--primary-color);
}

.board-sidebar .sidebar-item:hover i:last-child,
.board-sidebar .sidebar-item.active i:last-child {
    opacity: 1;
    color: var(--primary-color);
}

/* 사이드바 컨트롤 섹션 - 좌측 보드 사이드바 전용 */
.board-sidebar .sidebar-controls {
    padding: 20px 16px;
}

.board-sidebar .sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--notebook-border);
}

.board-sidebar .sidebar-section-title i {
    font-size: 13px;
}

.sidebar-search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-select,
.sidebar-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--notebook-border);
    border-radius: var(--border-radius);
    font-size: 13px;
    background: white;
    color: var(--text-primary);
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.sidebar-select:focus,
.sidebar-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sidebar-search-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
}

.sidebar-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sidebar-write-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    transition: var(--transition-fast);
    box-sizing: border-box;
    margin-top: 4px;
}

.sidebar-write-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 메인 콘텐츠 영역 - 종이 스타일 */
.board-container {
    flex: 1;
    background: var(--paper-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px var(--paper-shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: fit-content;
    max-height: calc(100vh - var(--header-height) - 120px);
    display: flex;
    flex-direction: column;
}

/* 게시판 헤더 - 종이 상단 스타일 */
.board-header {
    padding: 20px 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 2px solid var(--notebook-border);
    position: relative;
}

.board-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.board-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-title i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.board-desc {
    color: var(--text-secondary);
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* 검색 및 컨트롤 영역 */
.board-controls {
    padding: 16px 40px;
    background: var(--notebook-bg);
    border-bottom: 1px solid var(--notebook-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    max-width: 500px;
}

.search-form select,
.search-form input {
    padding: 12px 16px;
    border: 2px solid var(--notebook-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: white;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.search-form select:focus,
.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-form select {
    min-width: 120px;
}

.search-form input {
    flex: 1;
    min-width: 200px;
}

.search-btn, .write-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.write-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.write-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 게시글 테이블 영역 */
.board-table-container {
    padding: 20px 40px 0;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 600px; /* 최소 높이 설정으로 레이아웃 시프트 방지 */
    position: relative;
    overflow: hidden; /* 전환 효과 시 깔끔한 모습 */
}

/* AJAX 로딩 중 안정성을 위한 스타일 */
.board-table-container.loading {
    pointer-events: none; /* 로딩 중 상호작용 차단 */
}

.board-table-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    backdrop-filter: blur(1px);
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    flex: 1;
}

.board-table th {
    padding: 16px 12px;
    background: var(--notebook-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    border-bottom: 2px solid var(--notebook-border);
}

.board-table th:first-child {
    border-top-left-radius: var(--border-radius);
}

.board-table th:last-child {
    border-top-right-radius: var(--border-radius);
}

.board-table tr {
    border-bottom: 1px solid var(--notebook-border);
    transition: var(--transition-fast);
}

.board-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.04);
}

.board-table td {
    padding: 16px 12px;
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 14px;
}

.board-table td.title {
    font-weight: 500;
}

.board-table td.title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.board-table td.title a:hover {
    color: var(--primary-color);
}

.board-table tr.notice {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.notice-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.new-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.comment-count {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 8px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 40px 20px;
    background: var(--notebook-bg);
    border-top: 1px solid var(--notebook-border);
}

.pagination a,
.pagination .current {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    min-width: 36px;
    text-align: center;
}

.pagination a {
    color: var(--text-secondary);
    border: 1px solid var(--notebook-border);
    background: white;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}


@media (max-width: 768px) {
    /* 🎯 480px 이하 모바일 완전 최적화 - 카드 기반 레이아웃 */
    
    /* 메인 콘텐츠 여백 최적화 */
    .main-content {
        padding: 10px 8px;
        margin-top: 50px; /* 헤더 높이에 맞춤 */
    }
    
    /* 히어로 섹션 컴팩트하게 */
    .hero-section {
        padding: 15px 0 20px;
        margin-bottom: 15px;
    }
    
    .hero-section .container {
        padding: 0 15px;
    }
    
    .hero-badge {
        padding: 6px 12px;
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }
    
    .hero-description {
        font-size: 13px;
        line-height: 1.4;
    }
    
    /* 🔥 레이아웃 완전 재구성 - 사이드바를 상단 탭으로 변경 */
    .board-layout {
        flex-direction: column;
        gap: 15px;
        margin: 0 -5px;
    }
    
    /* 🎯 사이드바 → 상단 탭 네비게이션으로 변경 
       🚨 --sidebar-width, --header-height는 improved_header.css에서 제어됨 */
    .board-sidebar {
        width: 100%;
        position: static;
        height: auto;
        max-height: none;
        order: -1; /* 상단으로 이동 */
        border-radius: 12px;
        margin: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    
    /* 사이드바 헤더 간소화 */
    .board-sidebar .sidebar-header {
        padding: 12px 15px;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    }
    
    .board-sidebar .sidebar-header h3 {
        font-size: 14px;
        margin: 0;
    }
    
    /* 🎯 카테고리 네비게이션을 가로 스크롤 탭으로 변경 */
    .board-sidebar .sidebar-nav {
        padding: 0;
        margin-bottom: 0;
        border-bottom: 1px solid rgba(102, 126, 234, 0.15);
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .board-sidebar .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .board-sidebar .sidebar-item {
        display: inline-flex !important;
        flex-direction: row;
        align-items: center;
        padding: 12px 16px;
        font-size: 13px;
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
        min-width: 100px;
        justify-content: center;
        margin-right: 8px;
        border-radius: 8px 8px 0 0;
    }
    
    .board-sidebar .sidebar-item:last-child {
        margin-right: 0;
    }
    
    .board-sidebar .sidebar-item::before {
        display: none;
    }
    
    .board-sidebar .sidebar-item.active {
        background: rgba(102, 126, 234, 0.1);
        color: #667eea;
        border-bottom-color: #667eea;
        font-weight: 600;
    }
    
    .board-sidebar .sidebar-item i:first-child {
        margin-right: 6px;
        font-size: 12px;
    }
    
    .board-sidebar .sidebar-item i:last-child {
        display: none; /* 화살표 아이콘 숨김 */
    }
    
    /* 🎯 검색 영역을 접힌 메뉴로 변경 */
    .board-sidebar .sidebar-controls {
        padding: 0;
        border-bottom: none;
    }
    
    .board-sidebar .sidebar-section-title {
        padding: 10px 15px;
        background: rgba(102, 126, 234, 0.05);
        margin: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 13px;
    }
    
    .board-sidebar .sidebar-section-title::after {
        content: '▼';
        font-size: 10px;
        transition: transform 0.3s ease;
    }
    
    .board-sidebar .sidebar-controls.collapsed .sidebar-section-title::after {
        transform: rotate(-90deg);
    }
    
    .board-sidebar .sidebar-search-form {
        display: none;
        padding: 15px;
        background: rgba(102, 126, 234, 0.02);
        border-top: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .board-sidebar .sidebar-controls.expanded .sidebar-search-form {
        display: block;
    }
    
    .board-sidebar .sidebar-select,
    .board-sidebar .sidebar-input {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid rgba(102, 126, 234, 0.2);
        border-radius: 8px;
        font-size: 14px;
    }
    
    .board-sidebar .sidebar-search-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .board-sidebar .sidebar-write-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
        margin-top: 5px;
    }
    
    /* 🔥 메인 콘텐츠 영역 전체 너비 사용 */
    .board-container {
        width: 100%;
        margin: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }
    
    /* 🎯 테이블을 완전히 숨기고 카드 레이아웃으로 대체 */
    .board-table-container {
        display: none !important;
    }
    
    /* 🚀 새로운 모바일 카드 레이아웃 */
    .mobile-board-list {
        padding: 15px;
    }
    
    .mobile-post-card {
        background: white;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(102, 126, 234, 0.1);
        transition: all 0.3s ease;
        cursor: pointer;
        /* 터치 최적화 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .mobile-post-card:active {
        transform: scale(0.98);
        background: rgba(102, 126, 234, 0.02);
    }
    
    .mobile-post-card.notice {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
        border-color: rgba(255, 193, 7, 0.3);
    }
    
    .mobile-post-card.hot-post {
        background: linear-gradient(135deg, rgba(220, 53, 69, 0.05) 0%, rgba(255, 99, 132, 0.05) 100%);
        border-color: rgba(220, 53, 69, 0.2);
    }
    
    .mobile-post-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 8px;
    }
    
    .mobile-post-badges {
        display: flex;
        gap: 6px;
        align-items: center;
    }
    
    .mobile-notice-badge {
        background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
        color: white;
        padding: 3px 8px;
        border-radius: 12px;
        font-size: 10px;
        font-weight: 600;
    }
    
    .mobile-new-badge {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
        padding: 2px 6px;
        border-radius: 8px;
        font-size: 9px;
        font-weight: 600;
    }
    
    .mobile-hot-badge {
        background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
        color: white;
        padding: 2px 6px;
        border-radius: 8px;
        font-size: 9px;
        font-weight: 600;
    }
    
    .mobile-post-id {
        background: rgba(102, 126, 234, 0.1);
        color: #667eea;
        padding: 4px 8px;
        border-radius: 8px;
        font-size: 11px;
        font-weight: 600;
        min-width: 35px;
        text-align: center;
    }
    
    .mobile-post-title {
        font-size: 15px;
        font-weight: 600;
        color: #2d3748;
        line-height: 1.4;
        margin-bottom: 8px;
        word-break: break-word;
    }
    
    .mobile-post-title:hover {
        color: #667eea;
    }
    
    .mobile-comment-count {
        color: #667eea;
        font-weight: 600;
        margin-left: 6px;
    }
    
    .mobile-post-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 12px;
        color: #718096;
        margin-top: 10px;
    }
    
    .mobile-post-author {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .mobile-post-author i {
        color: #667eea;
    }
    
    .mobile-post-stats {
        display: flex;
        gap: 12px;
        align-items: center;
    }
    
    .mobile-stat-item {
        display: flex;
        align-items: center;
        gap: 3px;
    }
    
    .mobile-stat-item i {
        font-size: 11px;
        color: #a0aec0;
    }
    
    .mobile-post-date {
        font-size: 11px;
        color: #a0aec0;
    }
    
    /* 🎯 페이지네이션 모바일 최적화 */
    .pagination {
        padding: 15px;
        text-align: center;
        background: white;
        border-top: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .pagination a,
    .pagination .current {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
        margin: 0 2px;
        border-radius: 8px;
        /* 터치 최적화 */
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .pagination a:active {
        transform: scale(0.95);
    }
    
    /* 🎯 모바일 전용 플로팅 글쓰기 버튼 */
    .mobile-write-floating {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        font-size: 20px;
        z-index: 1000;
        cursor: pointer;
        transition: all 0.3s ease;
        /* 터치 최적화 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .mobile-write-floating:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    }
    
    .mobile-write-floating:active {
        transform: scale(0.95);
    }
}

/* 🎯 모바일 JavaScript 연동을 위한 추가 스타일 */
@media (max-width: 768px) {
    /* 검색 토글 애니메이션 */
    .sidebar-controls {
        transition: all 0.3s ease;
    }
    
    .sidebar-search-form {
        transition: all 0.3s ease;
        transform-origin: top;
    }
    
    .sidebar-controls.collapsed .sidebar-search-form {
        transform: scaleY(0);
        opacity: 0;
        height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    
    /* 카드 호버/터치 효과 강화 */
    .mobile-post-card {
        position: relative;
        overflow: hidden;
    }
    
    .mobile-post-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
        transition: left 0.5s ease;
    }
    
    .mobile-post-card:hover::before {
        left: 100%;
    }
    
    /* 터치 피드백 최적화 */
    .mobile-post-card,
    .sidebar-item,
    .pagination a,
    .mobile-write-floating {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* 로딩 스타일 - 부드러운 효과 */
.board-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 20;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--notebook-border);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.board-loading span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 포커스 스타일 */
.sidebar-item:focus,
.search-btn:focus,
.write-btn:focus,
.pagination a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    :root {
        --paper-bg: #1a202c;
        --text-primary: #e2e8f0;
        --text-secondary: #a0aec0;
        --notebook-bg: #2d3748;
        --notebook-border: #4a5568;
    }
} 

/* 모바일 전용 컨트롤 - 기본적으로 숨김 */
.mobile-controls {
    display: none;
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px 10px;
        margin-top: var(--header-height);
    }

    /* 모바일 히어로 섹션 간소화 */
    .hero-section {
        padding: 30px 0 1px;
        margin-bottom: 12px;
        background: transparent; /* 완전 투명 */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
    }

    .hero-section .container {
        padding: 0 15px;
    }

    /* 모바일에서 날짜 배지 숨기기 */
    .hero-badge {
        display: none;
    }

    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 4px;
        font-weight: 600;
    }

    .hero-description {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 0;
    }

    /* 모바일 컨트롤 통합 스타일 */
    .mobile-controls {
        display: block;
        max-width: 1400px;
        margin: 0 auto 16px;
        padding: 0px;
    }

    .mobile-board-select-container {
        margin-bottom: 12px;
    }

    .mobile-board-select-container .mobile-board-select,
    .mobile-controls .mobile-board-select-container .mobile-board-select,
    .mobile-controls select.mobile-board-select,
    select.mobile-board-select {
        width: 100% !important;
        padding: 12px 36px 12px 16px !important; /* 통합된 패딩 */
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        color: #2d3748;
        font-size: 15px !important;
        font-weight: 500;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 12px center;
        background-repeat: no-repeat;
        background-size: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        box-sizing: border-box !important;
        text-indent: 0px !important;
        text-align: left !important;
    }

    .mobile-board-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
        background: white;
    }

    .mobile-board-select option {
        background: white;
        color: #2d3748;
        padding: 8px;
    }

    .mobile-search-container {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 14px;
        padding: 14px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .mobile-search-input-group {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
    }

    .mobile-search-row {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-search-select {
        flex: 0 0 75px;
        padding: 10px 32px 10px 12px; /* 왼쪽 패딩 증가, 오른쪽 패딩 조정 */
        border: 1px solid rgba(102, 126, 234, 0.3);
        border-radius: 8px;
        background: white;
        color: #2d3748;
        font-size: 13px;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 6px center;
        background-repeat: no-repeat;
        background-size: 12px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .mobile-search-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    }

    .mobile-search-select option {
        background: white;
        color: #2d3748;
        padding: 6px;
    }

    .mobile-search-input {
        flex: 1;
        padding: 10px 5px;
        border: 1px solid rgba(102, 126, 234, 0.3);
        border-radius: 8px;
        background: white;
        color: #2d3748;
        font-size: 13px;
        transition: var(--transition-fast);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .mobile-search-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    }

    .mobile-search-input::placeholder {
        color: rgba(45, 55, 72, 0.6);
    }

    .mobile-search-btn {
        padding: 10px 14px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 13px;
        cursor: pointer;
        transition: var(--transition-fast);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .mobile-search-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }

    .mobile-search-btn:active {
        transform: translateY(0);
    }

    .board-layout {
        flex-direction: column;
        gap: 0;
        padding: 5px;
    }

    /* 사이드바 숨기기 */
    .board-sidebar {
        display: none !important;
    }

    /* 기존 탭 관련 스타일 제거 */
    .sidebar-nav {
        display: none;
    }

    .sidebar-controls {
        display: none;
    }

    .board-container {
        width: 100%;
        max-width: none;
        max-height: none !important; /* PC용 max-height 제거하여 무한스크롤 활성화 */
        height: auto; /* 자동 높이 설정 */
        margin: 0;
        padding: 0;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 14px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        overflow: visible; /* 무한스크롤을 위해 visible로 변경 */
        margin-bottom: 20px; /* 푸터와 간격 확보 */
        /* 뷰포트 안정화를 위한 최소 높이 */
        min-height: calc(var(--vh, 1vh) * 50);
    }

    .board-table-container {
        display: none !important;
    }

    .mobile-board-list {
        display: block;
    }

    /* 무한스크롤 컨테이너 개선 */
    .infinite-scroll-container {
        position: relative;
        width: 100%;
        height: auto; /* 자동 높이로 자유로운 확장 허용 */
        min-height: auto; /* 최소 높이 제한 제거 */
        max-height: none; /* 최대 높이 제한 제거 */
        padding-bottom: 100px; /* 푸터 공간 확보 */
        overflow: visible; /* 스크롤 제한 제거 */
    }

    .mobile-post-card {
        background: white;
        border-radius: 10px;
        margin-bottom: 8px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.05);
        transition: var(--transition-fast);
        cursor: pointer;
    }

    .mobile-post-card:active,
    .mobile-post-card.touch-pressed {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .mobile-post-card.notice {
        background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
        border-color: #fdcb6e;
    }

    .mobile-post-card.hot-post {
        background: linear-gradient(135deg, #ff7675 0%, #fd79a8 100%);
        color: white;
    }

    .mobile-post-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 8px;
    }

    .mobile-post-badges {
        display: flex;
        gap: 4px;
        align-items: center;
    }

    .mobile-notice-badge {
        background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
        color: white;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 10px;
        font-weight: 600;
    }

    .mobile-new-badge {
        background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
        color: white;
        padding: 2px 6px;
        border-radius: 8px;
        font-size: 9px;
        font-weight: 600;
    }

    .mobile-hot-badge {
        background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
        color: white;
        padding: 2px 6px;
        border-radius: 8px;
        font-size: 9px;
        font-weight: 600;
    }

    .mobile-post-id {
        font-size: 11px;
        color: var(--text-muted);
        background: rgba(0, 0, 0, 0.05);
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;
    }

    .mobile-post-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 10px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-post-title:hover {
        color: var(--primary-color);
    }

    .mobile-comment-count {
        color: var(--primary-color);
        font-weight: 600;
        font-size: 13px;
    }

    .mobile-post-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 12px;
        color: var(--text-secondary);
    }

    .mobile-post-author {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .mobile-post-author i {
        opacity: 0.7;
    }

    .mobile-post-stats {
        display: flex;
        gap: 8px;
    }

    .mobile-stat-item {
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .mobile-stat-item i {
        opacity: 0.7;
        font-size: 10px;
    }

    .mobile-post-date {
        color: var(--text-muted);
        font-size: 11px;
    }

    /* 터치 피드백 클래스 */
    .touch-active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }

    .touch-pressed {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }

    .input-focus {
        border-color: #667eea !important;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
        background: white !important;
    }

    /* 무한스크롤 로딩 최적화 */
    .infinite-scroll-loading {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        margin: 20px 0;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .infinite-scroll-spinner {
        width: 24px;
        height: 24px;
        border-width: 2px;
    }

    .infinite-scroll-text {
        font-size: 13px;
        margin-left: 10px;
        color: var(--text-secondary);
    }

    .infinite-scroll-end {
        padding: 16px;
        font-size: 13px;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        margin: 20px 0;
        text-align: center;
        color: var(--text-muted);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* 페이지네이션 숨기기 (무한스크롤 모드) - 시각적으로만 숨기기 */
    .pagination {
        position: absolute;
        left: -9999px;
        visibility: hidden;
        height: 0;
        overflow: hidden;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        margin: 0 2px;
        border-radius: 6px;
        font-size: 14px;
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.1);
        transition: var(--transition-fast);
    }

    .pagination a:active {
        transform: scale(0.95);
    }

    .mobile-write-floating {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
        cursor: pointer;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        transition: var(--transition);
        text-decoration: none;
    }

    .mobile-write-floating:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    }

    .mobile-write-floating:active,
    .mobile-write-floating.touch-pressed {
        transform: scale(0.95);
    }

    /* 모바일 컨트롤 터치 피드백 */
    .mobile-board-select.touch-active,
    .mobile-search-select.touch-active {
        transform: scale(0.98);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    }

    .mobile-search-btn.touch-active {
        transform: scale(0.95) translateY(-1px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }

    /* 터치 디바이스 최적화 */
    @media (pointer: coarse) {
        .mobile-post-card {
            min-height: 44px; /* 최소 터치 타겟 크기 */
        }
        
        .mobile-search-btn,
        .mobile-board-select,
        .mobile-search-select {
            min-height: 44px; /* 터치 접근성 개선 */
        }
    }

    /* 성능 최적화를 위한 GPU 가속 */
    .mobile-post-card,
    .mobile-write-floating,
    .mobile-search-btn,
    .mobile-board-select,
    .mobile-search-select {
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}

/* 기존 스타일 유지 */
@media (max-width: 768px) {
    .sidebar-controls {
        display: none !important;
    }

    .sidebar-search-form {
        display: none !important;
    }

    .sidebar-controls.collapsed .sidebar-search-form {
        display: none !important;
    }

    .mobile-post-card {
        margin-bottom: 6px;
        padding: 14px;
    }

    .mobile-post-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, transparent 0%, rgba(102, 126, 234, 0.02) 100%);
        pointer-events: none;
        transition: var(--transition-fast);
    }

    .mobile-post-card:hover::before {
        background: linear-gradient(135deg, transparent 0%, rgba(102, 126, 234, 0.05) 100%);
    }

    .mobile-post-card,
    .mobile-post-card:hover,
    .mobile-post-card:active {
        position: relative;
        text-decoration: none;
        color: inherit;
    }
} 

/* 무한스크롤 관련 스타일 */
.infinite-scroll-container {
    position: relative;
}

.infinite-scroll-loading {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.infinite-scroll-loading.active {
    display: flex;
}

.infinite-scroll-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.infinite-scroll-text {
    margin-left: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.infinite-scroll-end {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.infinite-scroll-end.active {
    display: flex;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 