/* analysis-result.css — 분석 결과 전용 페이지 (전체 화면) */

/* ── 헤더 ── */
.ar-header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    flex-shrink: 0;
}
.ar-header-info { flex: 1; min-width: 0; }
.ar-title-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ar-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-header-meta { display: flex; gap: var(--s-2); font-size: var(--text-sm); color: var(--text-sub); margin-top: var(--s-1); flex-wrap: wrap; }
.ar-header-meta span + span::before { content: '·'; margin-right: var(--s-1); color: var(--text-faint); }

/* ── 활용 버튼 바 ── */
.ar-action-bar {
    padding: var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    flex-shrink: 0;
}
.ar-action-buttons { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ── 본문 ── */
.ar-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-5);
    background: var(--bg);
}

/* ── 로딩 / 빈 상태 ── */
.ar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    padding: var(--s-10);
    color: var(--text-sub);
    font-size: var(--text-sm);
}
.ar-loading-spinner {
    width: var(--s-5-0); height: var(--s-5-0);
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ar-spin var(--duration-dramatic) linear infinite;
}
@keyframes ar-spin { to { transform: rotate(360deg); } }
.ar-empty {
    text-align: center;
    color: var(--text-faint);
    padding: var(--s-10);
    font-size: var(--text-sm);
}

/* ── 섹션 (접기/펴기) ── */
.ar-section { margin-bottom: var(--s-4); }
.ar-section-toggle {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    width: 100%;
    padding: var(--s-2) 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    text-align: left;
    transition: color var(--duration-fast, 150ms);
}
.ar-section-toggle:hover { color: var(--accent); }
.ar-section-arrow {
    display: inline-flex;
    transition: transform var(--duration-fast, 150ms) var(--easing-out, ease-out);
    flex-shrink: 0;
}
.ar-section-title { flex: 1; }
.ar-section-content {
    padding-left: var(--s-1);
    transition: max-height var(--duration-moderate) var(--easing-smooth), opacity var(--duration-base) var(--easing-smooth);
    overflow: hidden;
}
.ar-section-content.ar-collapsed {
    max-height: 0 !important;
    opacity: 0;
    overflow: hidden;
}

/* ── 카드 ── */
.ar-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius, 8px);
    padding: var(--s-3);
    margin-bottom: var(--s-2);
}
.ar-card strong { font-size: var(--text-sm); color: var(--text); display: block; margin-bottom: var(--s-1); }
.ar-card p { font-size: var(--text-sm); color: var(--text-sub); line-height: 1.6; margin: var(--s-1) 0 0; }
.ar-card--danger { border-left: 3px solid var(--red, #ef4444); }
.ar-card-header { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-1); }
.ar-card-tools { font-size: var(--text-sm); color: var(--text-faint); margin-top: var(--s-2); }

/* ── 그리드 ── */
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-2); }

/* ── 요약 ── */
.ar-summary-text { font-size: var(--text-sm); color: var(--text-sub); line-height: 1.7; margin: 0; }

/* ── 마크다운 ── */
.ar-markdown { font-size: var(--text-sm); color: var(--text-sub); line-height: 1.7; }
.ar-markdown h1, .ar-markdown h2, .ar-markdown h3, .ar-markdown h4 { color: var(--text); margin: var(--s-4) 0 var(--s-2); }
.ar-markdown h1 { font-size: var(--text-xl); }
.ar-markdown h2 { font-size: var(--text-lg); }
.ar-markdown h3 { font-size: var(--text-base); }
.ar-markdown h4 { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.ar-markdown p { margin: var(--s-2) 0; }
.ar-markdown ul, .ar-markdown ol { padding-left: var(--s-5); margin: var(--s-2) 0; }
.ar-markdown li { margin: var(--s-1) 0; }
.ar-markdown code { background: var(--surface); padding: var(--s-0) var(--s-1); border-radius: var(--radius, 4px); font-size: var(--text-sm); }
.ar-markdown pre { background: var(--surface); padding: var(--s-3); border-radius: var(--radius, 8px); overflow-x: auto; font-size: var(--text-sm); }
.ar-markdown blockquote { border-left: 3px solid var(--accent); padding-left: var(--s-3); margin: var(--s-3) 0; color: var(--text-faint); }
.ar-markdown table { width: 100%; border-collapse: collapse; margin: var(--s-3) 0; }
.ar-markdown th, .ar-markdown td { border: 1px solid var(--line); padding: var(--s-2); text-align: left; font-size: var(--text-sm); }
.ar-markdown th { background: var(--surface); font-weight: var(--weight-semibold); }

/* ── pre (promptContext, JSON 등) ── */
.ar-pre {
    white-space: pre-wrap;
    font-size: var(--text-sm);
    color: var(--text-sub);
    background: var(--surface);
    padding: var(--s-3);
    border-radius: var(--radius, 8px);
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--line);
}
.ar-json { font-family: var(--font-mono); font-size: var(--text-sm); max-height: 400px; }

/* ── 기타 (플레이북, 리스트 등) ── */
.ar-steps { padding-left: var(--s-5); margin: var(--s-2) 0; }
.ar-steps li { font-size: var(--text-sm); color: var(--text-sub); margin: var(--s-1) 0; }
.ar-insights li { font-size: var(--text-sm); color: var(--text-sub); line-height: 1.6; margin: var(--s-1) 0; }
.ar-sub-heading { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-sub); margin: var(--s-3) 0 var(--s-2); }
.ar-formula { margin-top: var(--s-2); }
.ar-formula > div { font-size: var(--text-sm); color: var(--text-sub); margin: var(--s-1) 0; }
.ar-formula-label { font-weight: var(--weight-medium); color: var(--text); display: inline-block; min-width: 40px; }

/* ── 플레이북 ── */
.ar-playbook { counter-reset: step; list-style: none; padding: 0; }
.ar-playbook li {
    counter-increment: step;
    padding: var(--s-3);
    padding-left: var(--s-8);
    border-left: 2px solid var(--accent);
    margin-bottom: var(--s-2);
    position: relative;
}
.ar-playbook li::before {
    content: counter(step);
    position: absolute;
    left: calc(-1 * var(--s-3));
    width: var(--s-5); height: var(--s-5);
    background: var(--accent);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

/* ── 이미지 갤러리 ── */
.ar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--s-3);
}
.ar-gallery-item { position: relative; }
.ar-gallery-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius, 8px);
    cursor: pointer;
    transition: transform var(--duration-fast, 150ms), box-shadow var(--duration-fast, 150ms);
}
.ar-gallery-img:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.ar-gallery-caption { font-size: var(--text-sm); color: var(--text-sub); margin-top: var(--s-1); line-height: 1.4; }

/* ── 라이트박스 ── */
.ar-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--s-3);
    animation: ar-fade-in var(--duration-base) var(--easing-smooth);
}
@keyframes ar-fade-in { from { opacity: 0; } to { opacity: 1; } }
.ar-lightbox-close {
    position: absolute;
    top: var(--s-4);
    right: var(--s-4);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--duration-fast);
}
.ar-lightbox-close:hover { opacity: 1; }
.ar-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius, 8px);
}
.ar-lightbox-caption { color: rgba(255,255,255,0.7); font-size: var(--text-sm); max-width: 600px; text-align: center; }


/* 채널 프사 (아바타) */
.ar-channel-avatar {
    width: var(--s-7-5);
    height: var(--s-7-5);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--line);
}
.ar-channel-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-active, var(--surface));
    color: var(--text-sub);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

/* ── 패널 기본 스타일 ── */
#panel-analysis-result {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    height: 100%;
}
