/* Gems Creator & Editor View Custom Style Sheet */

/* ═══════════════════════════════════════════════
   0. Split-Viewport Card & Layout
   ═══════════════════════════════════════════════ */

/* 전체 카드: #gem-editor-view 내부를 가득 채움 */
.gem-editor-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 헤더 바 */
.gem-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.ge-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ge-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ge-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

/* 취소 버튼 (투명 pill) */
.gemini-pill-btn.text-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.gemini-pill-btn.text-btn:hover {
    background: var(--sidebar-active-bg);
    opacity: 1;
    transform: none;
}

/* 바디: 좌/우 패널 2분할 */
.gem-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ─── 좌측 설정 패널 ─── */
.gem-editor-left-panel {
    width: 50%;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ─── 우측 프리뷰 패널 ─── */
.gem-editor-right-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
}

/* ═══════════════════════════════════════════════
   1. Form Groups (좌측 패널)
   ═══════════════════════════════════════════════ */

.ge-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.ge-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.ge-form-group input[type="text"],
.ge-form-group textarea {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.ge-form-group input[type="text"]:focus,
.ge-form-group textarea:focus {
    border-color: rgba(161, 121, 255, 0.5);
    background: var(--card-hover);
}

.ge-form-group textarea {
    min-height: 160px;
    line-height: 1.6;
}

/* 레이블 + 우측 버튼 래퍼 */
.ge-label-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ge-limit-label {
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.7;
}

/* 파일 업로더 */
.ge-file-uploader {
    margin-top: 4px;
}

.ge-upload-trigger {
    background: var(--glass-bg);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 13px;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.ge-upload-trigger:hover {
    background: var(--card-hover);
    border-color: var(--text-secondary);
    color: var(--text-main);
}

/* 첨부 파일 칩 (.ge-file-chip: HTML 직접 사용 / .ge-chip: JS 동적 생성) */
.ge-attached-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ge-file-chip,
.ge-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--text-main);
}

.ge-file-chip button,
.ge-chip-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0 2px;
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 1;
    transition: color 0.15s;
}

.ge-file-chip button:hover,
.ge-chip-remove:hover {
    color: var(--text-main);
}

/* 폼 힌트 가이드 */
.ge-form-hint {
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.8;
    margin-top: 2px;
}

/* 지침 컨트롤바 */
.ge-instructions-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.ge-undo-redo-group {
    display: flex;
    gap: 8px;
}

.ge-control-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
}

.ge-control-btn:hover:not(:disabled) {
    background: var(--card-hover);
    color: var(--text-main);
}

.ge-control-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ge-control-btn svg {
    width: 12px;
    height: 12px;
}

/* 기본 도구 풀다운 드롭다운 영역 */
.ge-tool-dropdown-group {
    position: relative;
}

.ge-tool-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.ge-tool-title-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ge-tool-title-wrapper label {
    margin-bottom: 0 !important;
}

.ge-info-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    opacity: 0.7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.2s;
}

.ge-info-btn:hover {
    opacity: 1;
}

.ge-info-btn svg {
    width: 14px;
    height: 14px;
}

/* 우측 드롭다운 버튼 & 메뉴 래퍼 */
.ge-tool-dropdown-wrapper {
    position: relative;
}

.ge-tool-select-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.ge-tool-select-btn:hover {
    background: var(--card-hover);
    border-color: var(--text-secondary);
}

.ge-tool-select-btn .dropdown-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
    transition: transform 0.2s;
}

/* 드롭다운이 열렸을 때 쉐브론 방향 변경 */
.ge-tool-select-btn.active .dropdown-chevron {
    transform: rotate(180deg);
}

/* 플로팅 드롭다운 메뉴 */
.ge-tool-dropdown-menu {
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--premium-shadow);
    z-index: 100;
    min-width: 200px;
    padding: 6px 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ge-tool-dropdown-menu.hidden {
    display: none;
}

.ge-tool-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--text-main);
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ge-tool-option:hover {
    background: var(--card-hover);
}

.ge-tool-option svg:first-child {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    opacity: 0.9;
}

.ge-tool-option .check-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-blue);
    margin-left: auto;
}

.ge-tool-option.active {
    background: var(--sidebar-active-bg);
}

.ge-tool-option.active svg:first-child {
    color: var(--accent-blue);
}

.ge-tool-option.active span {
    color: var(--text-main);
    font-weight: 500;
}

/* 반응형: 모바일에서 1단 레이아웃 */
@media (max-width: 768px) {
    .gem-editor-body {
        flex-direction: column;
    }

    .gem-editor-left-panel,
    .gem-editor-right-panel {
        width: 100%;
        border-right: none;
    }

    .gem-editor-left-panel {
        border-bottom: 1px solid var(--border-color);
        max-height: 60vh;
    }

    .gem-editor-right-panel {
        flex: 1;
    }
}
