/* 테이블 내부 다중 입력 필드 정렬 */
.cosmosfarm-input-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.cosmosfarm-input-group.flex-wrap { flex-wrap: wrap; }
.cosmosfarm-setting-sub-group { display: flex; align-items: center; gap: 8px; background: #fbfbfb; padding: 6px 12px; border: 1px solid #e1e1e1; border-radius: 4px; border-left: 3px solid #2271b1; }
.cosmosfarm-device-label { display: inline-block; padding: 3px 10px; background: #666; color: #fff; border-radius: 4px; font-size: 11px; font-weight: bold; min-width: 45px; text-align: center; }
.cosmosfarm-device-label.mobile { background: #d63638; }

/* 탭 스타일 보정 */
.nav-tab-wrapper { margin-bottom: 20px; }

/* 토글 스위치 */
.cosmosfarm-toggle-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cosmosfarm-toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
.cosmosfarm-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cosmosfarm-toggle-slider { position: absolute; inset: 0; background: #c3c4c7; border-radius: 999px; transition: background .2s ease; cursor: pointer; }
.cosmosfarm-toggle-slider::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform .2s ease; }
.cosmosfarm-toggle-switch input:checked + .cosmosfarm-toggle-slider { background: #2271b1; }
.cosmosfarm-toggle-switch input:checked + .cosmosfarm-toggle-slider::before { transform: translateX(22px); }
.cosmosfarm-toggle-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.cosmosfarm-toggle-state { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cosmosfarm-toggle-state.is-on { background: #e7f5ed; color: #1e8c45; }
.cosmosfarm-toggle-state.is-off { background: #fcf0f1; color: #d63638; }
.cosmosfarm-toggle-text { font-weight: 500; color: #1d2327; }

/* 클릭 통계 그래프 */
.cosmosfarm-statistics-container { margin-top: 10px; border: 1px solid #ccd0d4; border-radius: 4px; overflow: hidden; background: #fff; }
.cosmosfarm-progress-bg { background: #f1f1f1; border-radius: 10px; height: 10px; position: relative; width: 100%; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.cosmosfarm-progress-bar { background: linear-gradient(90deg, #2271b1, #3498db); height: 100%; border-radius: 10px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* 프리미엄 PC 브라우저 미리보기 */
.cosmosfarm-pc-frame { width: 560px; height: 380px; border: 1px solid #d1d1d1; border-radius: 8px; background: #fff; overflow: hidden; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.12); border-bottom: 2px solid #bbb; }
.cosmosfarm-pc-frame-header { height: 32px; background: linear-gradient(to bottom, #f9f9f9, #ececec); border-bottom: 1px solid #d1d1d1; display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.cosmosfarm-pc-frame-buttons { display: flex; gap: 6px; }
.cosmosfarm-pc-frame-buttons .btn { width: 11px; height: 11px; border-radius: 50%; opacity: 0.8; }
.cosmosfarm-pc-frame-buttons .close { background: #ff5f57; }
.cosmosfarm-pc-frame-buttons .minimize { background: #ffbd2e; }
.cosmosfarm-pc-frame-buttons .maximize { background: #28c940; }
.cosmosfarm-floating-menu-preview-box { width: 100%; height: calc(100% - 32px); position: relative; background: #fdfdfd; background-image: radial-gradient(#eee 1px, transparent 1px); background-size: 20px 20px; }

/* 프리미엄 모바일 스마트폰 미리보기 */
.cosmosfarm-floating-preview-mobile-frame { width: 240px; height: 480px; border: 10px solid #222; border-radius: 36px; background: #fff; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.2); overflow: hidden; border-bottom-width: 14px; }
.cosmosfarm-floating-mobile-top-bar { height: 28px; width: 100%; position: absolute; top: 0; left: 0; z-index: 10; display: flex; justify-content: center; }
.cosmosfarm-floating-mobile-speaker { width: 45px; height: 5px; background: #333; border-radius: 10px; margin-top: 10px; }
.cosmosfarm-floating-mobile-browser { width: 100%; height: 100%; padding-top: 28px; background: #fdfdfd; position: relative; background-image: radial-gradient(#eee 1px, transparent 1px); background-size: 15px 15px; }
.cosmosfarm-floating-preview-mobile-frame::after { content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 70px; height: 4px; background: #333; border-radius: 10px; }

/* 미리보기 아이콘 및 정보 배지 */
.cosmosfarm-floating-menu-preview-icon { position: absolute; width: 48px; height: 48px; background-color: #2271b1; background-image: url('../../images/icon-big.png'); background-size: contain; background-repeat: no-repeat; background-position: center; border-radius: 12px; cursor: move; box-shadow: 0 6px 16px rgba(0,0,0,0.15); z-index: 99; display: block !important; visibility: visible !important; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; border: 2px solid #fff; }
#cosmosfarm-floating-menu-icon { top: 50px; right: 20px; }
#cosmosfarm-floating-menu-icon-mobile { bottom: 50px; right: 20px; }

.cosmosfarm-floating-menu-preview-icon::after { content: attr(data-size); position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 20px; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.3); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 500; opacity: 0.9; }

/* 프론트엔드 플로팅 메뉴 기본 스타일 */
.cosmosfarm-floating-menu { position: fixed; z-index: 9999; }
.cosmosfarm-floating-menu .floating-menu-item { margin-bottom: 10px; line-height: 1; transition: transform 0.2s ease-in-out; }
.cosmosfarm-floating-menu .floating-menu-item:last-child { margin-bottom: 0; }
.cosmosfarm-floating-menu .floating-menu-item a { text-decoration: none; border: 0; display: block; }
.cosmosfarm-floating-menu .floating-menu-item img { transition: transform 0.2s ease-in-out; }
.cosmosfarm-floating-menu .floating-menu-item:hover { transform: scale(1.15); }

/* 애니메이션 */
@keyframes cosmosfarm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cosmosfarm-slide-up { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cosmosfarm-zoom-in { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

.cosmosfarm-animation-fade { animation: cosmosfarm-fade-in 0.4s ease-out forwards; }
.cosmosfarm-animation-slide-up { animation: cosmosfarm-slide-up 0.4s ease-out forwards; }
.cosmosfarm-animation-zoom-in { animation: cosmosfarm-zoom-in 0.4s ease-out forwards; }

/* 메뉴 관리 테이블 및 카드형 아이템 */
.cosmosfarm-floating-menu-table { border: none !important; box-shadow: none !important; background: transparent !important; margin-top: 15px !important; }
.cosmosfarm-floating-menu-table thead, .cosmosfarm-floating-menu-table tfoot { display: none; }
.cosmosfarm-floating-menu-table td { padding: 0 !important; border: none !important; }

.cosmosfarm-menu-item-td { padding-bottom: 20px !important; }
.cosmosfarm-menu-item-card { display: flex; align-items: center; background: #fff; border: 1px solid #e1e1e1; border-radius: 12px; padding: 24px; margin-bottom: 5px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); gap: 24px; position: relative; border-left: 5px solid #2271b1; }
.cosmosfarm-menu-item-card:hover { border-color: #2271b1; box-shadow: 0 8px 24px rgba(34, 113, 177, 0.12); transform: translateY(-2px); }

/* 정렬용 플레이스홀더 */
.ui-sortable-placeholder-card { background: #f0f0f0 !important; border: 2px dashed #ccc !important; border-radius: 12px !important; margin-bottom: 20px !important; visibility: visible !important; height: 140px !important; }

/* 드래그 핸들 */
.cosmosfarm-menu-item-handle { cursor: grab; color: #bbb; transition: color 0.2s; padding: 15px 5px; font-size: 20px; }
.cosmosfarm-menu-item-handle:hover { color: #2271b1; }
.cosmosfarm-menu-item-handle:active { cursor: grabbing; }

/* 이미지 설정 영역 */
.cosmosfarm-menu-item-images { display: flex; flex-direction: column; gap: 15px; flex: 1 1 350px; min-width: 0; }
.cosmosfarm-image-preview-group { display: flex; align-items: center; gap: 15px; }
.cosmosfarm-image-thumbnail { width: 56px; height: 56px; background: #f7f7f7; border-radius: 10px; display: flex; justify-content: center; align-items: center; overflow: hidden; border: 1px solid #eee; flex-shrink: 0; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.cosmosfarm-image-thumbnail img { max-width: 90%; max-height: 90%; object-fit: contain; border-radius: 4px; }
.cosmosfarm-image-controls { flex-grow: 1; display: flex; align-items: center; gap: 10px; }
.cosmosfarm-mini-label { background: #666; color: #fff; font-size: 9px; text-transform: uppercase; font-weight: 800; padding: 3px 8px; border-radius: 4px; min-width: 45px; text-align: center; }
.cosmosfarm-mini-label.mobile { background: #d63638; }
.cosmosfarm-image-controls input { flex-grow: 1; font-size: 13px !important; height: 36px !important; border-radius: 6px !important; border: 1px solid #ccd0d4 !important; }

/* 링크 및 세부 설정 */
.cosmosfarm-menu-item-details { flex: 2 1 450px; border-left: 1px solid #f0f0f0; padding-left: 24px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cosmosfarm-input-row { display: flex; flex-direction: column; gap: 12px; }
.cosmosfarm-input-row input { width: 100% !important; font-size: 14px !important; height: 40px !important; border-radius: 6px !important; border: 1px solid #ccd0d4 !important; padding: 0 12px !important; }
.cosmosfarm-input-row select { width: 100% !important; height: 40px !important; border-radius: 6px !important; border: 1px solid #8c8f94 !important; }
.cosmosfarm-menu-item-conditions { margin-top: 16px; padding-top: 16px; border-top: 1px solid #eef2f6; }
.cosmosfarm-menu-item-condition-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cosmosfarm-menu-item-condition-title { font-size: 13px; font-weight: 700; color: #1d2327; margin: 0; }
.cosmosfarm-menu-item-condition-toggle { font-size: 12px !important; text-decoration: none !important; display: flex !important; align-items: center; gap: 4px; padding: 2px 8px !important; background: #f0f0f1 !important; border-radius: 4px !important; color: #2271b1 !important; transition: all 0.2s; }
.cosmosfarm-menu-item-condition-toggle:hover { background: #e0e0e0 !important; }
.cosmosfarm-menu-item-condition-toggle .dashicons { font-size: 16px; width: 16px; height: 16px; transition: transform 0.2s; }
.is-open .cosmosfarm-menu-item-condition-toggle .dashicons { transform: rotate(180deg); }
.cosmosfarm-menu-item-condition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.cosmosfarm-menu-item-conditions:not(.is-open) .cosmosfarm-menu-item-condition-grid { display: none; }
.cosmosfarm-menu-item-conditions:not(.is-open) { padding-bottom: 0; }
.cosmosfarm-menu-item-condition-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; }
.cosmosfarm-menu-item-condition-box > label { display: block; font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 8px; }
.cosmosfarm-menu-item-condition-box > select,
.cosmosfarm-menu-item-condition-box > input { width: 100% !important; margin-bottom: 8px; }
.cosmosfarm-menu-item-page-selector { margin-bottom: 8px; }
.cosmosfarm-menu-item-page-search { width: 100% !important; margin-bottom: 8px; }
.cosmosfarm-menu-item-page-summary { font-size: 12px; color: #475569; margin-bottom: 8px; }
.cosmosfarm-menu-item-page-list { max-height: 180px; overflow-y: auto; border: 1px solid #dbe3ea; border-radius: 8px; background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cosmosfarm-menu-item-page-option { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.cosmosfarm-menu-item-page-option:hover { background: #f8fafc; }
.cosmosfarm-menu-item-page-option input { margin: 0 !important; }
.cosmosfarm-menu-item-role-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cosmosfarm-menu-item-role-option { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #dbe3ea; border-radius: 999px; background: #fff; font-size: 12px; cursor: pointer; }
.cosmosfarm-menu-item-role-option input { margin: 0 !important; }

/* 삭제 버튼 */
.cosmosfarm-menu-item-actions { padding-left: 15px; }
.button-link-delete { color: #d63638 !important; width: 44px !important; height: 44px !important; display: flex !important; justify-content: center !important; align-items: center !important; border: 1px solid #f8d7da !important; background: #fff !important; border-radius: 10px !important; box-shadow: none !important; transition: all 0.2s !important; }
.button-link-delete:hover { background: #d63638 !important; color: #fff !important; border-color: #d63638 !important; transform: scale(1.05); }

@media screen and (max-width: 800px) {
	.cosmosfarm-menu-item-card { flex-wrap: wrap; gap: 20px; }
	.cosmosfarm-menu-item-images { min-width: 100%; }
	.cosmosfarm-menu-item-details { border-left: none; padding-left: 0; width: 100%; min-width: 0; }
    .cosmosfarm-menu-item-condition-grid { grid-template-columns: 1fr; }
}
/* 표시 조건 탭 스타일 */
.cosmosfarm-display-mode-options { margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 15px; background: #f9f9f9; padding: 15px; border-radius: 8px; border: 1px solid #e5e5e5; }
.cosmosfarm-display-mode-options label { font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.cosmosfarm-display-mode-options label input { margin: 0 !important; }
.cosmosfarm-page-selection-container { margin-top: 15px; padding: 20px; background: #fff; border: 1px solid #dcdcde; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.cosmosfarm-page-list-scroll { max-height: 300px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; background: #fafafa; border-radius: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.cosmosfarm-page-item { display: flex; align-items: center; padding: 8px 12px; background: #fff; border: 1px solid #eee; border-radius: 6px; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.cosmosfarm-page-item:hover { background: #f0f6fb; border-color: #2271b1; }
.cosmosfarm-page-item input { margin-right: 12px !important; margin-top: 0 !important; }
.cosmosfarm-page-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* 사용자 역할 선택 스타일 */
.cosmosfarm-role-selection-container { margin-top: 10px; border: 1px solid #dcdcde; border-radius: 8px; background: #fff; padding: 15px; }
.cosmosfarm-role-actions { margin-bottom: 15px; display: flex; gap: 10px; border-bottom: 1px solid #eee; padding-bottom: 12px; }
.cosmosfarm-role-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cosmosfarm-role-item { display: flex; align-items: center; padding: 6px 12px; background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 20px; cursor: pointer; transition: all 0.2s; font-size: 13px; font-weight: 500; }
.cosmosfarm-role-item:hover { background: #eef2f7; border-color: #2271b1; }
.cosmosfarm-role-item input { margin-right: 8px !important; margin-top: 0 !important; }
.cosmosfarm-role-item span { color: #334155; }

/* 클릭 통계 스타일 */
.cosmosfarm-statistics-container { background: #fff; border: 1px solid #dcdcde; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.cosmosfarm-statistics-container table { border: none !important; border-radius: 0 !important; }
.cosmosfarm-statistics-container th { background: #f8f9fa !important; border-bottom: 2px solid #edf2f7 !important; padding: 15px 12px !important; font-weight: 700 !important; }
.cosmosfarm-statistics-container td { padding: 15px 12px !important; vertical-align: middle !important; border-bottom: 1px solid #f1f5f9 !important; }
.cosmosfarm-progress-bg { background: #f1f5f9; border-radius: 10px; height: 10px; width: 100%; overflow: hidden; margin-top: 8px; border: 1px solid #e2e8f0; }
.cosmosfarm-progress-bar { background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%); height: 100%; border-radius: 10px; transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3); }
.cosmosfarm-statistics-container tr:hover td { background-color: #fcfdff; }
.cosmosfarm-statistics-container .dashicons { vertical-align: middle; margin-right: 5px; color: #64748b; }

/* 도움말 및 설명 가이드 */
.cosmosfarm-help-guide { background: #f8fafc; border-left: 4px solid #3b82f6; padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 10px 0; font-size: 13px; color: #475569; line-height: 1.6; }
.cosmosfarm-help-guide strong { color: #1e293b; display: block; margin-bottom: 4px; font-size: 14px; }
