/* 모달 오버레이 */
.h-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 모달 컨텐츠 */
.h-modal-content {
    background: white;
    border-radius: 12px;
    width: 840px;
    /* width: 820px; */
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* padding: 50px 45px 15px 45px; */
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 모달 헤더 */
.h-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom:24px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding: 50px 45px 0 45px;
}

.h-modal-header-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #000;
}

.h-modal-header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.h-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.h-modal-close:hover {
    color: #333;
}

/* 모달 바디 */
.h-modal-body {
    flex: 1;
    padding: 0 45px 15px 45px;
    overflow-y: auto;
}

.h-join-list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 현재 로그인한 계정 섹션 */
.h-current-account-section {
    padding: 20px 30px;
    background: #F9F9F9;
    border-radius: 16px;
}

.h-current-account-label {
    font-size: 18px;
    color: #000;
    margin-bottom: 25px;
}

.h-current-account-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
}

.h-account-info {
    display: flex;
    gap: 18px;
    align-items: center;
}

.h-account-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    background: #e0e0e0;
}

.h-account-avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.h-account-details {
    display: flex;
    flex-direction: column;
}

.h-account-name {
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.h-account-email {
    font-size: 14px;
    color: #666;
}

.h-account-switch-btn {
    padding: 8px 20px;
    border: 1px solid #7800FF;
    border-radius: 20px;
    color: #7800FF;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    background: #fff;
}

.h-account-switch-btn:hover {
    background: #7800ff;
    color: white;
}

/* 구매 콘텐츠 섹션 */
.h-content-section {
    display: flex;
    flex-direction: column;
    margin-top: 50px;
}

.h-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 99;
    padding-bottom: 20px;
    margin-bottom: 15px;
}

.h-content-left {
    display: flex;
    align-items: center;
    gap: 17px;
}

.h-content-title {
    font-size: 18px;
    font-weight: 400;
    color: #000;
}

.h-content-count {
    font-size: 14px;
    font-weight: 400;
    color: #9c9c9c;
    align-self: flex-end;
}

/* 검색 바 */
.h-content-search {
    display: flex;
    align-items: center;
    height: 35px;
    background: white;
    border: 1px solid #b4b4b4;
    border-radius: 20px;
    padding: 0 14px;
    gap: 8px;
    max-width:295px;
    width: 100%;
}

.h-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    color: #333;
    background: transparent;
}

.h-search-input::placeholder {
    color: #bbb;
}

.h-search-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.h-search-btn:hover {
    color: #999;
}

/* 콘텐츠 카드 그리드 */
.h-content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 20px;
    margin-bottom: 45px;
}

.h-modal-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.h-modal-card-hidden {
    display: none;
}

.h-modal-card-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.h-modal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.h-modal-card:hover .h-modal-card-image img {
    transform: scale(1.1);
}

/* 호버 오버레이 */
.h-modal-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.h-modal-card:hover .h-modal-card-overlay {
    opacity: 1;
}

/* 오버레이 상단 */
.h-modal-overlay-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.h-modal-overlay-categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
    flex: 1;
}

.h-modal-overlay-category {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.h-content-card-wish {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 11px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.h-content-card-wish:hover {
    color: rgb(255, 77, 79);
}

.h-content-card-wish.active {
    color: rgb(255, 77, 79);
}

/* 오버레이 하단 */
.h-modal-overlay-bottom {
    display: flex;
    flex-direction: column;
}

.h-modal-overlay-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-align: center;
    margin: 15px 0;
}

.h-modal-overlay-count{
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
}

.h-modal-overlay-play-btn {
    background: #7800FF;
    border: none;
    color: #fff;
    padding: 6px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    max-width: 80px;
    align-self: center;
    width: 100%;
}

.h-modal-overlay-play-btn:hover {
    background: #5a4fc1;
}

.h-modal-overlay-play-btn i {
    font-size: 11px;
}

/* 선택 콘텐츠 정보 섹션 */
.h-selected-content-info {
    /* padding: 28px 34px; */
    margin-bottom: 45px;
    background-color: transparent;
    border-radius: 0;
    display: flex;
    gap: 25px;
}

.h-selected-content-img {
    width: 168px;
    height: 168px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.h-selected-content-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.h-selected-content-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.h-selected-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.h-selected-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    flex: 1;
    line-height: 1.4;
}

.h-selected-count {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.h-selected-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.h-selected-tags-row {
    display: flex;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 18px;
}

.h-selected-tags-row .h-selected-tags {
    flex: 1;
    gap: 6px;
    flex-wrap: wrap;
}

.h-selected-tags-row .h-selected-count {
    white-space: nowrap;
    display: flex;
    font-size: 11px;
    font-weight: 600;
    height: 20px;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    border: 1px solid #bdbdbd;
    border-radius: 20px;
}

.h-selected-tags .h-selected-tag {
    font-size: 12px;
    padding: 0 14px;
    height: 20px;
    border-radius: 20px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
}

.h-selected-tags .h-selected-tag.main {
    background-color: #ff6a3d;
    color: white;
}

.h-selected-tags .h-selected-tag.sub {
    background-color: #e8e8e8;
    color: #333;
}

.h-selected-desc-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.h-selected-desc-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h-selected-desc-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.h-selected-desc-text {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.h-selected-qr-info {
    background: #F9F9F9;
    border-radius: 16px;
    padding: 18px 18px 18px 35px;
    display: flex;
    gap: 47px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.h-selected-qr-text {
    flex: 1;
    align-self: normal;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.h-selected-qr-text .h-selected-qr-title {
    font-size: 18px;
    font-weight: 700;
    padding-top: 7px;
    margin-bottom: 15px;
}

.h-selected-qr-text ol {
    padding-left: 12px;
    margin: 0;
    font-size: 12px;
    color: #9c9c9c;
    line-height: 1.4;
}

.h-selected-qr-text ol li {
    /* margin-bottom: 6px; */
}

.h-selected-qr-text p {
    font-size: 13px;
    color: #999;
    margin: 0;
    margin-bottom: 7px;
}

.h-selected-qr-code {
    height: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    padding: 20px;
    border-radius: 18px;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
/* #selected-qr{
   
} */
#selected-qr, .h-selected-qr-code img{
    width: 100%;
    height: 100%;
    max-width: 115px;
}

/* 더보기 버튼 */
.h-load-more-btn {
    align-self: center;
    justify-content: center;
    height:30px;
    background: white;
    color: #000;
    border: 1px solid #9d9d9d;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width:164px;
}

/* .h-load-more-btn:hover {
    border-color: #999;
    color: #666;
} */

/* 모달 푸터 */
.h-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e8e8e8;
    background-color: #f9f9f9;
}

.h-modal-btn-close {
    flex: 1;
    padding: 12px 20px;
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.h-modal-btn-close:hover {
    background-color: #5a4fc1;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.h-modal-btn-close:active {
    transform: scale(0.98);
}

/* 스크롤바 스타일 */
.h-modal-body::-webkit-scrollbar {
    width: 6px;
}

.h-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.h-modal-body::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}

.h-modal-body::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* 반응형 디자인 */
@media (max-width: 900px) {
    .h-modal-content {
        width: 90%;
        max-height: 90vh;
    }
    
    .h-content-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .h-modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }
    
    .h-modal-header {
        padding: 14px 16px;
    }
    
    .h-modal-header-title {
        font-size: 15px;
    }
    
    .h-content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .h-current-account-box {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .h-account-info {
        flex-direction: column;
        width: 100%;
    }
}
