/* ========================================
   Modern View Styles for Board Detail
   게시글 상세보기 페이지
   ======================================== */

/* View Section */
.view-section {
    min-height: 100vh;
    padding: 8rem 0 4rem;
    background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
}

/* Container */
.view-section .container {
    max-width: 80%;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* View Header - 제목 영역 */
.view-header {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #667eea;
}

.view-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    word-break: break-word;
}

/* View Meta - 작성자, 날짜, 조회수 */
.view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1.25rem;
    background: #f7fafc;
    border-radius: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4a5568;
    font-size: 0.95rem;
}

.meta-item i {
    color: #667eea;
    font-size: 1.25rem;
}

.meta-label {
    font-weight: 600;
    color: #2d3748;
}

.meta-value {
    color: #4a5568;
}

/* View Content - 본문 영역 */
.view-content-wrapper {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    min-height: 50vh; /* 화면 절반 높이 유지 */
}

.view-content {
    min-height: 50vh; /* 내부도 최소 절반 크기 유지 */
    padding: 2rem 1.5rem;
    text-align: left;
    line-height: 1.7;
}

.view-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* View Actions - 버튼 영역 */
.view-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Button Styles */
.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-list {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

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

.btn-edit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.3);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
    color: white;
}

.btn-delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    color: white;
}

.btn-prev,
.btn-next {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-prev:hover,
.btn-next:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}

.btn-view i {
    font-size: 1.1rem;
}

/* Navigation - 이전글/다음글 */
.view-navigation {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-item:hover {
    background: #f7fafc;
    padding-left: 1.5rem;
}

.nav-label {
    min-width: 80px;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-title {
    flex: 1;
    color: #2d3748;
    text-decoration: none;
    font-size: 1rem;
}

.nav-title:hover {
    color: #667eea;
}

.nav-empty {
    color: #a0aec0;
    font-style: italic;
}

/* Divider */
.view-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .view-section .container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .view-section {
        padding: 6rem 0 3rem;
    }

    .view-section .container {
        max-width: 95%;
        padding: 0 1rem;
    }

    .view-header {
        padding: 1.5rem;
    }

    .view-title {
        font-size: 1.5rem;
    }

    .view-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .view-content {
        padding: 2rem 1.5rem;
        font-size: 1rem;
    }

    .view-actions {
        flex-direction: column;
    }

    .action-group {
        width: 100%;
        flex-direction: column;
    }

    .btn-view {
        width: 100%;
        justify-content: center;
    }

    .nav-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .view-header {
        padding: 1.25rem;
    }

    .view-content {
        padding: 1.5rem 1rem;
    }

    .btn-view {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .view-actions,
    .view-navigation,
    .scroll-to-top {
        display: none;
    }

    .view-section {
        padding: 0;
    }

    .view-content {
        font-size: 12pt;
        line-height: 1.6;
    }
}

/* Loading Animation */
.view-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* Image Gallery (이미지 첨부 게시판용) */
.view-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
