/* 처방 추출기 전용 스타일 */
.research-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.research-header {
    text-align: center;
    margin-bottom: 3rem;
}

.research-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.research-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #999;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
    border: 2px solid transparent;
    /* Creates padding effect */
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* 검색 인터페이스 */
/* 검색 인터페이스는 extractor-search.css로 이동됨 */

/* 진행 상황 표시는 extractor-search.css로 이동됨 */

/* 결과 표시 */
.extraction-results {
    display: none;
    position: relative;
}

.extraction-results.active {
    display: block;
}

.current-selection-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5a8a 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.prescription-info {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.prescription-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.prescription-name-badge {
    background-color: rgba(74, 109, 167, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

/* 섹션 타이틀 스타일 */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.source-text-container {
    padding: 0;
    margin-bottom: 2rem;
}

.highlight-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.highlight-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 6px 14px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.highlight-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.highlight-legend .legend-color.composition {
    background-color: var(--primary-color);
}

.highlight-legend .legend-color.indication {
    background-color: #059669;
}

.highlight-legend .legend-color.use-method {
    background-color: #d97706;
}

.highlight-legend .legend-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.highlight-legend .legend-label {
    color: #475569;
}

.source-text-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.expand-analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-analysis-btn:hover:not(:disabled) {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.source-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.source-text-link:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

.text-highlight {
    line-height: 1.85;
    font-size: 1.05rem;
    color: #334155;
    white-space: pre-wrap;
}

.highlight-composition {
    background-color: rgba(74, 109, 167, 0.08);
    color: var(--primary-color);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.highlight-indication {
    background-color: rgba(16, 185, 129, 0.08);
    /* Green tint */
    color: #059669;
    /* Green text */
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.highlight-use-method {
    background-color: rgba(217, 119, 6, 0.08);
    /* Orange tint */
    color: #d97706;
    /* Orange text */
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.extracted-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.field-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.field-card:hover {
    box-shadow: 0 4px 12px rgba(74, 109, 167, 0.05);
    border-color: rgba(74, 109, 167, 0.2);
}

.field-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.similarity-score {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Type-specific similarity pills */
.field-card.composition .similarity-score {
    background: rgba(74, 109, 167, 0.08);
    color: var(--primary-color);
}

.field-card.indication .similarity-score {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.field-card.use-method .similarity-score {
    background: rgba(217, 119, 6, 0.08);
    /* Updated to orange scale */
    color: #d97706;
}

/* Field-specific card borders REMOVED - Prohibited by design guidelines */
/* .field-card.composition { border-top: 3px solid var(--primary-color); } */
/* .field-card.indication { border-top: 3px solid #059669; } */
/* .field-card.use-method { border-top: 3px solid #d97706; } */

/* Body text result box specific styling */
.data-content.body-result {
    background-color: white;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.extracted-text,
.csv-reference-text {
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #f1f5f9;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.extracted-text {
    border-color: #e2e8f0;
}

.csv-reference-text {
    border-color: #f1f5f9;
}

/* Inner nested box ("Box within a Box") */
.data-content {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 1rem;
    line-height: 1.75;
    font-size: 0.95rem;
    color: #1e293b;
    margin-top: 0.75rem;
}

.csv-reference-text .data-content {
    background-color: #fcfcfc;
}

/* Fix spacing between tag and content */
.source-label {
    align-self: flex-start;
    margin-bottom: 0.85rem !important;
    margin-top: -0.25rem;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.db-label {
    background-color: rgba(74, 109, 167, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color) !important;
}

.csv-label {
    background-color: rgba(255, 160, 0, 0.1);
    color: #ffa000;
    border-left: 3px solid #ffa000 !important;
}

.region-info {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.75rem;
    display: block;
    text-align: right;
}

@media (max-width: 968px) {
    .extracted-fields {
        grid-template-columns: 1fr;
    }
}

/* ... 이하 생략 (나머지 스타일은 extractor-results.css 등으로 더 쪼갤 수 있음) ... */
/* 결과 목록 및 자동완성 스타일은 extractor-search.css로 이동됨 */

.search-results-list.collapsed .results-grid {
    display: none;
}

/* 서적 제목 자동완성 드롭다운 */
.book-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 4px;
}

.book-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #334155;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.book-suggestion-item:last-child {
    border-bottom: none;
}

.book-suggestion-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
    padding-left: 20px;
}

.search-results-list.collapsed .search-results-toggle {
    transform: rotate(-180deg);
}

.search-results-list.collapsed .results-grid {
    display: none;
}