/* BASIC css start */
/* [사용 안내]
   이 파일 전체를 서버에 업로드하고,
   이 파일을 사용하는 페이지의 <head> 안에 링크를 추가해주세요.
   폰트도 자동으로 로드됩니다.
*/
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* 기본 스타일 초기화 */
.engraving-checker-floating *, .engraving-checker-floating *:before, .engraving-checker-floating *:after,
.floating-checker-toggle-btn *, .floating-checker-toggle-btn *:before, .floating-checker-toggle-btn *:after {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', sans-serif;
    box-sizing: border-box;
}

/* ---------------------------------------------------- */
/* 플로팅 버튼 스타일 */
/* ---------------------------------------------------- */
.floating-checker-toggle-btn {
    position: fixed;
    left: 0px;
    top: 15%;
    transform: translateY(-50%);
    width: 170px;
    height: 90px;
    background-color: #8B0000;
    color: white;
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-out;
    z-index: 1000;
}
.floating-checker-toggle-btn:hover {
    transform: translateY(-50%) translateX(0px);
}
.floating-checker-toggle-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}
.floating-checker-toggle-btn span {
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
}
.floating-checker-toggle-btn.is-hidden {
    display: none;
}

/* ---------------------------------------------------- */
/* 플로팅 검색기 창 스타일 */
/* ---------------------------------------------------- */
.engraving-checker-floating {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 1001; /* 버튼보다 위로 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}
.engraving-checker-floating.is-active {
    opacity: 1;
    visibility: visible;
}

.engraving-checker-container {
    width: 90%;                 /* 화면 너비의 90% */
    max-width: 400px;           /* ★ 가로 사이즈 (최대 너비) */
    max-height: 640px;          /* ★ 세로 사이즈 (최대 높이) */
    background-color: #ffffff;
    border-radius: 0 20px 20px 0;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    overflow: hidden;
}

.engraving-checker-floating.is-active .engraving-checker-container {
    transform: translateX(0);
}

/* ---------------------------------------------------- */
/* 내부 요소 스타일 (글자 잘림 문제 해결) */
/* ---------------------------------------------------- */
.checker-header {
    padding: 25px 30px;
    background: linear-gradient(to right, #A52A2A, #8B0000);
    color: white;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}
.checker-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}
.checker-header p {
    font-size: 14px;
    opacity: 0.9;
}
.checker-header .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}
.checker-header .close-btn svg {
    width: 24px;
    height: 24px;
}

.checker-body {
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
    flex-shrink: 0;
}
#ring-search-input {
    width: 100%;
    height: 50px;
    padding: 0 20px 0 50px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}
#ring-search-input:focus {
    outline: none;
    border-color: #c0392b;
}
.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: #888;
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 340px; 
    overflow-y: auto; 
    padding-right: 8px;
}
#results-container::-webkit-scrollbar { width: 8px; }
#results-container::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 4px; }
#results-container::-webkit-scrollbar-track { background-color: #f0f0f0; }

.ring-card {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background-color: #fafafa;
    animation: fadeIn 0.5s forwards;
}

.ring-card img {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    margin-right: 15px;
    object-fit: cover;
    background-color: #eee;
    flex-shrink: 0;
}

.ring-info {
    flex-grow: 1;
    min-width: 0; /* ★★★ 추가: 글자 잘림 방지를 위한 핵심 코드 ★★★ */
}

.ring-info .name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 3px;
    white-space: normal; /* ★★★ 추가: 이름 길면 자동 줄바꿈 ★★★ */
    word-break: keep-all; /* ★★★ 추가: 단어 단위로 줄바꿈 ★★★ */
}

.ring-info .chars { font-size: 16px; font-weight: 500; color: #c0392b; margin-bottom: 3px; }
.ring-info .chars .label { font-size: 12px; color: #555; font-weight: 400; }
.ring-info .note {
    font-size: 12px;
    color: #666;
    background-color: #e9e9e9;
    padding: 2px 6px;
    border-radius: 5px;
    display: inline-block;
}

@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

.info-message {
    text-align: center; padding: 40px 20px; color: #777; background-color: #f9f9f9;
    border-radius: 12px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center;
}
.info-message h2 { font-size: 18px; margin-bottom: 10px; }
.info-message ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.info-message li { background-color: #e9e9e9; padding: 6px 12px; border-radius: 15px; font-size: 14px; cursor: pointer; transition: background-color 0.2s; }
.info-message li:hover { background-color: #dcdcdc; }

.checker-footer {
    background-color: #FFF8F8;
    padding: 15px 30px; /* ★★★ 위아래 여백을 15px로 줄였습니다. */
    border-top: 1px solid #FADCDC;
    flex-shrink: 0;
    max-height: 250px;
}
.checker-footer h2 { font-size: 18px; font-weight: 700; color: #A52A2A; text-align: center; margin-bottom: 15px; }
.checker-footer ul { list-style: none; padding: 0; font-size: 13px; color: #555; }
.checker-footer li { display: flex; align-items: flex-start; margin-bottom: 8px; line-height: 1.5; }
.checker-footer li:last-child { margin-bottom: 0; }
.checker-footer .icon { flex-shrink: 0; width: 18px; height: 18px; margin-right: 10px; margin-top: 2px; }
.checker-footer .warning { color: #c0392b; }

@media (min-width: 768px) {
    .engraving-checker-container {
        width: 420px; /* PC에서 너비 살짝 증가 */
        height: 100%;
        max-height: none;
        border-radius: 0 20px 20px 0;
    }
}


/* ★★★ 이 코드 전체를 CSS 파일 맨 아래에 추가해주세요 ★★★ */

/* X 버튼이 들어갈 공간 확보 및 돋보기 위치 조정 */
#ring-search-input {
    padding-right: 45px !important; /* X버튼 공간 확보 */
}

/* 돋보기 아이콘 위치 고정 */
.search-container .search-icon {
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
}

/* X 버튼 스타일 */
.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #ccc;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    visibility: hidden; /* 평소엔 숨김 */
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}

.clear-search-btn svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

/* 검색창에 글자가 있을 때만 X 버튼 보이게 */
.search-container.is-filled .clear-search-btn {
    visibility: visible;
    opacity: 1;
}}

/* BASIC css end */

