/* =================================================================
           layout.css - 레이아웃 거시 프레임, 입력 폼 및 프로필 영역
           ================================================================= */
.report-container {
    max-width: 1200px;
    margin: 0 auto 30px;
    background: white;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    box-sizing: border-box;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid #2c3e50;
    padding-bottom: 12px;
    margin-bottom: 25px;
}

.report-header h1 {
    font-size: 2.2em;
    margin: 0;
    color: #1a252f;
    letter-spacing: -1px;
}

.report-header .analysis-date {
    font-size: 0.9em;
    color: #7f8c8d;
}

h2 {
    color: #2c3e50;
    border-bottom: 3px solid #34495e;
    padding-bottom: 8px;
    margin-top: 40px;
    font-size: 1.3em;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid #34495e;
    padding-bottom: 8px;
    margin-top: 40px;
}

.section-header h2 {
    border: none;
    padding: 0;
    margin: 0;
}

/* 입력 폼 인프라 스트럭처 */
#input-section {
    transition: all 0.3s ease;
    scroll-margin-top: 40px; /* 🌟 폼 상단 스크롤 이동 시 40px의 예쁜 여백 강제 확보 */
}

.input-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
}

.input-form-grid label {
    font-weight: bold;
    font-size: 0.9em;
    color: #576574;
    display: block;
    margin-bottom: 6px;
}

input[type="text"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1.05em;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-group label input[type="checkbox"] {
    transform: scale(1.1);
    margin-right: 6px;
    accent-color: #2c3e50;
    cursor: pointer;
}

/* 액션 트랜잭션 단추 단 */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: #2c3e50;
    color: white;
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.2);
    margin-top: 10px;
}

.btn-submit:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 37, 47, 0.3);
}

.btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

#toggle-btn {
    width: 100%;
    padding: 12px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
}

#toggle-btn:hover { background: #7f8c8d; }

.page-shell {
    display: flex;
    gap: 14px;
    max-width: 1600px;
    margin: 30px auto 40px;
    align-items: flex-start;
}

/* ========================================================
   🌟 사이드바 및 아이템 여백 축소
   ======================================================== */
.sidebar {
    width: 260px;
    min-width: 220px;
    max-width: 320px;
    height: 100%;
    max-height: 100%;
    padding: 8px; 
    border: 2px solid #3b82f6;
    border-radius: 12px; 
    background: #f7fbff;
    box-shadow: 0 18px 45px rgba(31, 72, 110, 0.08);
    position: relative;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* ========================================================
   🌟 사이드바 슬라이더(Resizer) 투명/세련미 + Flexbox 방어
   ======================================================== */
.sidebar-resizer {
    width: 4px;
    margin: 0 2px;
    align-self: stretch; 
    flex-shrink: 0;      
    cursor: ew-resize;
    background: transparent;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-left: none;
    transition: background 0.2s ease, width 0.2s ease;
}

.sidebar-resizer:hover, .sidebar-resizer:active {
    background: rgba(44, 62, 80, 0.2); 
    border-right: 1px solid rgba(44, 62, 80, 0.3);
}

.sidebar.collapsed {
    width: 62px;
    min-width: 62px;
    overflow: hidden;
    padding-left: 12px;
    padding-right: 12px;
}

.sidebar.collapsed .sidebar-actions,
.sidebar.collapsed .sidebar-list,
.sidebar.collapsed .sidebar-empty,
.sidebar.collapsed .sidebar-subtitle {
    display: none;
}

#main-content {
    flex: 1;
    min-width: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-header h2 {
    margin: 0 0 6px;
    font-size: 1.15em;
    color: #1f3d6b;
}

.sidebar-subtitle {
    margin: 0;
    font-size: 0.92em;
    line-height: 1.5;
    color: #5d7188;
}

.sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-submit.small {
    width: auto;
    padding: 10px 14px;
    font-size: 0.9em;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px; 
    padding: 10px 12px; 
    border-radius: 12px; 
    border: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    background: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.sidebar-item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item-main strong {
    font-size: 1em;
    color: #1b3253;
}

.sidebar-item-meta {
    font-size: 0.86em;
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-tag {
    padding: 3px 9px;
    background: #eef6ff;
    color: #1c3b72;
    border-radius: 999px;
    font-size: 0.78em;
}

.sidebar-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
}

.sidebar-item-actions button {
    border: none;
    border-radius: 10px;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85em;
}

.sidebar-item-actions button:hover {
    background: #1c2d3f;
}

.sidebar-empty {
    padding: 18px;
    border-radius: 14px;
    background: #eef6ff;
    color: #4f6b8c;
    font-size: 0.95em;
    border: 1px dashed #d4e4f1;
    text-align: center;
}



/* ========================================================
   🌟 사이드바 상세 검색 패널 디자인 (layout.css 추가)
   ======================================================== */
.sidebar-search-panel {
    background: #ffffff;
    border: 1px solid #d2e0ec;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, border 0.3s ease;
    max-height: 300px;
    opacity: 1;
}

/* 검색창이 접힌 상태 */
.sidebar-search-panel.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border: none;
}

.sidebar-search-panel input,
.sidebar-search-panel select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85em;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search-panel input:focus,
.sidebar-search-panel select:focus {
    border-color: #0f766e;
}

/* 👇 사이드바 전체가 숨겨질 때 검색 패널도 함께 감추기 위해 기존 코드에 추가 */
.sidebar.collapsed .sidebar-actions,
.sidebar.collapsed .sidebar-search-panel, /* <-- 이 줄 추가 */
.sidebar.collapsed .sidebar-list,
.sidebar.collapsed .sidebar-empty,
.sidebar.collapsed .sidebar-subtitle,
.sidebar.collapsed .sidebar-tabs,
.sidebar.collapsed #tab-content-target,
.sidebar.collapsed #tab-content-tools {
    display: none !important;
}


/* 프로필 정보 요약 카드 */
.profile-card {
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #f4f8ff 0%, #e6f0fa 100%);
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 35px;
    border: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    gap: 20px 45px;
    align-items: center;
}

.profile-item { display: flex; flex-direction: column; }
.profile-item span { font-size: 0.85em; color: #576574; margin-bottom: 6px; font-weight: 700; letter-spacing: 0.5px; }
.profile-item strong { color: #2c3e50; font-size: 1.1em; font-weight: 700; word-break: keep-all; }
.profile-item.name strong { font-size: 1.5em; font-weight: 900; color: #1a252f; }

/* 특수 항목 글자 크기 보정 (글자 길이에 따른 조정) */
#r-tst { font-size: 1.2em; color: #360ae2; }
.profile-item .short-label { margin: 0; min-width: 30px; }

/* 접기/펴기 슬라이더 콤포넌트 */
.collapsible-content { max-height: 6000px; overflow: visible !important; transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out; opacity: 1; }
.collapsible-content.collapsed { max-height: 0 !important; opacity: 0 !important; overflow: hidden !important; margin-top: 0 !important; padding-top: 0 !important; border: none !important; }

.toggle-saju-btn { 
    background: #ffffff; 
    border: 1px solid #cbd5e1; 
    padding: 6px 14px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 700; 
    font-size: 0.85em; 
    color: #475569; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}
.toggle-saju-btn:hover { 
    background: #f8fafc; 
    color: #1e293b; 
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}
.toggle-saju-btn.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-print { position: fixed; bottom: 40px; right: 40px; z-index: 1000; background: #fb7b03; color: white; padding: 16px 24px; border-radius: 50px; box-shadow: 0 10px 25px rgba(8, 124, 240, 0.25); font-size: 1.1em; font-weight: bold; cursor: pointer; border: none; transition: all 0.2s ease; }

/* 개인 지식베이스 전용 토글 라벨 */
.kb-toggle-container { display: flex; justify-content: flex-end; align-items: center; padding: 10px 15px; margin-bottom: 5px; }
.kb-toggle-label { font-size: 0.95em; font-weight: bold; color: #2c3e50; display: flex; align-items: center; cursor: pointer; }
.kb-toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; margin-right: 10px; }
.kb-toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #bdc3c7; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
input:checked+.slider { background-color: #2980b9; }
input:checked+.slider:before { transform: translateX(22px); }

/* ========================================================
   🌟 방사형 태극무늬 플로팅 버튼 메뉴 (FAB) 공통
   ======================================================== */
#fab-main {
    width: 60px; height: 60px; border-radius: 50%; cursor: ns-resize; /* 🌟 상하 드래그 의미를 담은 커서 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); position: absolute; z-index: 10;
    background: linear-gradient(to bottom, #e74c3c 50%, #3498db 50%);
    border: 3px solid white; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease; user-select: none;
}
#fab-main:hover { transform: rotate(0deg) scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
#fab-container.active #fab-main { transform: rotate(180deg); }
#fab-container.active #fab-main:hover { transform: rotate(180deg) scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
#fab-main::before { content: ''; position: absolute; left: 0; top: 25%; width: 50%; height: 50%; background: #e74c3c; border-radius: 50%; }
#fab-main::after { content: ''; position: absolute; right: 0; top: 25%; width: 50%; height: 50%; background: #3498db; border-radius: 50%; }

/* 🌟 차일드 프레임 전용: 상하좌우 자유이동(자석) 커서 부여 */
body.is-embed #fab-main {
    cursor: move;
}

/* 🌟 메인 프레임 전용: 태극 버튼 크기 1.5배 (90x90) 및 자식 버튼 중앙 정렬 보정 */
body:not(.is-embed) #fab-main {
    width: 90px; height: 90px;
}
body:not(.is-embed) .fab-item {
    top: 20px; left: 20px;
}
.fab-item {
    position: absolute; top: 5px; left: 5px; width: 50px; height: 50px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; font-size: 13px; font-weight: bold; color: #2c3e50;
    background: white; border: none; box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    cursor: pointer; opacity: 0; transform: scale(0); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5; text-decoration: none;
}
.fab-item::before {
    content: attr(data-tooltip); position: absolute; top: 50%; transform: translateY(-50%);
    right: var(--tt-right, 60px); left: var(--tt-left, auto);
    background: rgba(0,0,0,0.75); color: white; padding: 6px 12px; border-radius: 6px;
    font-size: 13px; font-weight: bold; white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity 0.2s;
}
.fab-item:hover::before { opacity: 1; }
.fab-item:hover { background: #f8f9fa; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }