/* ============================================================================
 * secad-mobile.css — SECAD Enterprise 모바일 & 태블릿 반응형 스타일시트
 * Apple Human Interface Guidelines & Material Design 모바일 터치 최적화
 * ==========================================================================*/

/* 모바일 뷰포트 기본 리셋 & Safe Area 대응 */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

@media (max-width: 768px) {
  /* 상단 클래식 메뉴바 축소 */
  #cad-classic-menubar {
    display: none !important;
  }

  /* 상단 메인 헤더: 모바일 컴팩트 패밀리룩 */
  #secad-classic-topbar {
    height: 44px !important;
    padding: 0 8px !important;
  }
  .se-family-switcher {
    gap: 2px !important;
    padding: 1px 2px !important;
  }
  .se-family-pill {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }
  .se-family-pill small {
    display: none !important;
  }

  /* 리본 탭 바: 가로 터치 스와이프 스크롤 */
  #secad-ribbon-tabs-bar {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    height: 34px !important;
  }
  #secad-ribbon-tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .secad-tab-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }

  /* 리본 패널: 모바일 접이식 가로 스와이프 */
  #secad-panels-viewport {
    height: auto !important;
    max-height: 84px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 4px 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .secad-panel-page.active {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    width: max-content !important;
  }
  .secad-group {
    padding: 2px 6px 14px 6px !important;
    margin-right: 4px !important;
  }
  .secad-group-title {
    font-size: 9px !important;
    bottom: 1px !important;
  }
  .cad-btn-big {
    width: 48px !important;
    height: 52px !important;
    padding: 2px !important;
    font-size: 9px !important;
  }
  .cad-btn-big i {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }
  .cad-btn-small {
    padding: 2px 4px !important;
    font-size: 9px !important;
    height: 24px !important;
  }

  /* 좌우 사이드 패널 (트리/속성창): 모바일에서는 오버레이 드로어로 전환 */
  #tree-panel, #prop-panel {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 80 !important;
    box-shadow: 0 0 30px rgba(0,0,0,0.8) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  #tree-panel {
    left: 0 !important;
    width: 260px !important;
    transform: translateX(-100%);
  }
  #tree-panel.mobile-open {
    transform: translateX(0) !important;
  }
  #prop-panel {
    right: 0 !important;
    width: 260px !important;
    transform: translateX(100%);
  }
  #prop-panel.mobile-open {
    transform: translateX(0) !important;
  }

  /* 하단 프레임 / 상태바 축소 */
  #secad-status-bar {
    height: 22px !important;
    font-size: 9.5px !important;
    padding: 0 6px !important;
  }
  #sb-coord, #sb-sel-count {
    display: none !important;
  }

  /* 하단 심플 아이콘 HUD 바: 모바일 하단 내비게이션 바 (Thumb Dock) */
  #bim-quick-hud-bar {
    bottom: calc(6px + var(--safe-bottom)) !important;
    left: 8px !important;
    right: 8px !important;
    transform: none !important;
    justify-content: space-around !important;
    padding: 4px 6px !important;
    border-radius: 20px !important;
    background: rgba(13, 17, 23, 0.94) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }
  .btn-hud-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }

  /* 모달 창: 모바일 바텀 시트 (Bottom Sheet) 100vw 최적화 */
  .samples-box,
  #modal-2d-to-3d-studio > div,
  #modal-bim-cad-drawings > div,
  #modal-bim-verification > div,
  #secad-manual-modal > div {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    border-radius: 16px 16px 0 0 !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
  }
  .secad-manual-layout {
    flex-direction: column !important;
  }
  .secad-manual-layout aside {
    width: 100% !important;
    height: 140px !important;
    border-right: none !important;
    border-bottom: 1px solid #1e293b !important;
  }
}
