/* ====================================
   СТРАНИЦА СРАВНЕНИЯ КЛИНИК
   ==================================== */

.comparison-content {
    padding: 40px 0;
    min-height: 60vh;
}

/* Панель управления */
.comparison-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.comparison-count-text {
    font-size: 16px;
    color: #374151;
    margin: 0;
    font-weight: 500;
}

.comparison-count-text span {
    color: #7acacd;
    font-weight: 600;
}

.comparison-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-browse-clinics,
.btn-clear-comparison {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-browse-clinics {
    background: #7acacd;
    color: white;
}

.btn-browse-clinics:hover {
    background: #5ABABD;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-clear-comparison {
    background: #EF4444;
    color: white;
}

.btn-clear-comparison:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

/* Таблица сравнения */
.comparison-table-container {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
}

.comparison-table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.comparison-header,
.comparison-row {
    display: grid;
    border-bottom: 1px solid #E5E7EB;
}

.comparison-header {
    background: #F9FAFB;
    font-weight: 600;
}

.comparison-row:last-child {
    border-bottom: none;
}

/* Динамическая сетка в зависимости от количества клиник */
.comparison-header[data-clinics="1"],
.comparison-row[data-clinics="1"] {
    grid-template-columns: 200px 1fr;
}

.comparison-header[data-clinics="2"],
.comparison-row[data-clinics="2"] {
    grid-template-columns: 200px 1fr 1fr;
}

.comparison-header[data-clinics="3"],
.comparison-row[data-clinics="3"] {
    grid-template-columns: 200px 1fr 1fr 1fr;
}

.comparison-header[data-clinics="4"],
.comparison-row[data-clinics="4"] {
    grid-template-columns: 200px 1fr 1fr 1fr 1fr;
}

/* По умолчанию для всех случаев */
.comparison-header,
.comparison-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.comparison-row-header {
    padding: 16px 20px;
    background: #F9FAFB;
    font-weight: 600;
    color: #374151;
    border-right: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    min-width: 200px;
}

.comparison-clinic-header {
    padding: 16px 20px;
    text-align: center;
    position: relative;
    border-right: 1px solid #E5E7EB;
}

.comparison-clinic-header:last-child {
    border-right: none;
}

.clinic-header-image {
    width: 80px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.clinic-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clinic-header-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.clinic-location {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.remove-from-comparison {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: #EF4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.remove-from-comparison:hover {
    opacity: 1;
    background: #DC2626;
    transform: scale(1.1);
}

.comparison-cell {
    padding: 16px 20px;
    border-right: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #374151;
}

.comparison-cell:last-child {
    border-right: none;
}

/* Специальные стили для ячеек */
.rating-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #7acacd;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.specialty-tag-small {
    display: inline-block;
    padding: 4px 8px;
    background: #F3F4F6;
    color: #374151;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
    font-weight: 500;
}

.view-clinic-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #7acacd;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-clinic-btn:hover {
    background: #5ABABD;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Пустое состояние */
.comparison-empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.empty-state-content {
    text-align: center;
    max-width: 400px;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(122, 202, 205, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7acacd;
    font-size: 32px;
}

.empty-state-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 12px 0;
}

.empty-state-content p {
    font-size: 16px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.btn-primary-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #7acacd;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-large:hover {
    background: #5ABABD;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 202, 205, 0.3);
}

/* Загрузка */
.comparison-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top: 4px solid #7acacd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.comparison-loading p {
    color: #6B7280;
    font-size: 16px;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .comparison-table {
        font-size: 14px;
    }
    
    .comparison-row-header {
        min-width: 160px;
    }
    
    .clinic-header-image {
        width: 60px;
        height: 45px;
    }
    
    .clinic-header-info h3 {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .comparison-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .comparison-actions {
        justify-content: center;
    }
    
    /* На мобильных показываем в виде карточек, а не таблицы */
    .comparison-table {
        display: block;
    }
    
    .comparison-header {
        display: none; /* Скрываем заголовок таблицы */
    }
    
    .comparison-row {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .comparison-row-header {
        background: #7acacd;
        color: white;
        text-align: center;
        border-right: none;
        border-bottom: 1px solid #E5E7EB;
        min-width: auto;
    }
    
    .comparison-cell {
        border-right: none;
        border-bottom: 1px solid #E5E7EB;
        justify-content: flex-start;
        text-align: left;
    }
    
    .comparison-cell:last-child {
        border-bottom: none;
    }
    
    /* Мобильные карточки клиник */
    .comparison-clinic-header {
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid #E5E7EB;
    }
    
    .clinic-header-image {
        width: 50px;
        height: 38px;
        float: left;
        margin: 0 12px 0 0;
    }
    
    .clinic-header-info {
        text-align: left;
    }
    
    .clinic-header-info h3 {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .remove-from-comparison {
        position: static;
        float: right;
        margin-top: 8px;
    }
}