/* Стили для страницы рекомендаций */
.header-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.form-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.result-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.template-card {
    border: 2px solid #e8f5e9;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s;
    background: #f1f8e9;
}

.template-card:hover {
    border-color: #4caf50;
    background-color: #e8f5e9;
    transform: translateY(-2px);
}

.template-card.active {
    border-color: #4caf50;
    background-color: #e8f5e9;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.template-badge {
    background: #4caf50;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}

.icd-code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.icd-code-item:hover {
    background-color: #f5f5f5;
}

.icd-code {
    font-weight: bold;
    color: #1e3c72;
}

.icd-name {
    color: #555;
    font-size: 14px;
    flex-grow: 1;
    margin-left: 15px;
}

.selected-code {
    background: #e8f4ff;
    border: 1px solid #2196f3;
    border-radius: 5px;
    padding: 8px 12px;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-pill {
    display: inline-block;
    background: #1976d2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
}

.template-description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.recommendation-item {
    padding: 15px;
    margin: 12px 0;
    border-left: 4px solid #2196f3;
    background-color: #f8f9fa;
    border-radius: 0 6px 6px 0;
}

.source-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
    cursor: pointer;
}

.source-item {
    font-size: 12px;
    color: #555;
    padding: 10px;
    background: #f1f8ff;
    border-radius: 5px;
    margin: 6px 0;
    border-left: 3px solid #17a2b8;
}

.sources-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
    padding: 8px;
    background: #fafafa;
    border-radius: 5px;
    border: 1px solid #eee;
}

.tab-content {
    padding: 15px 0;
}

.markdown-content {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #f6f8fa;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.section-header {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin: 25px 0 15px 0;
    padding-top: 15px;
}

.view-full-btn {
    font-size: 11px;
    padding: 1px 6px;
    margin-left: 5px;
    cursor: pointer;
    color: #007bff;
}

.content-preview {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.content-preview:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, #f1f8ff);
}

.item-number {
    display: inline-block;
    min-width: 25px;
    font-weight: bold;
    color: #2196f3;
}

.stats-badge {
    background: #6c757d;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Дополнительные стили для улучшения внешнего вида */
.list-group-item {
    border-left: none;
    border-right: none;
    background: transparent;
}

.source-icon {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.source-icon:hover {
    opacity: 1;
}

.badge {
    font-size: 0.7rem;
    font-weight: normal;
    cursor: help;
}

[data-bs-toggle="collapse"] i.bi-chevron-right {
    transition: transform 0.2s;
    font-size: 0.8rem;
}

[data-bs-toggle="collapse"][aria-expanded="true"] i.bi-chevron-right {
    transform: rotate(90deg);
}

.services-list {
    font-size: 0.9rem;
}

.service-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-item:hover {
    background-color: #f8f9fa;
}

.service-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #0d6efd;
    background-color: #e7f1ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    min-width: 130px;
    text-align: center;
}

.service-name {
    flex: 1;
    color: #212529;
}

.service-item .bi-pin-angle-fill {
    color: #ffc107;
    margin-left: 8px;
    font-size: 0.9rem;
}

.service-priority-badge {
    background-color: #ffc107;
    color: #000;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    white-space: nowrap;
}

.services-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.highlight {
    background-color: #fff3cd;
    font-weight: 500;
}

/* Анимация загрузки */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading-pulse {
    animation: pulse 1.5s infinite;
}

/* Дополнительные стили для списка услуг */
#servicesList .list-group-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-left: none;
    border-right: none;
}

#servicesList .list-group-item:first-child {
    border-top: none;
}

#servicesList .badge.bg-secondary {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

#servicesList .badge.bg-success,
#servicesList .badge.bg-info {
    font-size: 0.7rem;
}
