/* hpost.css - 핫플썰 목록 페이지 스타일 */

/* 핫플썰 목록 페이지 전체 배경을 흰색으로 */
body {
    background-color: #ffffff !important;
}

/* 핫플썰 목록 페이지 전체 스타일 */
.hpost-container {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 60px 0 20px 0;
}

/* 핫플썰 제목 */
.hpost-title {
    margin: 0 0 20px 0;
}

.hpost-title h2 {
    color: #000000;
    font-weight: bold;
    font-size: 28px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* 검색 기능 */
.hpost-search-container {
    margin-bottom: 25px;
    background: #e9ecef;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #dee2e6;
}

.hpost-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.hpost-search-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hpost-search-type {
    flex: 0 0 110px;
}

.hpost-search-type .form-select {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hpost-search-type .form-select:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hpost-search-input {
    flex: 1;
}

.hpost-search-input .form-control {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hpost-search-input .form-control:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hpost-search-button {
    flex: 0 0 auto;
}

.hpost-search-button .btn {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
    background: #6c757d;
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
    transition: all 0.3s ease;
}

.hpost-search-button .btn:hover {
    background: #495057;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* 정렬 드롭다운과 글쓰기 버튼 컨트롤 영역 */
.hpost-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 정렬 버튼 컨테이너 */
.hpost-sort-buttons {
    display: flex;
    gap: 6px;
}

.hpost-sort-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 36px;
    min-width: 50px;
}

.hpost-sort-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.hpost-sort-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}



/* 애니메이션 키프레임 */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 105, 180, 0.3), 0 0 10px rgba(255, 105, 180, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.6), 0 0 30px rgba(255, 105, 180, 0.4);
    }
}

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

@keyframes shimmer {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
        transform: translateX(100%);
    }
}

/* 글쓰기 버튼 */
.hpost-write-btn .btn {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    min-height: 36px;
}

/* 순위 숫자 스타일 */
.rank-number {
    position: relative;
    display: inline-block;
}

/* 1,2,3위만 빛나는 효과 적용 */
.rank-number.top-rank {
    animation: rankGlow 2s ease-in-out infinite;
}

.rank-number.top-rank::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 105, 180, 0.4) 0%, transparent 70%);
    animation: rotateRankGlow 3s linear infinite;
    pointer-events: none;
    z-index: -1;
}

.rank-number.top-rank::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 105, 180, 0.1), transparent);
    animation: shimmer 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rankGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 105, 180, 0.4), 0 0 10px rgba(255, 105, 180, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.7), 0 0 30px rgba(255, 105, 180, 0.5);
    }
}

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

/* 게시글 목록 헤더 */
.hpost-header {
    margin: 20px 0 5px 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 0;
}

.hpost-header .row {
    color: #000000;
    font-weight: bold;
    font-size: 16px;
    margin: 0;
}

.hpost-header .row > div {
    text-align: center;
    padding: 12px 5px;
    color: #000000;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
}

.hpost-header .row > div:last-child {
    border-right: none;
}

/* 구분선 */
.hpost-divider {
    border: none;
    border-top: 1px solid #a0a0a0;
    margin: 0 0 5px 0;
    height: 1px;
}

/* 게시글 목록 영역 */
.hpost-content {
    min-height: 300px;
}

/* 게시글 아이템 */
.hpost-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    display: flex;
    align-items: center;
}

.hpost-item:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* 데스크톱에서 모바일 카드 숨김 */
.hpost-mobile-card {
    display: none;
}

/* 데스크톱에서만 적용되는 스타일 */
@media (min-width: 769px) {
    .hpost-mobile-card {
        display: none !important;
    }
    
    .hpost-desktop-structure {
        display: flex !important;
    }
}

/* 데스크톱에서 기존 구조 표시 */
.hpost-desktop-structure {
    display: flex;
    width: 100%;
    align-items: center;
}

.hpost-desktop-structure > div {
    text-align: center;
    padding: 6px 5px;
    color: #000000;
    font-size: 14px;
    vertical-align: middle;
    border-right: 1px solid #f0f0f0;
}

.hpost-desktop-structure > div:last-child {
    border-right: none;
}

/* 데스크톱에서 제목은 왼쪽 정렬 */
.hpost-desktop-structure > div:nth-child(2),
.hpost-desktop-structure > div:nth-child(3) {
    text-align: left;
    padding-left: 15px;
}

.hpost-item > div {
    text-align: center;
    padding: 6px 5px;
    color: #000000;
    font-size: 14px;
    vertical-align: middle;
    border-right: 1px solid #f0f0f0;
    flex: 1;
}

.hpost-item > div:last-child {
    border-right: none;
}

/* 데스크톱에서 제목은 왼쪽 정렬 */
.hpost-item > div:nth-child(2),
.hpost-item > div:nth-child(3) {
    text-align: left;
    padding-left: 15px;
}

/* 제목 링크 스타일 */
.hpost-title-link {
    color: #000000;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.hpost-title-link:hover {
    color: #007bff;
    text-decoration: underline;
}

/* 작성일 회색 스타일 */
.hpost-date {
    color: #666666 !important;
    font-size: 14px;
}

/* 게시글 아이템 구분선 */
.hpost-item-divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 0;
    height: 1px;
}

.hpost-content .text-center {
    color: #666666;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.hpost-content .text-center p {
    margin-bottom: 10px;
    font-size: 16px;
}

/* 전체 컨테이너 배경 */
.container.mt-5 {
    background-color: #ffffff;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .hpost-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .hpost-sort-buttons {
        gap: 4px;
    }
    
    .hpost-sort-btn {
        padding: 10px 16px !important;
        font-size: 13px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        min-width: 60px !important;
        line-height: 1.2 !important;
        border-radius: 8px !important;
    }
    
    .hpost-write-btn .btn {
        font-size: 13px !important;
        padding: 10px 16px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        line-height: 1.2 !important;
        border-radius: 8px !important;
    }
    
    /* 모바일에서 테이블을 카드 형식으로 변경 */
    .hpost-header {
        display: none !important;
    }
    
    /* 모바일에서 데스크톱 구조 숨김 */
    .hpost-desktop-structure {
        display: none !important;
    }
    
    /* 모바일에서 모바일 카드 표시 */
    .hpost-mobile-card {
        display: block !important;
    }
    
    .hpost-item {
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.2s ease;
        position: relative;
    }
    
    .hpost-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
    
    /* 모바일 카드 구조 표시 */
    .hpost-mobile-card {
        display: block !important;
    }
    
    /* 데스크톱 구조 숨김 */
    .hpost-desktop-structure {
        display: none !important;
    }
    
    /* 모바일 닉네임 */
    .hpost-mobile-nickname {
        font-weight: 600;
        color: #495057;
        font-size: 14px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
    }
    
    /* 모바일 제목 */
    .hpost-mobile-title {
        margin-bottom: 8px;
    }
    
    .hpost-mobile-title .hpost-title-link {
        font-size: 15px;
        line-height: 1.4;
        color: #212529;
        font-weight: 600;
        text-decoration: none;
        display: block;
        word-break: break-word;
    }
    
    .hpost-mobile-title .hpost-title-link:hover {
        color: #007bff;
        text-decoration: none;
    }
    
    /* 모바일 통계 정보 (작성일 + 조회수/좋아요/싫어요/댓글) */
    .hpost-mobile-stats {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .hpost-stat-item {
        font-size: 11px;
        color: #6c757d;
        display: flex;
        align-items: center;
        gap: 2px;
    }
    
    .hpost-stat-item i {
        font-size: 12px;
    }
    
    /* 작성일 아이템 (아이콘 없이) */
    .hpost-date-item {
        font-size: 12px;
        color: #6c757d;
    }
    
    /* 구분선 제거 */
    .hpost-item-divider {
        display: none;
    }
    
    /* 모바일에서 관리자 삭제 버튼은 JavaScript에서 권한에 따라 제어 */
    
    /* 제목 스타일 개선 */
    .hpost-title h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

/* 480px 이하 모바일 */
@media (max-width: 480px) {
    .hpost-sort-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        min-width: 50px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
    }
    
    .hpost-write-btn .btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
    }
    
    /* 헤더 스타일 */
    .hpost-header .row > div {
        font-size: 12px;
        padding: 6px 2px;
    }
    
    /* 게시글 아이템 스타일 */
    .hpost-item > div {
        font-size: 12px;
        padding: 5px 2px;
    }
    
    /* 제목 링크 스타일 */
    .hpost-title-link {
        font-size: 12px;
        line-height: 1.3;
    }
    
    /* 480px 이하에서도 카드 형식 유지 */
    .hpost-item {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .hpost-item > div:nth-child(1) {
        font-size: 13px;
        margin-right: 10px;
    }
    
    .hpost-item > div:nth-child(7) {
        font-size: 11px;
    }
    
    .hpost-title-link {
        font-size: 14px;
    }
    
    .hpost-item > div:nth-child(3),
    .hpost-item > div:nth-child(6) {
        font-size: 11px;
        margin-right: 12px;
    }
}

/* 360px 이하 소형 모바일 */
@media (max-width: 360px) {
    .hpost-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
    }
    
    .hpost-sort-buttons {
        gap: 4px;
    }
    
    .hpost-sort-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        min-width: 50px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
    }
    
    .hpost-write-btn .btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
    }
}

/* 모달 backdrop 번쩍거리는 효과 제거 */
.modal-backdrop {
    transition: none !important;
}

.modal-backdrop.show {
    transition: none !important;
}

.modal-backdrop.fade {
    transition: none !important;
}

/* 모달 자체의 애니메이션도 부드럽게 */
.modal.fade .modal-dialog {
    transition: transform 0.15s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

/* ================= 페이징 스타일 ================= */
.hpost-pagination-info {
    margin-top: 20px;
    margin-bottom: 10px;
}

.hpost-pagination-info .badge {
    font-size: 0.7rem;
}

.hpost-pagination {
    margin-top: 30px;
    margin-bottom: 20px;
}

.hpost-pagination .pagination {
    margin: 0;
}

.hpost-pagination .page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.hpost-pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hpost-pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: bold;
}

.hpost-pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

.hpost-pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* 핫플썰 글 작성 체크리스트 스타일 */
.hpost-checklist-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.hpost-checklist-container h6 {
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hpost-checklist-container h6::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    font-size: 1.1rem;
}

.hpost-checklist {
    margin-bottom: 20px;
}

.hpost-checklist .checklist-item {
    margin-bottom: 12px;
}

.hpost-checklist .checklist-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.hpost-checklist .checklist-label:hover {
    background-color: #e9ecef;
}

.hpost-checklist .checklist-checkbox {
    display: none;
}

.hpost-checklist .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 4px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hpost-checklist .checkmark::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hpost-checklist .checklist-checkbox:checked + .checkmark {
    background-color: #28a745;
    border-color: #28a745;
}

.hpost-checklist .checklist-checkbox:checked + .checkmark::after {
    opacity: 1;
}

.hpost-checklist .checklist-text {
    color: #495057;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.hpost-checklist .checklist-text small {
    display: block;
    margin-top: 4px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.3;
}

.hpost-checklist .checklist-agreement {
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    margin-top: 15px;
}

.hpost-checklist .agreement-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.hpost-checklist .agreement-checkbox {
    display: none;
}

.hpost-checklist .agreement-checkmark {
    width: 32px;
    height: 32px;
    border: 2px solid #007bff;
    border-radius: 4px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hpost-checklist .agreement-checkmark::after {
    content: "";
    width: 10px;
    height: 14px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hpost-checklist .agreement-checkbox:checked + .agreement-checkmark {
    background-color: #007bff;
    border-color: #007bff;
}

.hpost-checklist .agreement-checkbox:checked + .agreement-checkmark::after {
    opacity: 1;
}

.hpost-checklist .agreement-text {
    color: #495057;
    font-size: 15px;
    font-weight: 500;
}

/* 체크리스트 동의 시 동의 섹션 스타일 변경 */
.hpost-checklist .agreement-checkbox:checked ~ .agreement-text {
    color: #28a745;
}

.hpost-checklist .agreement-checkbox:checked + .agreement-checkmark {
    border-color: #28a745;
    background-color: #28a745;
}

/* 제출 버튼 비활성화 상태 */
#hpostSubmitBtn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

#hpostSubmitBtn:not(:disabled) {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .hpost-checklist-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .hpost-checklist .checklist-label {
        padding: 6px;
    }
    
    .hpost-checklist .checklist-text {
        font-size: 13px;
    }
    
    .hpost-checklist .agreement-text {
        font-size: 14px;
    }
    
    .hpost-checklist .checklist-agreement {
        padding: 12px;
    }
    
    /* 모바일에서 핫플썰 글쓰기 모달 최적화 */
    #writePostModal .modal-dialog {
        max-width: none !important;
        width: 95% !important;
        margin: 2% auto !important;
    }
    
    #writePostModal .modal-content {
        width: 100% !important;
    }
    
    #writePostModal .modal-body {
        padding: 16px 12px !important;
    }
    
    /* 모바일에서 입력 필드 적절한 크기 */
    #writePostModal .form-label {
        font-size: 15px !important;
        font-weight: 600 !important;
        margin-bottom: 8px !important;
    }
    
    #writePostModal .form-control {
        font-size: 16px !important;
        padding: 12px 14px !important;
        min-height: 44px !important;
        border-width: 1px !important;
    }
    
    #writePostModal textarea.form-control {
        min-height: 120px !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        padding: 12px 14px !important;
    }
    
    #writePostModal .form-text {
        font-size: 13px !important;
        margin-top: 6px !important;
    }
    
    #writePostModal .modal-title {
        font-size: 18px !important;
        font-weight: 600 !important;
    }
    
    #writePostModal .modal-header {
        padding: 16px 18px !important;
    }
    
    #writePostModal .modal-footer {
        padding: 14px 18px !important;
    }
    
    #writePostModal .modal-footer .btn {
        font-size: 15px !important;
        padding: 12px 20px !important;
        font-weight: 600 !important;
        min-height: 44px !important;
    }
    
    /* 체크리스트 모바일 최적화 */
    #writePostModal .hpost-checklist-container {
        padding: 14px !important;
        margin: 16px 0 !important;
    }
    
    #writePostModal .hpost-checklist-container h6 {
        font-size: 15px !important;
        font-weight: 600 !important;
        margin-bottom: 12px !important;
    }
    
    #writePostModal .checklist-text {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    #writePostModal .checklist-text small {
        font-size: 12px !important;
        margin-top: 4px !important;
    }
    
    #writePostModal .agreement-text {
        font-size: 14px !important;
        font-weight: 600 !important;
    }
    
    #writePostModal .checkmark {
        width: 22px !important;
        height: 22px !important;
        border-width: 2px !important;
    }
    
    #writePostModal .agreement-checkmark {
        width: 28px !important;
        height: 28px !important;
        border-width: 2px !important;
    }
}