/* solid.css - 고체역학 전용 스타일 (정역학 디자인 100% 일치판) */

/* 1. 패널 전체 설정 */
#expert-panel-solid {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #1c1c1e; z-index: 10002;
    display: none; flex-direction: column; color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: appleSlideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    will-change: transform, opacity;
}

/* 2. 헤더 스타일 */
#expert-panel-solid .expert-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 25px; border-bottom: 1px solid #3a3a3c;
    background-color: #2c2c2e; flex-shrink: 0;
    position: relative !important; z-index: 5000 !important;
}
#expert-panel-solid .expert-title { margin: 0; font-size: 1.2rem; font-weight: 600; }
#expert-panel-solid .sub-title { color: #0a84ff; font-size: 0.9em; margin-left: 5px; }

/* 3. 탭 버튼 스타일 */
/* 1. 탭 컨테이너 (정역학의 .segmented-control 스타일 적용) */
#expert-panel-solid .expert-tabs {
    display: flex; 
    align-items: center;
    /* 정역학 패널과 동일한 배경색(#2c2c2e)과 테두리 */
    background-color: #2c2c2e; 
    padding: 3px; 
    border-radius: 8px; 
    border: 1px solid #3a3a3c;
    gap: 0; /* 버튼 사이 간격 제거 */
}
/* 2. 탭 버튼 기본 (비활성화 상태 스타일 강화) */
#expert-panel-solid .tab-btn {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    
    background: transparent; /* 비활성화는 배경 투명 */
    border: none; 
    border-radius: 6px;
    
    padding: 6px 16px; 
    min-width: 80px; 
    height: 32px;
    
    /* 🚨 [핵심] 비활성화 글자색을 더 어둡게 처리하여 대비 효과 상승 */
    color: #8e8e93; /* Apple System Gray (비활성화 느낌) */
    
    font-size: 13px; 
    font-weight: 500;
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); /* 부드러운 전환 */
}

/* 3. 탭 버튼 활성화 (활성화 상태 팝업 효과 강화) */
#expert-panel-solid .tab-btn.active {
    /* 🚨 [핵심] 배경색을 정역학 버튼과 완벽히 동일한 회색으로 설정 */
    background-color: #636366 !important; 
    
    /* 글자는 쨍한 흰색으로 */
    color: #ffffff !important; 
    
    font-weight: 600; /* 글자 두께감 */
    
    /* 입체감을 주는 그림자 추가 */
    box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1); 
    
    /* 미세하게 크기 키우기 (선택된 느낌) */
    transform: scale(1.02); 
}
/* 4. 마우스 호버 효과 (비활성화 버튼에 마우스 올렸을 때) */
#expert-panel-solid .tab-btn:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.08); /* 살짝 밝게 */
    color: #d1d1d6; /* 글자도 살짝 밝게 */
}

/* 4. 🚨 [신규] 헤더용 List 버튼 스타일 (Apple Style) */
#expert-panel-solid .apple-list-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 500;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}
#expert-panel-solid .apple-list-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
#expert-panel-solid .apple-list-btn.active {
    background: #0a84ff; /* 활성화 시 파란색 */
    border-color: #0a84ff;
    box-shadow: 0 0 10px rgba(10, 132, 255, 0.5);
}

/* 닫기 버튼 */
#expert-panel-solid .close-panel-btn {
    background-color: #ff3b30; color: white; border: none;
    width: 28px; height: 28px; border-radius: 6px; font-weight: bold; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
}

/* 5. 본문 영역 */
#expert-panel-solid .expert-body {
    flex: 1; display: flex; overflow: hidden; padding: 0; position: relative;
    width: 100%; height: 100%;
}
#expert-panel-solid .tab-content {
    width: 100%; height: 100%; display: none; position: relative;
}
#expert-panel-solid .tab-content.active { display: flex; }

/* 6. 내부 슬롯 (프리뷰, 도구함, 리스트) */
#solid-preview-slot {
    position: absolute !important; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}
#solid-preview-slot .expert-preview-container {
    border: none !important; background: transparent !important;
    border-radius: 0 !important; box-shadow: none !important;
    padding: 0 !important; width: 100% !important; height: 100% !important;
}
#solid-preview-slot .expert-preview-container h4 {
    position: absolute; top: 20px; right: 20px; z-index: 100;
    background: transparent; border: none; margin: 0; padding: 0; width: auto;
    display: flex; justify-content: flex-end;
}
#solid-preview-slot .expert-preview-container h4 > span:first-child { display: none !important; }
#solid-preview-slot .expert-preview-container h4 > div {
    background: rgba(28, 28, 30, 0.85); backdrop-filter: blur(10px);
    padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#solid-toolbar-slot {
    position: absolute; top: 20px; left: 20px; z-index: 100; width: 220px;
    max-height: calc(100% - 40px); display: flex; flex-direction: column;
}
#solid-toolbar-slot .expert-toolbar {
    width: 100%; height: auto; max-height: 100%;
    background-color: rgba(28, 28, 30, 0.85); backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); padding: 12px; gap: 15px;
    box-sizing: border-box; overflow-y: auto !important;
}
#solid-toolbar-slot .expert-toolbar::-webkit-scrollbar { display: none; }

/* 🚨 [핵심] 리스트 슬롯 위치 수정 (헤더 아래 우측) */
#solid-list-slot {
    position: absolute;
    top: 20px;  /* 80px -> 20px (헤더 바로 아래가 아니므로, 20px 여백으로 조정) */
    right: 20px;
    z-index: 200;
    display: none;
    flex-direction: column;
}
/* 리스트 컨테이너 디자인 */
#solid-list-slot .expert-list-container {
    width: 300px; height: 60vh; max-height: 600px;
    background-color: rgba(28, 28, 30, 0.9); backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 15px; box-sizing: border-box;
    display: flex; flex-direction: column; overflow: hidden;
}
#solid-list-slot .expert-list-container #expert-list-content {
    overflow-y: auto; flex: 1; padding-right: 5px;
}


/* solid.css - Bar Shape 패널 스타일 추가 */

/* Shape 카드 디자인 */
.shape-card {
    background-color: #3a3a3c;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, border-color 0.2s;
}

.shape-card:hover {
    transform: translateY(-2px);
    border-color: #007aff;
}

/* 제목 (Rect Bar 1 등) */
.shape-card-title {
    font-size: 11px;
    color: #cecece;
    font-weight: 600;
}

/* 아이콘 (CSS로 그림) */
.shape-icon {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 2px;
}
.shape-icon.rect { border-radius: 4px; } /* 사각형 */
.shape-icon.circ { border-radius: 50%; } /* 원형 */

/* A1 버튼 스타일 */
.shape-btn {
    background-color: #eef0f2;
    color: #007aff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.2s;
}
.shape-btn:hover {
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
}

/* 넘버링 배지 (카드 안의 파란 원) */
.shape-badge {
    background: #00bcd4;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px; 
    height: 16px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

/* solid.css 추가 */


/* 드래그 중일 때 커서 */
.is-dragging-bar {
    cursor: grabbing !important;
}


/* =========================================================
   🍎 [명륜이 업데이트] Bar Shape 패널 디자인 (프리뷰 창과 완벽 동기화)
   ========================================================= */

/* 1. Bar Shape 패널 본체 */
#solid-shape-panel {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important; /* 애플 모션 */
    max-height: 60vh; /* 펼쳐졌을 때 최대 높이 */
    
    /* 배경 및 테두리 (프리뷰 창과 100% 동일하게 맞춤) */
    background: rgba(30, 30, 32, 0.75) !important; /* 조금 더 투명하고 어둡게 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* 🚨 섬세한 테두리 (1px -> 0.5px) */
    border: 0.5px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 14px !important; /* 12px -> 14px */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* 2. 접혔을 때 */
#solid-shape-panel.collapsed {
    max-height: 42px !important; /* 헤더 높이(42px)에 딱 맞춤 */
}

/* 3. 헤더 (디자인 업그레이드) */
.shape-panel-header {
    flex-shrink: 0;
    padding: 12px 16px; /* 프리뷰 창과 동일한 패딩 */
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
    
    /* 폰트 및 정렬 (SF Pro 느낌) */
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    font-weight: 600;
    font-size: 13px;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.shape-panel-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 4. 리스트 영역 (스크롤 공간) */
#solid-shape-list {
    flex: 1;
    overflow-y: overlay !important; /* 내용 위에 스크롤바 띄움 */
    padding: 10px;
    scrollbar-gutter: stable; 
}

/* 5. 🍎 애플 스타일 스크롤바 (평소엔 투명) */
#solid-shape-list::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

#solid-shape-list::-webkit-scrollbar-track {
    background: transparent;
}

#solid-shape-list::-webkit-scrollbar-thumb {
    background-color: transparent; /* 평소엔 안 보임 */
    border-radius: 10px;
}

/* 마우스를 리스트에 올렸을 때만 스크롤바 등장 */
#solid-shape-list:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
}



/* 🚨 [명륜이 신규 추가] Properties Modal & Visual Styles */

/* 1. 팝업창 배경 (어두운 반투명) */
.solid-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    z-index: 99999; display: flex; justify-content: center; align-items: center;
    animation: fadeIn 0.2s ease-out;
}

/* 2. 팝업창 본체 */
.solid-modal-content {
    background: #1c1c1e; color: white;
    width: 400px; padding: 20px; border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center; font-family: -apple-system, sans-serif;
}

/* 3. 모드 선택 버튼 (Hole / Composite) */
.solid-mode-btn-group {
    display: flex; gap: 10px; justify-content: center; margin-bottom: 20px;
}
.solid-mode-btn {
    background: #3a3a3c; border: 1px solid #555; color: #aaa;
    padding: 8px 16px; border-radius: 20px; cursor: pointer; transition: 0.2s;
}
.solid-mode-btn.active {
    background: #007aff; color: white; border-color: #007aff; font-weight: bold;
}

/* 4. 시각화 영역 (검은 박스) */
.solid-visual-box {
    width: 100%; height: 250px; background: #000;
    border-radius: 12px; position: relative;
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 20px; border: 1px solid #333;
}

/* 5. 메인 형상 (Main Shape) */
.solid-shape-outer {
    background: #f2f2f7; /* 회색 고기 */
    position: relative; display: flex; justify-content: center; align-items: center;
    transition: all 0.3s ease;
}
.solid-shape-inner {
    position: absolute;
    transition: all 0.3s ease;
    display: flex; justify-content: center; align-items: center;
}

/* 6. 호버 존 (투명한 감지 영역) */
.hover-zone {
    position: absolute; background: rgba(0, 255, 0, 0.0); /* 평소엔 투명 */
    cursor: pointer; z-index: 10;
    transition: background 0.2s;
}
.hover-zone:hover {
    background: rgba(57, 255, 20, 0.3); /* 호버시 형광 초록 */
    border: 2px dashed #39ff14;
}

/* 7. 중앙 텍스트 (A1) */
.area-display-text {
    position: relative; z-index: 20;
    font-size: 24px; font-weight: 900; color: #007aff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}


/* 🚨 [명륜이 추가] Shape 패널 내 수정 버튼 스타일 */
.shape-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.shape-edit-btn:hover {
    background-color: rgba(255, 255, 255, 0.2); /* 호버 시 살짝 밝게 */
}

.shape-edit-btn img {
    width: 16px;
    height: 16px;
    filter: invert(1); /* 다크모드 배경이므로 아이콘을 흰색으로 반전 */
    opacity: 0.8;
}

.shape-edit-btn:hover img {
    opacity: 1.0; /* 호버 시 더 선명하게 */
}


/* 🚨 [명륜이 추가] Shape 패널 내 수정 버튼 스타일 */
.shape-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.shape-edit-btn:hover {
    background-color: rgba(255, 255, 255, 0.2); /* 호버 시 살짝 밝게 */
}

.shape-edit-btn img {
    width: 16px;
    height: 16px;
    filter: invert(1); /* 다크모드 배경이므로 아이콘을 흰색으로 반전 */
    opacity: 0.8;
}

.shape-edit-btn:hover img {
    opacity: 1.0; /* 호버 시 더 선명하게 */
}

/* 8. 리스트 수정 버튼 스타일 */
.list-edit-btn {
    background: none; border: none; cursor: pointer;
    width: 24px; height: 24px; padding: 2px;
    border-radius: 4px; transition: background 0.2s;
}
.list-edit-btn:hover { background: rgba(255,255,255,0.2); }
.list-edit-btn img { width: 100%; height: 100%; filter: invert(1); }



/* 🚨 [명륜이 수정] 수정 버튼(연필) 아이콘 전용 스타일 */

/* 1. 패널(왼쪽)과 리스트(오른쪽)의 수정 버튼 공통 설정 */
.shape-edit-btn, .list-edit-btn {
    background-color: transparent !important; /* 🔥 배경 투명화 (핵심) */
    border: none !important;                 /* 🔥 테두리 제거 */
    box-shadow: none !important;             /* 🔥 그림자 제거 */
    padding: 4px !important;                 /* 클릭하기 좋게 여백 */
    cursor: pointer;
    
    /* 아이콘 중앙 정렬 */
    display: flex !important;
    align-items: center;
    justify-content: center;
    
    transition: transform 0.2s ease, opacity 0.2s;
    opacity: 0.7; /* 평소엔 살짝 흐리게 */
}

/* 2. 마우스 올렸을 때 효과 */
.shape-edit-btn:hover, .list-edit-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important; /* 호버 시 아주 연한 흰색 배경 */
    border-radius: 4px;
    transform: scale(1.1); /* 살짝 커짐 */
    opacity: 1.0; /* 선명하게 */
}

/* 3. 내부 이미지(아이콘) 스타일 */
.shape-edit-btn img, .list-edit-btn img {
    width: 18px !important;    /* 아이콘 크기 고정 */
    height: 18px !important;
    object-fit: contain;
    filter: invert(1);         /* 🔥 다크모드라서 흰색으로 반전 (검은 아이콘일 경우) */
    display: block;            /* 이미지 하단 여백 제거 */
    margin: 0 !important;
}


/* 🚨 [명륜이 수정] 패널 너비 확장 (기존 160px -> 200px) */
#solid-shape-panel {
    width: 200px !important; /* 1.2배 확장 */
}

/* 🚨 [명륜이 신규] Properties 팝업 - 애플 스타일 아이콘 버튼 */
.solid-mode-icon-group {
    display: flex;
    justify-content: center;
    gap: 20px; /* 버튼 사이 간격 넉넉하게 */
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05); /* 버튼 그룹 배경 살짝 */
    padding: 10px;
    border-radius: 16px;
}

.solid-mode-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px; /* 둥근 사각형 (애플 앱 아이콘 느낌) */
    background-color: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.solid-mode-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 이미지가 버튼에 꽉 차게 */
    opacity: 0.6; /* 평소엔 살짝 어둡게 */
    transition: opacity 0.2s;
}

/* 호버 효과 */
.solid-mode-icon-btn:hover {
    transform: translateY(-2px);
    background-color: #3a3a3c;
}
.solid-mode-icon-btn:hover img {
    opacity: 1.0;
}

/* 활성화(Active) 상태 - 파란색 테두리와 빛 */
.solid-mode-icon-btn.active {
    border: 2px solid #0a84ff; /* 애플 블루 */
    box-shadow: 0 0 15px rgba(10, 132, 255, 0.4);
    transform: scale(1.05);
}
.solid-mode-icon-btn.active img {
    opacity: 1.0;
}

/* 라벨 (Hole, Composite 글자) - 아이콘 아래 작게 표시 */
.solid-mode-icon-btn::after {
    content: attr(data-label);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #aaa;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}
.solid-mode-icon-btn:hover::after {
    opacity: 1;
}



/* 🚨 [명륜이 수정] 호버 효과 제거 및 스타일 정돈 */

/* 1. 호버 존 형광 효과 제거 (투명하게 유지) */
.hover-zone {
    /* 기존의 형광색 border/background 제거 */
    background: transparent !important; 
    border: none !important;
    cursor: pointer; 
}
.hover-zone:hover {
    background: rgba(255, 255, 255, 0.05) !important; /* 아주 살짝만 밝게 */
    border: none !important;
}

/* 2. 버튼 그룹 간격 조정 (버튼이 4개가 되므로) */
.solid-mode-icon-group {
    display: flex;
    justify-content: center;
    gap: 15px; /* 간격 살짝 좁힘 */
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 16px;
}

/* 3. 아이콘 버튼 스타일 (유지) */
.solid-mode-icon-btn {
    width: 50px; height: 50px;
    border-radius: 12px;
    background-color: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.solid-mode-icon-btn.active {
    border: 2px solid #0a84ff;
    box-shadow: 0 0 10px rgba(10, 132, 255, 0.3);
}


/* 🚨 [명륜이 업데이트] Properties 모달 - 좌우 분할 및 입력폼 스타일 */

/* 1. 모달 크기 확장 (입력창 공간 확보) */
.solid-modal-content {
    width: 650px !important; /* 가로로 넓게 */
    padding: 30px !important;
    display: flex;
    flex-direction: column;
}

/* 2. 메인 컨텐츠 영역 (좌: 시각화 / 우: 입력폼) */
.solid-content-split {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch; /* 높이 맞춤 */
}

/* 3. 왼쪽: 시각화 박스 (고기) */
.solid-visual-box {
    flex: 1; /* 1:1 비율 or 조정 가능 */
    min-width: 300px;
    height: 320px;
    background: #000;
    border: 1px solid #333;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0 !important; /* 기존 마진 제거 */
}

/* 4. 오른쪽: 입력 폼 영역 (레시피) */
.solid-input-panel {
    flex: 0.8; /* 시각화보다 살짝 좁게 */
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
}

/* 5. 입력 그룹 (라벨 + 인풋) */
.apple-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.apple-input-label {
    font-size: 12px;
    color: #86868b; /* 애플 그레이 */
    font-weight: 600;
    margin-left: 2px;
}

/* 수식(Math) 폰트 스타일 */
.math-label {
    font-family: "Times New Roman", serif;
    font-style: italic;
    font-size: 14px;
    margin-right: 5px;
    color: #fff;
}

.apple-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.apple-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #0a84ff; /* 애플 블루 */
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

/* 단위 표시 */
.unit-label {
    font-size: 11px;
    color: #666;
    float: right;
    margin-top: -28px;
    margin-right: 10px;
    pointer-events: none;
}

/* 🚨 [명륜이 수정] 입력창 스크롤 & 치수선 오버레이 */

/* 1. 입력 패널 스크롤 처리 */
.solid-input-panel {
    flex: 0.8;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    
    /* 스크롤 핵심 */
    max-height: 320px; /* 시각화 박스 높이와 맞춤 */
    overflow-y: auto;  /* 넘치면 스크롤 */
    display: block;    /* flex 대신 block으로 변경하여 스크롤 원활하게 */
}

/* 2. 스크롤바 디자인 (애플 스타일) */
.solid-input-panel::-webkit-scrollbar { width: 8px; }
.solid-input-panel::-webkit-scrollbar-track { background: transparent; }
.solid-input-panel::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.solid-input-panel::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.4); }

/* 3. 입력 그룹 간격 (스크롤 내부) */
.apple-input-group {
    margin-bottom: 12px; /* 간격 확보 */
}

/* 4. 치수선 오버레이 (SVG) */
.solid-dimension-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50; /* 도형보다 위에 그림 */
    pointer-events: none; /* 마우스는 통과 */
}

/* 치수 텍스트 스타일 */
.dim-text {
    font-family: "Times New Roman", serif;
    font-style: italic;
    fill: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}


/* 🚨 [명륜이 수정] LaTeX 스타일 폰트 및 정렬 보정 */

/* 1. LaTeX 수식 느낌 (Times New Roman + Italic) */
.latex-font {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-weight: normal;
}
.latex-sub {
    font-size: 0.8em;
    vertical-align: sub;
    font-style: normal; /* 숫자는 기울이지 않음 */
}

/* 2. SVG 치수 텍스트 정렬 (가운데 정렬 필수!) */
.dim-text {
    font-family: "Times New Roman", serif;
    font-weight: bold;
    fill: #fff;
    font-size: 16px; /* 글자 좀 더 키움 */
    text-shadow: 0 0 4px #000; /* 검은 테두리로 가독성 확보 */
    dominant-baseline: central; /* 세로 중앙 정렬 */
    text-anchor: middle;        /* 가로 중앙 정렬 (핵심!) */
}

/* 🚨 [명륜이 수정] 치수 텍스트 초정밀 중앙 정렬 */

.dim-text {
    font-family: "Times New Roman", serif;
    font-weight: bold;
    fill: #fff;
    font-size: 15px;
    text-shadow: 0 0 3px #000; /* 가독성 확보 */
    
    /* 🔥 핵심: 글자 중심축 보정 */
    dominant-baseline: central; /* 세로 중앙 */
    text-anchor: middle;        /* 가로 중앙 */
    pointer-events: none;       /* 마우스 통과 */
}



/* 🚨 [명륜이 추가] 입력 완료 상태 (Green Light) & 미니 아이콘 */

/* 1. 데이터 입력 완료된 카드 (Ready State) */
.shape-card.ready {
    border: 1px solid #34c759 !important; /* 애플 그린 테두리 */
    background: rgba(52, 199, 89, 0.1) !important; /* 연한 초록 배경 */
    box-shadow: 0 0 10px rgba(52, 199, 89, 0.2);
    transition: all 0.3s ease;
}

/* 2. 미니 쉐이프 프리뷰 (이미지 대신 CSS로 그림) */
.mini-shape-preview {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    background: #555; /* 기본 Solid 색상 */
    box-sizing: border-box;
}

/* 2-1. 형태별 스타일 */
.mini-shape-preview.circle { border-radius: 50%; }
.mini-shape-preview.rect { border-radius: 2px; }

/* 2-2. 모드별 스타일 (Hole / Composite) */
.mini-shape-preview.hole {
    background: #333; /* 배경 어둡게 */
    border: 3px solid #ccc; /* 테두리만 밝게 (중공 느낌) */
}
.mini-shape-preview.composite {
    background: #555;
    border: 3px solid #999; /* 복합재 느낌 (투톤) */
}
.mini-shape-preview.composite3 {
    background: #444;
    border: 3px solid #888;
    box-shadow: inset 0 0 0 2px #aaa; /* 3중 느낌 */
}


/* 🚨 [명륜이 리뉴얼] 입력 완료(Ready) 상태 - 애플 스타일 */

.shape-card.ready {
    /* 1. 테두리: 아주 얇고 반투명한 그린 */
    border: 1px solid rgba(52, 199, 89, 0.5) !important; 
    
    /* 2. 배경: 거의 투명하지만, 아주 살짝 그라데이션으로 깊이감 추가 */
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    
    /* 3. 그림자: 은은하게 퍼지는 초록빛 (Glow) */
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.15) !important;
    
    /* 4. 애니메이션: 부드럽게 전환 */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 완료된 상태의 텍스트 색상 조금 더 밝게 */
.shape-card.ready .shape-card-title {
    color: #fff !important;
    text-shadow: 0 0 5px rgba(52, 199, 89, 0.3);
}

/* 🚨 [명륜이 수정] 애플 스타일 3D 바 디자인 */

/* 1. 기본 바 그룹 스타일 */
.solid-bar-group {
    transition: filter 0.3s ease, opacity 0.3s ease;
       /* ✅ 수정: 맑은 파란색 그림자 (Deep Sky Blue Shadow) */
    filter: drop-shadow(0 4px 10px rgba(10, 132, 255, 0.25)); 
}

/* 2. 선택/호버 시 네온 글로우 효과 (사장님 이미지 스타일) */
.solid-bar-group:hover, .solid-bar-group.active {
    filter: drop-shadow(0 0 12px rgba(0, 122, 255, 0.6)) brightness(1.1); /* 애플 블루 글로우 */
    cursor: grab;
}



/* 🚨 [명륜이 추가] 필렛 결합을 위한 부드러운 선 처리 */
.solid-bar-group path, 
.solid-bar-group ellipse {
    stroke-linejoin: round; /* 선이 만나는 지점을 둥글게 */
    stroke-linecap: round;
    transition: all 0.3s ease; /* 모양 변할 때 부드러운 애니메이션 */
}

/* 3D 필렛 느낌을 살리기 위해 하이라이트 효과 강화 */
#solid-grad-cylinder stop[offset="50%"] {
    stop-color: #ffffff; /* 중앙 빛 반사광을 더 밝게 하여 금속 질감 강조 */
    stop-opacity: 0.5;
}






/* LaTeX 텍스트 및 화살표 스타일 */
.solid-dim-text {
    font-family: "Times New Roman", serif;
    font-style: italic;
    font-weight: bold;
    fill: #ffffff;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0,0,0,1); /* 가독성을 위한 그림자 */
    pointer-events: none;
}

.solid-dim-arrow-line {
    stroke: #ffffff;
    stroke-width: 1.5;
    stroke-linecap: round;
    pointer-events: none;
}

/* ✅ [안전한 코드] 색상은 건드리지 않고, 클릭 손가락 모양만 활성화 */
.bar-side, .cyl-body {
    cursor: pointer !important; /* 손가락 커서 */
    pointer-events: auto !important; /* 클릭 감지 허용 */
}


/* 레이어 제어용 강제 스타일 */
#solid-layer-axial[style*="display: none"],
#solid-layer-torsion[style*="display: none"],
#solid-layer-bending[style*="display: none"],
#solid-layer-tensor[style*="display: none"] {
    display: none !important; /* JS가 숨기라고 하면 무조건 숨김 */
}


/* 에러 발생 시 붉게 깜빡임 */
@keyframes errorPulse {
    0% { filter: drop-shadow(0 0 0 rgba(255, 59, 48, 0)); }
    50% { filter: drop-shadow(0 0 15px rgba(255, 59, 48, 1)); }
    100% { filter: drop-shadow(0 0 0 rgba(255, 59, 48, 0)); }
}

.error-blink {
    animation: errorPulse 0.5s ease-in-out 3; /* 3번 깜빡임 */
}

/* 준비 완료된 리스트 아이템의 파란 띠 효과 */
.solid-list-item.list-ready {
    border-color: #0a84ff !important;
    box-shadow: 0 0 12px rgba(10, 132, 255, 0.15);
}


/* solid.css 맨 마지막에 추가 */

/* Three.js 3D Viewer Modal Style */
#threejs-container canvas {
    display: block; /* 캔버스 하단 여백 제거 */
    width: 100% !important;
    height: 100% !important;
    outline: none;
}



/* [solid.css] 🚨 [명륜이 수정] Axial 좌표점 형광 반짝임 */
@keyframes axialFluorescentBlink {
    0%, 100% { filter: drop-shadow(0 0 2px #fff) brightness(1); }
    50% { filter: drop-shadow(0 0 15px #0a84ff) brightness(2); }
}

.node-blink-axial {
    animation: axialFluorescentBlink 1s infinite ease-in-out !important;
}


/* =========================================================
   🍎 [명륜이 추가] 리스트 패널 스크롤바 (애플 스타일 적용)
   ========================================================= */

/* 1. 리스트 내부 스크롤 영역 설정 */
#solid-list-content {
    overflow-y: overlay !important; /* 스크롤바가 내용 위에 뜸 (공간 차지 X) */
    scrollbar-gutter: stable;       /* 레이아웃 밀림 방지 */
    padding-right: 4px;             /* 우측 여백 살짝 */
}

/* 2. 스크롤바 전체 너비 및 투명 배경 */
#solid-list-content::-webkit-scrollbar {
    width: 6px;                 /* 얇게 설정 */
    background: transparent;    /* 배경 투명 */
}

/* 3. 스크롤바 트랙 (기둥) 숨김 */
#solid-list-content::-webkit-scrollbar-track {
    background: transparent;
}

/* 4. 스크롤바 핸들 (움직이는 막대) - 평소엔 투명 */
#solid-list-content::-webkit-scrollbar-thumb {
    background-color: transparent; 
    border-radius: 10px;        /* 둥근 모서리 */
    transition: background-color 0.3s;
}

/* 5. 🔥 [핵심] 마우스를 올렸을 때만 스크롤바 등장 */
#solid-list-content:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3); /* 반투명 흰색 */
}

/* 6. 스크롤바 핸들 클릭/드래그 시 조금 더 진하게 */
#solid-list-content::-webkit-scrollbar-thumb:active {
    background-color: rgba(255, 255, 255, 0.5);
}


/*  Apple Style Premium Dialog Overlay */
#apple-dialog-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000000; opacity: 0; transition: opacity 0.3s ease;
}

/* 다이얼로그 카드 */
.apple-dialog-card {
    width: 320px; background: rgba(30, 30, 32, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px; padding: 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.2, 1, 0.2, 1);
    text-align: center; color: white; font-family: -apple-system, sans-serif;
}

/* 텍스트 스타일 */
.apple-dialog-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.apple-dialog-msg { font-size: 14px; font-weight: 400; opacity: 0.7; line-height: 1.5; margin-bottom: 24px; white-space: pre-line; }

/* 버튼 그룹 */
.apple-dialog-buttons { display: flex; gap: 12px; }
.apple-dialog-btn {
    flex: 1; padding: 12px; border-radius: 12px; border: none;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.apple-dialog-btn.cancel { background: rgba(255, 255, 255, 0.1); color: white; }
.apple-dialog-btn.confirm { background: #ff3b30; color: white; } /* 경고 의미의 Red */
.apple-dialog-btn:active { opacity: 0.7; transform: scale(0.96); }

/* 활성화 상태 */
#apple-dialog-overlay.active { opacity: 1; }
#apple-dialog-overlay.active .apple-dialog-card { transform: scale(1); }



/*  Casual Delete Popover (애플 스타일 리스트 전용) */
.delete-confirm-popover {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(44, 44, 46, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    animation: casual-pop 0.2s cubic-bezier(0.2, 1, 0.2, 1);
}

@keyframes casual-pop {
    from { opacity: 0; transform: translateY(-50%) scale(0.8) translateX(10px); }
    to { opacity: 1; transform: translateY(-50%) scale(1) translateX(0); }
}

/* 팝오버 내부 버튼 */
.casual-confirm-btn {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.casual-confirm-btn:hover { background: #ff453a; }

.casual-cancel-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}
.casual-cancel-btn:hover { color: #fff; }


/* solid.css */

/* 부재 내부 선 색상을 연하게 조정하여 깔끔한 느낌 주기 */
.solid-bar-group path, 
.solid-bar-group ellipse {
    stroke: rgba(75, 122, 143, 0.5) !important; /* 진한 회색 대신 은은한 청회색 */
    stroke-width: 0.5px !important;
}

/* 3. 내부 선(Stroke)을 더 얇고 세련되게 */
.solid-bar-group path, .solid-bar-group ellipse {
    stroke-width: 0.5px !important; /* 아주 얇게 */
    /* ❌ 기존: rgba(0, 0, 0, 0.4) -> 회색 테두리의 원인 */
    /* ✅ 수정: 반투명한 흰색 (유리/얼음 같은 맑은 테두리) */
    stroke: rgba(255, 255, 255, 0.6) !important; 
}

/* 🚨 [명륜이 추가] 3D 접합부 자연스러운 마감 */
.solid-bar-group path {
    /* ❌ 기존: rgba(0, 0, 0, 0.2) -> 탁한 느낌 */
    /* ✅ 수정: 아주 연한 흰색으로 경계면만 살짝 표현 */
    stroke: rgba(255, 255, 255, 0.3) !important; 
    stroke-width: 0.5px !important;
}





/* ========================================================= */
/* 🎨 [우측 배치] 풀이 제외 옵션 박스 디자인 */
/* ========================================================= */
.analysis-option-box {
    /* 1. 배치: 절대 위치로 오른쪽 끝에 고정 */
    position: absolute;
    right: 20px;       /* 오른쪽에서 20px 떨어짐 */
    top: 50%;          /* 세로 중앙 */
    transform: translateY(-50%); /* 정확한 중앙 정렬 */
    
    /* 2. 숨김 상태 (기본값) */
    display: none;     /* JS가 'flex'로 바꿔줄 때까지 숨김 */
    opacity: 0;
    
    /* 3. 디자인 (남색 박스) */
    background-color: rgba(0, 20, 60, 0.6); /* 반투명 남색 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    
    /* 4. 내용 정렬 */
    align-items: center;
    gap: 8px;
    z-index: 20000;    /* 버튼 글자보다 위에 오게 */
    
    /* 5. 애니메이션 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* JS가 이 클래스를 붙이면 나타납니다 */
.analysis-option-box.show {
    display: flex !important;
    opacity: 1 !important;
    animation: popIn 0.4s forwards;
}

/* 등장 애니메이션 */
@keyframes popIn {
    0% { transform: translateY(-50%) scale(0.8); opacity: 0; }
    100% { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* 텍스트 스타일 */
.analysis-option-box label {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap; /* 줄바꿈 금지 */
    user-select: none;   /* 드래그 방지 */
}

/* 체크박스 스타일 */
.analysis-option-box input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #ffcc00; /* 체크 시 노란색 */
}

/* 마우스 올렸을 때 */
.analysis-option-box:hover {
    background-color: rgba(0, 20, 60, 0.9); /* 좀 더 진해짐 */
    border-color: #ffcc00; /* 테두리 노란색 */
}



/* ── Mobile Layout: solid.html ── */
html.phone .ui-panel,
html.tablet .ui-panel {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    top: 0 !important;
}

html.phone .mode-selector,
html.tablet .mode-selector {
    flex-wrap: wrap;
    gap: 6px;
}

html.phone .mode-btn,
html.tablet .mode-btn {
    min-height: 44px;
    font-size: 13px !important;
    flex: 1;
    min-width: 80px;
}

html.phone .mode-btn:active,
html.tablet .mode-btn:active {
    opacity: 0.7;
}

html.phone textarea,
html.tablet textarea {
    font-size: 16px !important;
}

html.phone input,
html.tablet input {
    font-size: 16px !important;
}
