/**
 * Recipe Detail Modal CSS - KRDS 퍼블리싱 기반
 * 나의지도 레시피 상세 모달 전용 스타일
 * Gallery 페이지 독립 스타일 (mrb_gis 의존성 제거)
 */

/* ========================================
   Gallery 페이지용 기본 스타일 (mrb_gis 대체)
   ======================================== */

/* 모달 위치 및 크기 조정 */
#recipeDetailModal {
    position: fixed;
    z-index: 20000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 0.6rem !important;
}

#recipeDetailModal .modal-dialog {
    margin: 0;
    max-height: 90vh;
}

#recipeDetailModal .modal-dialog.w600 {
    width: 600px;
    max-width: 90vw;
}

/* 모달 배경색 */
#recipeDetailModal .modal-content.bg-black-70 {
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 0.6rem !important;
    border: none !important;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* 모달 헤더 - KRDS 스타일 */
#recipeDetailModal .modal-header {
    padding: 8.5px 16px;
    background-color: var(--krds-color-light-gray-100);
    color: var(--krds-light-color-surface-white);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    border-radius: 0.6rem 0.6rem 0 0 !important;
    width: 100%;
}

#recipeDetailModal .modal-header.has-description {
    align-items: center;
    justify-content: flex-start;
    column-gap: 0.8rem;
}

#recipeDetailModal.ui-draggable .modal-header {
    cursor: grab;
}

#recipeDetailModal .modal-content > *:not(.btn-close) {
    width: 100%;
    margin: unset;
}

#recipeDetailModal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    padding: unset;
}

#recipeDetailModal .modal-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* 닫기 버튼 */
#recipeDetailModal .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: rgba(255, 255, 255, 0.6);
}

#recipeDetailModal .btn-close:hover {
    color: #fff;
}

/* box-area 스타일 */
#recipeDetailModal .box-area {
    border-radius: 8px;
}

#recipeDetailModal .box-area.contents-background-type {
    padding: 0;
    background: transparent;
}

#recipeDetailModal .box-area.bg-black {
    background-color: #000;
    padding: 12px;
    margin-top: 8px;
}

#recipeDetailModal .box-area.bg-gray2 {
    background-color: #33363d;
    padding: 12px;
    margin-top: 8px;
}

#recipeDetailModal .box-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#recipeDetailModal .box-inner.row {
    flex-direction: row;
    align-items: center;
}

/* box-tit 스타일 */
#recipeDetailModal .box-tit {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
}

#recipeDetailModal .box-tit.between {
    justify-content: space-between;
}

/* label 스타일 */
#recipeDetailModal .label.title-type {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

#recipeDetailModal .layer-depth2.full {
    width: 100%;
}

#recipeDetailModal .layer-depth2-item {
    padding: 8px 0;
}

#recipeDetailModal .layer-depth-box {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#recipeDetailModal .layer-depth-box-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#recipeDetailModal .layer-depth-box-item.between {
    justify-content: space-between;
}

#recipeDetailModal .layer-depth-box-item-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: normal;
}

#recipeDetailModal .layer-depth-box-item-title.regular {
    font-weight: 400;
}

#recipeDetailModal .layer-depth-box-item-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

/* description-wrapper 스타일 */
#recipeDetailModal .description-wrapper {
    margin-top: 12px;
}

#recipeDetailModal .description-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

#recipeDetailModal .description-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#recipeDetailModal .description-text {
    font-size: 13px;
    color: #fff;
}

#recipeDetailModal .description-text.bold {
    font-weight: 600;
}

#recipeDetailModal .description-text.gray {
    color: rgba(255, 255, 255, 0.6);
}

/* conts-area 스타일 */
#recipeDetailModal .conts-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 뱃지 스타일 */
#recipeDetailModal .krds-badge-wrap {
    display: flex;
    gap: 4px;
}

#recipeDetailModal .krds-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

#recipeDetailModal .krds-badge.bg-royal-light-blue {
    background-color: #3b82f6;
    color: #fff;
}

#recipeDetailModal .krds-badge.bg-light-gray-40 {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 이미지 영역 */
#recipeDetailModal .img-map-area {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}

/* ========================================
   기존 스타일 (유지)
   ======================================== */

/* 모달 컨텐츠 스크롤 영역 */
#recipeDetailModal .modal-conts {
    padding: 16px 20px !important;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* 썸네일 placeholder 스타일 */
.thumbnail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
}

.thumbnail-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
}

.thumbnail-placeholder p {
    font-size: 14px;
}

/* 썸네일 이미지 */
#recipeDetailModal .img-map-area img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* 빈 상태 메시지 */
.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: rgba(255, 255, 255, 0.4);
}

.empty-message i {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-message p {
    font-size: 14px;
}

/* 레이어 그룹 확장/축소 버튼 */
#recipeDetailModal .expand_btn .svg-icon {
    transition: transform 0.2s ease;
}

#recipeDetailModal .layer-group.is-expanded .expand_btn .svg-icon {
    transform: rotate(180deg);
}

/* layer-depth2 표시/숨김 전환 - 클래스 기반 제어 */
#recipeDetailModal .layer-group .layer-depth2 {
    display: none;
    transition: all 0.2s ease;
}

#recipeDetailModal .layer-group.is-open .layer-depth2 {
    display: block;
}

/* 색상 박스 스타일 */
.outline-color-box {
    width: 60px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    color: #fff;
    padding: 2px 4px;
}

.outline-color-box.max-width-type-1 {
    width: 80px;
}

/* 레이어 소스 표시 */
.layer-source {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.layer-source i {
    font-size: 11px;
}

/* 스크롤바 스타일 */
#recipeDetailModal .modal-conts::-webkit-scrollbar {
    width: 6px;
}

#recipeDetailModal .modal-conts::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#recipeDetailModal .modal-conts::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#recipeDetailModal .modal-conts::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* layer-group-wrapper - 콘텐츠에 맞게 자동 확장 */
#recipeDetailModal .layer-group-wrapper {
    /* max-height 제거로 자연스럽게 확장 */
    overflow-y: visible;
}

#recipeDetailModal .layer-group-wrapper::-webkit-scrollbar {
    width: 6px;
}

#recipeDetailModal .layer-group-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#recipeDetailModal .layer-group-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* 레이어 그룹 마진 조정 */
#recipeDetailModal .layer-group {
    margin-bottom: 8px;
}

#recipeDetailModal .layer-group:last-child {
    margin-bottom: 0;
}

/* 레이어 정보 항목 색상 보정 */
#recipeDetailModal .layer-depth-box-text {
    color: rgba(255, 255, 255, 0.9);
}

#recipeDetailModal .layer-depth-box-item-title {
    color: rgba(255, 255, 255, 0.6);
}

/* 뱃지 스타일 보정 */
#recipeDetailModal .krds-badge {
    font-size: 11px;
    padding: 2px 8px;
}

/* 하단 버튼 영역 */
#recipeDetailModal .modal-btn {
    padding: 12px 16px;
    background-color: rgba(0, 0, 0, 0.3);
}

/* SLD 다운로드 버튼 */
#recipeDetailModal .layer-depth2 .krds-btn.primary.small.full {
    margin-top: 8px;
}

/* 레이어 헤더 버튼 그룹 */
#recipeDetailModal .layer-button-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 레이어 헤더 레이블 */
#recipeDetailModal .layer-header-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* ellipsis 텍스트 */
#recipeDetailModal .ellipsis-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* label-title-type-area */
#recipeDetailModal .label-title-type-area {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* box-area 마진 조정 */
#recipeDetailModal .box-area.contents-background-type {
    margin-top: 12px;
}

#recipeDetailModal .box-area.contents-background-type:first-child {
    margin-top: 0;
}

#recipeDetailModal .box-area.bg-black:first-of-type {
    margin-top: 0;
}

/* layer-depth-button-group */
#recipeDetailModal .layer-depth-button-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

#thumbnailContainer {
    width: 100%;
}