/* public/axial_sim.css */

/* SVG 시뮬레이션 레이어: 모멘트 원 등 요소가 잘리지 않도록 */
#simulation-layer {
    overflow: visible !important;
}

/* 텍스트 기본 스타일 */
text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none; /* 텍스트 선택 방지 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); /* 가독성 향상 */
}

/* ------------------------------------------- */
/* 애니메이션 (인장: 퍼짐 / 압축: 모임) */
/* ------------------------------------------- */

/* 점선 흐름 애니메이션 */
@keyframes axial-flow-tension { /* 인장: 중앙 -> 바깥 */
    0% { stroke-dashoffset: 0; opacity: 0.8; }
    50% { opacity: 1; }
    100% { stroke-dashoffset: -30; opacity: 0.8; } /* 음수: 오른쪽으로 이동 (퍼짐) */
}

@keyframes axial-flow-compression { /* 압축: 바깥 -> 중앙 */
    0% { stroke-dashoffset: 0; opacity: 0.8; }
    50% { opacity: 1; }
    100% { stroke-dashoffset: 30; opacity: 0.8; } /* 양수: 왼쪽으로 이동 (모임) */
}

/* 인장 (빨강): 중앙에서 바깥으로 퍼지는 애니메이션 */
.axial-flow-tension {
    animation: axial-flow-tension 1s linear infinite;
    stroke: #ff3b30; /* 빨강 */
    stroke-width: 4px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px #ff3b30);
}

text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
    user-select: none;
}

/* 압축 (파랑): 양 끝에서 중앙으로 모이는 애니메이션 */
.axial-flow-compression {
    animation: axial-flow-compression 1s linear infinite;
    stroke: #007aff; /* 파랑 */
    stroke-width: 4px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px #007aff);
}

/* 3D 원통형 부재의 기본 스타일 */
rect, ellipse {
    stroke: none; /* ✅ 테두리 제거 (JS에서 지정한 색상만 보이게 함) */
    /* 필요하다면 아주 연한 흰색 광택만 추가 */
    /* stroke: rgba(255, 255, 255, 0.2); */
}


/* 🍎 [Apple Style] FBD 토글 버튼 */
.apple-fbd-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 100;
    
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    display: flex;
    align-items: center;
    gap: 6px;
}

.apple-fbd-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

/* 활성화 상태 (파란불) */
.apple-fbd-btn.active {
    background: #007aff; /* Apple Blue */
    border-color: #007aff;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4);
}

.apple-fbd-btn::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s;
}

.apple-fbd-btn.active::before {
    background: #fff;
    box-shadow: 0 0 5px #fff;
}

/* 🔳 FBD 툴팁 컨테이너 */
#solid-fbd-tooltip {
    position: fixed;
    width: 320px;
    height: 340px; /* 정보가 많아서 조금 더 크게 */
    background: rgba(28, 28, 30, 0.95); /* 다크 모드 배경 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 99999;
    pointer-events: none;
    display: none;
    overflow: hidden;
    color: white;
    font-family: -apple-system, sans-serif;
    animation: fbd-pop-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fbd-pop-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* FBD 내부 텍스트 스타일 */
.fbd-info-text {
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.fbd-math-label {
    font-family: "Times New Roman", serif;
    font-style: italic;
    font-size: 16px;
}


/* ------------------------------------------- */
/* 🟡 Scan 모드 UI 스타일 (X-ray) */
/* ------------------------------------------- */

/* 스캔 버튼 (노란색/주황색) */
.sim-apple-btn.scan-active {
    background: #ffcc00; /* Apple Yellow */
    color: #000; /* 글자는 검정 */
    border-color: #ffcc00;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
}
.sim-apple-btn.scan-active .sim-btn-indicator {
    background: #000;
}

/* 스캔 레이저 선 (노란 실선) */
.scan-laser-line {
    stroke: #ffcc00;
    stroke-width: 2px;
    stroke-dasharray: 4 2; /* 점선 효과 */
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.8));
}

/* 스캔 교차점 (Dot) */
.scan-dot {
    fill: #ffcc00;
    stroke: #fff;
    stroke-width: 2px;
    r: 6px;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.8));
}

/* 1. 스캔 툴팁 (마우스 따라다니는 박스) */
#scan-tooltip {
    position: fixed;
    z-index: 99999;
    display: none;
    pointer-events: none; /* 마우스 통과 */
    
    /* Apple Glass Effect */
    background: rgba(30, 30, 30, 0.75); /* 반투명 검정 */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* 텍스트 스타일 */
    color: #fff;
    padding: 12px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    min-width: 140px;
    transform: translate(15px, 15px); /* 커서와 약간 띄움 */
}


/* 툴팁 내부: 구분선 */
.scan-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 8px 0;
}


/* 툴팁 내부: 라벨과 값 정렬 */
.scan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    line-height: 1.6;
    gap: 15px;
}


.scan-label {
    color: #8e8e93; /* Apple Gray */
    font-weight: 500;
}
.scan-value {
    color: #fff;
    font-weight: 600;
    font-feature-settings: "tnum"; /* 숫자 등간격 */
}
.scan-highlight {
    color: #ffcc00; /* 노란색 강조 */
}


/* 2. ⌨️ 거리 입력 박스 (고급형) */
#scan-input-container {
    position: fixed;
    display: none;
    z-index: 100000;
    
    /* Apple Glass Effect */
    background: rgba(44, 44, 46, 0.90);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    
    padding: 16px 20px;
    text-align: center;
    min-width: 200px;
    
    /* 애니메이션 */
    animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}


.scan-input-title {
    font-size: 13px;
    color: #aeaeb2;
    margin-bottom: 8px;
    font-weight: 500;
}


/* 입력 필드 스타일링 */
.scan-input-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s;
}

.scan-input-wrapper:focus-within {
    border-color: #ffcc00; /* 포커스시 노란색 */
}




.scan-input-field {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    width: 80px;
    text-align: right;
    outline: none;
    font-family: -apple-system, sans-serif;
}

/* 숫자 입력기 화살표 제거 */
.scan-input-field::-webkit-outer-spin-button,
.scan-input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scan-unit {
    font-size: 16px;
    font-weight: 600;
    color: #ffcc00;
}

.scan-hint {
    font-size: 11px;
    color: #636366;
    margin-top: 8px;
}


.scan-input-label {
    color: #aaa;
    font-size: 12px;
    margin-bottom: 4px;
    display: block;
}

/* 부재 마우스 커서: 스캔 모드일 때 */
.scan-mode-cursor {
    cursor: crosshair !important;
}


/* public/axial_sim.css - 맨 아래 추가 */

/* 평소에는 오버레이가 마우스 이벤트를 무시 (FBD 작동을 위해) */
#sim-scan-overlay-rect {
    pointer-events: none;
}

/* 스캔 모드(커서가 십자선)일 때만 오버레이가 마우스를 감지 */
svg.scan-mode-cursor #sim-scan-overlay-rect {
    pointer-events: all !important;
    cursor: crosshair;
}


/*  Axial FBD Premium Apple Style Overlay */
.fbd-premium-glass {
    background: rgba(28, 28, 30, 0.7) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    border: 0.5px solid rgba(255,255,255,0.12) !important;
    border-radius: 32px !important;
    padding: 28px !important;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8) !important;
    color: #FFFFFF !important;
    font-family: -apple-system, "SF Pro Display", sans-serif !important;
    pointer-events: none !important; /* 호버 끊김 방지 핵심 */
    display: flex;
    flex-direction: column;
}

.fbd-label-small {
    opacity: 0.4;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.fbd-value-text {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

.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%);
    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; }
.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; }




/*  Apple Style Action Confirm (Primary Blue) */
.apple-dialog-btn.primary {
    background: #007aff; /* Apple Blue */
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.apple-dialog-btn.primary:hover {
    background: #0063cc;
    transform: translateY(-1px);
}

/* 다이얼로그 내부 아이콘 강조용 (선택 사항) */
.apple-dialog-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

/*  Apple Style Success Confirm (Green Theme) */
.apple-dialog-btn.success {
    background: #34c759 !important; /* Apple Green */
    color: white !important;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3) !important;
}

.apple-dialog-btn.success:hover {
    background: #2da44e !important;
    transform: translateY(-1px);
}


/* 기본적으로 숨김 상태 */
.axial-properties-panel {
    display: none;
}

/* body나 컨테이너에 'axial-active' 같은 클래스가 있을 때만 표시 */
.axial-mode-active .axial-properties-panel {
    display: block;
}